@@ -102,8 +102,10 @@
</where>
</where>
</select>
</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" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
@@ -356,16 +358,38 @@
</select>
</select>
<select id="findCountByDateLimit" resultType="java.lang.Integer">
<select id="findCountByDateLimit" resultType="java.lang.Integer">
select COUNT(*) FROM wx_coupon_order where tenant_id = #{tenantId} and create_date >= #{startTime} and create_date <= #{endTime}
select COUNT(*) FROM wx_coupon_order
where tenant_id = #{tenantId}
and create_date >= #{startTime}
and create_date <= #{endTime}
</select>
</select>
<select id="couponDataMap" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
<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 >= #{startTime} and c.update_date <= #{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 >= #{startTime} and d.update_date <= #{endTime}) as verifyUserCount
from wx_coupon_order where tenant_id=#{tenantId} AND create_date >= #{startTime} and create_date <= #{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 >= #{startTime}
AND c.update_date <= #{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 >= #{startTime}
AND d.update_date <= #{endTime}) as verifyUserCount
from wx_coupon_order
where tenant_id=#{tenantId}
AND create_date >= #{startTime}
AND create_date <= #{endTime}
GROUP BY createTime
</select>
</select>
<select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
<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
,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount
,(select Count(coupon_id) from wx_coupon_order c
,(select Count(coupon_id) from wx_coupon_order c
where coupon_order_status=1
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 >= #{startTime}
</if>
<if test="endTime != null">
and c.update_date <= #{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 >= #{startTime}
</if>
<if test="endTime != null">
and c.update_date <= #{endTime}
</if>
) as verifyCount
) as verifyCount
,(select Count(DISTINCT c_user_id) from wx_coupon_order d
,(select Count(DISTINCT c_user_id) from wx_coupon_order d
where coupon_order_status=1
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 >= #{startTime}
</if>
<if test="endTime != null">
and d.update_date <= #{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 >= #{startTime}
</if>
<if test="endTime != null">
and d.update_date <= #{endTime}
</if>
) as verifyUserCount
) as verifyUserCount
from wx_coupon_order
from wx_coupon_order
join wx_coupon on wx_coupon_order.coupon_id=wx_coupon.id
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 >= #{startTime}
</if>
<if test="endTime != null">
and wx_coupon_order.create_date <= #{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 >= #{startTime}
</if>
<if test="endTime != null">
and wx_coupon_order.create_date <= #{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
order by createTime desc
</select>
</select>