Просмотр исходного кода

[A端][需求]:增加券可用商户名列表接口

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
27b48919ed
4 измененных файлов: 102 добавлений и 58 удалений
  1. +23
    -17
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  2. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml
  3. +14
    -0
      mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml
  4. +64
    -40
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 23
- 17
mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java Просмотреть файл

@@ -14,7 +14,11 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {

List<WxCouponOrder> findList(WxCouponOrder wxCouponOrder);
Integer countList(WxCouponOrder wxCouponOrder);


Integer dayCountCarList(Map params);
List<WxCouponOrderCarCVo> findCarListOfCUser(WxCouponOrderCarCVo wxCouponOrder);


List<WxCouponOrder> findListOfOrderedByDate(Map dateMap);
List<WxCouponOrder> findListOfVerifiedByDate(Map dateMap);
@@ -27,7 +31,19 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
List<WxCouponOrderCVo> findListOfCUser(WxCouponOrderCVo wxCouponOrder);
List<WxCouponOrderBVo> findListOfAdmin(WxCouponOrderBVo wxCouponOrder);

List<WxCouponOrderCarCVo> findCarListOfCUser(WxCouponOrderCarCVo wxCouponOrder);
/**
* 查询用户核销/领券数
* @param cUserId
* @param startTime
* @param endTime
* @return
*/
int findOrderedCountForCUser(@Param("cUserId")Long cUserId,@Param("startTime") Date startTime,@Param("endTime")Date endTime);
int findVerifiedCountForCUser(@Param("cUserId")Long cUserId,@Param("startTime") Date startTime,@Param("endTime")Date endTime);





//营销报表 券数据图表
List<MarkingCouponDataReportVo> couponDataMap(HashMap<String,Object> params);
@@ -65,26 +81,10 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
int queryPriceTotal(@Param("tenantId")String tenantId, @Param("startTime") Date startTime, @Param("endTime")Date endTime);



void offExpiredCouponOrderByValidDate();
List<WxCouponOrder> findExpiredCouponOrderByValidDate();


List<MarkingSceneDataVo> queryForSceneRepotyHistoryVerified(HashMap<String,Object> params);

/**
* 查询用户核销/领券数
* @param cUserId
* @param startTime
* @param endTime
* @return
*/
int findOrderedCountForCUser(@Param("cUserId")Long cUserId,@Param("startTime") Date startTime,@Param("endTime")Date endTime);
int findVerifiedCountForCUser(@Param("cUserId")Long cUserId,@Param("startTime") Date startTime,@Param("endTime")Date endTime);

/**
* 查询核销/领券数
* @param cUserId
* @param startTime
* @param endTime
* @return
@@ -92,4 +92,10 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
int findOrderedCount(@Param("tenantId")String tenantId, @Param("startTime") Date startTime,@Param("endTime")Date endTime);
int findVerifiedCount(@Param("tenantId")String tenantId, @Param("startTime") Date startTime,@Param("endTime")Date endTime);




void offExpiredCouponOrderByValidDate();

List<WxCouponOrder> findExpiredCouponOrderByValidDate();
}

+ 1
- 1
mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml Просмотреть файл

@@ -132,7 +132,7 @@
<collection column="{productId=coupon_id}" property="merchantVoList"
ofType="com.iformall.domain.vo.WxMerchantVo"
javaType="java.util.ArrayList"
select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantVoList" >
select="com.iformall.mapper.WxCouponMerchantMapper.findMerchantNameList" >
</collection>
</resultMap>



+ 14
- 0
mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml Просмотреть файл

@@ -94,4 +94,18 @@
left join wx_mall_floor mf on s.floor = mf.id
where cm.product_id = #{productId}
</select>


<sql id="allMerchantNameColumns">
m.id,m.name,m.status
</sql>

<select id="findMerchantNameList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
select
<include refid="allMerchantNameColumns"/>
from wx_coupon_merchant cm
left join wx_merchant m on m.id = cm.merchant_id
where cm.product_id = #{productId}
</select>

</mapper>

+ 64
- 40
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -102,8 +102,10 @@
</where>
</select>

<resultMap id="BVoResultMap" type="com.iformall.domain.vo.WxCouponOrderBVo">



<resultMap id="BVoResultMap" type="com.iformall.domain.vo.WxCouponOrderBVo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
@@ -356,16 +358,38 @@

</select>



<select id="findCountByDateLimit" resultType="java.lang.Integer">
select COUNT(*) FROM wx_coupon_order where tenant_id = #{tenantId} and create_date &gt;= #{startTime} and create_date &lt;= #{endTime}
select COUNT(*) FROM wx_coupon_order
where tenant_id = #{tenantId}
and create_date &gt;= #{startTime}
and create_date &lt;= #{endTime}
</select>

<select id="couponDataMap" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
SELECT DATE_FORMAT(create_date,'%m/%d') as createTime
,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount
,(select Count(*) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%m/%d')=createTime and tenant_id=#{tenantId} AND c.update_date &gt;= #{startTime} and c.update_date &lt;= #{endTime}) as verifyCount
,(select Count(DISTINCT c_user_id) from wx_coupon_order d where coupon_order_status=1 AND DATE_FORMAT(create_date,'%m/%d')=createTime and tenant_id=#{tenantId} AND d.update_date &gt;= #{startTime} and d.update_date &lt;= #{endTime}) as verifyUserCount
from wx_coupon_order where tenant_id=#{tenantId} AND create_date &gt;= #{startTime} and create_date &lt;= #{endTime} GROUP BY createTime
SELECT DATE_FORMAT(create_date,'%m/%d') as createTime,
COUNT(DISTINCT c_user_id) as couponUserCount,
count(*) as couponCount,
(select Count(*)
from wx_coupon_order c
where coupon_order_status=1
AND DATE_FORMAT(create_date,'%m/%d')=createTime
AND tenant_id=#{tenantId}
AND c.update_date &gt;= #{startTime}
AND c.update_date &lt;= #{endTime}) as verifyCount,
(select Count(DISTINCT c_user_id)
from wx_coupon_order d
where coupon_order_status=1
AND DATE_FORMAT(create_date,'%m/%d')=createTime
AND tenant_id=#{tenantId}
AND d.update_date &gt;= #{startTime}
AND d.update_date &lt;= #{endTime}) as verifyUserCount
from wx_coupon_order
where tenant_id=#{tenantId}
AND create_date &gt;= #{startTime}
AND create_date &lt;= #{endTime}
GROUP BY createTime
</select>

<select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
@@ -373,45 +397,45 @@
,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount
,(select Count(coupon_id) from wx_coupon_order c
where coupon_order_status=1
and DATE_FORMAT(create_date,'%Y-%m-%d')=createTime
and tenant_id=#{tenantId}
and c.coupon_id=couponId
<if test="startTime != null">
and c.update_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and c.update_date &lt;= #{endTime}
</if>
and DATE_FORMAT(create_date,'%Y-%m-%d')=createTime
and tenant_id=#{tenantId}
and c.coupon_id=couponId
<if test="startTime != null">
and c.update_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and c.update_date &lt;= #{endTime}
</if>
) as verifyCount
,(select Count(DISTINCT c_user_id) from wx_coupon_order d
where coupon_order_status=1
and d.coupon_id=couponId
and DATE_FORMAT(create_date,'%Y-%m-%d')=createTime
and tenant_id=#{tenantId}
and d.coupon_id=couponId
<if test="startTime != null">
and d.update_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and d.update_date &lt;= #{endTime}
</if>
and d.coupon_id=couponId
and DATE_FORMAT(create_date,'%Y-%m-%d')=createTime
and tenant_id=#{tenantId}
and d.coupon_id=couponId
<if test="startTime != null">
and d.update_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and d.update_date &lt;= #{endTime}
</if>
) as verifyUserCount
from wx_coupon_order
join wx_coupon on wx_coupon_order.coupon_id=wx_coupon.id
where wx_coupon_order.tenant_id=#{tenantId}
<if test="startTime != null">
and wx_coupon_order.create_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and wx_coupon_order.create_date &lt;= #{endTime}
</if>
<if test="couponType != null">
and wx_coupon.type = #{couponType}
</if>
<if test="couponTitle != null">
and wx_coupon.title like concat('%', #{couponTitle},'%')
</if>
GROUP BY createTime,couponId
where wx_coupon_order.tenant_id=#{tenantId}
<if test="startTime != null">
and wx_coupon_order.create_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and wx_coupon_order.create_date &lt;= #{endTime}
</if>
<if test="couponType != null">
and wx_coupon.type = #{couponType}
</if>
<if test="couponTitle != null">
and wx_coupon.title like concat('%', #{couponTitle},'%')
</if>
GROUP BY createTime,couponId
order by createTime desc
</select>



Загрузка…
Отмена
Сохранить