|
|
|
@@ -73,36 +73,66 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCountByDateLimit" resultType="java.lang.Integer"> |
|
|
|
select COUNT(*) FROM wx_coupon_action_log where tenant_id = #{tenantId} and `createtime` >= #{startTime} and `createtime` <= #{endTime} |
|
|
|
select COUNT(*) FROM wx_coupon_action_log |
|
|
|
where tenant_id = #{tenantId} |
|
|
|
and `createtime` >= #{startTime} |
|
|
|
and `createtime` <= #{endTime} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sceneDataMap" resultType="com.iformall.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> |
|
|
|
select DATE_FORMAT(createtime,'%m/%d') as xTime, (select Count(*) from wx_coupon_action_log c where DATE_FORMAT(createtime,'%m/%d')=xTime and c.channel_type=3 and tenant_id=#{tenantId} ) as parkSendCount,(select Count(*) from wx_coupon_action_log c where DATE_FORMAT(createtime,'%m/%d')=xTime and c.channel_type=4 and tenant_id=#{tenantId}) as verifySendCount |
|
|
|
from wx_coupon_action_log where tenant_id=#{tenantId} and createtime >= #{startTime} and createtime <= #{endTime} group by xTime |
|
|
|
select DATE_FORMAT(createtime,'%m/%d') as xTime, |
|
|
|
(select Count(*) from wx_coupon_action_log c |
|
|
|
where DATE_FORMAT(createtime,'%m/%d')=xTime |
|
|
|
and c.channel_type=2 |
|
|
|
and tenant_id=#{tenantId} ) as parkSendCount, |
|
|
|
(select Count(*) from wx_coupon_action_log c |
|
|
|
where DATE_FORMAT(createtime,'%m/%d')=xTime |
|
|
|
and c.channel_type=3 |
|
|
|
and tenant_id=#{tenantId}) as verifySendCount |
|
|
|
from wx_coupon_action_log |
|
|
|
where tenant_id=#{tenantId} |
|
|
|
and createtime >= #{startTime} |
|
|
|
and createtime <= #{endTime} group by xTime |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sceneDataMapJoinCouponOrder" resultType="com.iformall.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> |
|
|
|
select DATE_FORMAT(create_date,'%m/%d') AS xTime,COUNT(wx_coupon_order.id) as tempCount from wx_coupon_action_log left join wx_coupon_order on wx_coupon_action_log.coupon_order_id=wx_coupon_order.id where wx_coupon_action_log.tenant_id=#{tenantId} |
|
|
|
AND wx_coupon_order.coupon_order_status = 1 and wx_coupon_action_log.createtime >= #{startTime} and wx_coupon_action_log.createtime <= #{endTime} |
|
|
|
AND wx_coupon_action_log.channel_type = #{channelType} group by xTime |
|
|
|
select DATE_FORMAT(create_date,'%m/%d') AS xTime,COUNT(wx_coupon_order.id) as tempCount from wx_coupon_action_log |
|
|
|
left join wx_coupon_order on wx_coupon_action_log.coupon_order_id=wx_coupon_order.id |
|
|
|
where wx_coupon_action_log.tenant_id=#{tenantId} |
|
|
|
and wx_coupon_order.coupon_order_status = 1 |
|
|
|
and wx_coupon_action_log.createtime >= #{startTime} |
|
|
|
and wx_coupon_action_log.createtime <= #{endTime} |
|
|
|
and wx_coupon_action_log.channel_type = #{channelType} group by xTime |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sceneDataList" resultType="com.iformall.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> |
|
|
|
select DATE_FORMAT(createtime,'%Y-%m-%d') as xTime, (select Count(*) from wx_coupon_action_log c where DATE_FORMAT(createtime,'%Y-%m-%d')=xTime and c.channel_type=3 and tenant_id=#{tenantId} ) as parkSendCount,(select Count(*) from wx_coupon_action_log c where DATE_FORMAT(createtime,'%Y-%m-%d')=xTime and c.channel_type=4 and tenant_id=#{tenantId}) as verifySendCount |
|
|
|
from wx_coupon_action_log where tenant_id=#{tenantId} |
|
|
|
<if test=" null != startTime "> |
|
|
|
and createtime >= #{startTime} |
|
|
|
</if> |
|
|
|
<if test=" null != endTime "> |
|
|
|
and createtime <= #{endTime} |
|
|
|
</if> |
|
|
|
group by xTime |
|
|
|
order by xTime desc |
|
|
|
from wx_coupon_action_log where tenant_id=#{tenantId} |
|
|
|
<if test=" null != startTime "> |
|
|
|
and createtime >= #{startTime} |
|
|
|
</if> |
|
|
|
<if test=" null != endTime "> |
|
|
|
and createtime <= #{endTime} |
|
|
|
</if> |
|
|
|
group by xTime |
|
|
|
order by xTime desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sceneDataJoinCouponOrderList" resultType="com.iformall.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> |
|
|
|
select DATE_FORMAT(create_date,'%Y-%m-%d') AS xTime,COUNT(wx_coupon_order.id) as tempCount from wx_coupon_action_log left join wx_coupon_order on wx_coupon_action_log.coupon_order_id=wx_coupon_order.id where wx_coupon_action_log.tenant_id=#{tenantId} |
|
|
|
AND wx_coupon_order.coupon_order_status = 1 and wx_coupon_action_log.createtime >= #{startTime} and wx_coupon_action_log.createtime <= #{endTime} |
|
|
|
AND wx_coupon_action_log.channel_type = #{channelType} group by xTime |
|
|
|
select DATE_FORMAT(create_date,'%Y-%m-%d') AS xTime,COUNT(wx_coupon_order.id) as tempCount from wx_coupon_action_log left join wx_coupon_order on wx_coupon_action_log.coupon_order_id=wx_coupon_order.id |
|
|
|
where wx_coupon_action_log.tenant_id=#{tenantId} |
|
|
|
and wx_coupon_order.coupon_order_status = 1 |
|
|
|
and wx_coupon_action_log.createtime >= #{startTime} |
|
|
|
and wx_coupon_action_log.createtime <= #{endTime} |
|
|
|
and wx_coupon_action_log.channel_type = #{channelType} group by xTime |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="getCountByChannelId" resultType="java.lang.Integer"> |
|
|
|
select COUNT(*) FROM wx_coupon_action_log |
|
|
|
where tenant_id = #{tenantId} |
|
|
|
and channel_type = #{channelType} |
|
|
|
and channel_id <= #{channelId} |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |