修改统计sql

master
wjt 10 months ago
parent c097f6e9c6
commit 8b32fa64c0

@ -54,7 +54,9 @@
where DATE_FORMAT(create_time, '%Y-%m-%d') >= #{qo.createStartTime}
and DATE_FORMAT(create_time, '%Y-%m-%d') <= #{qo.createEndTime}
and company_id = #{qo.companyId}
and channel_type = #{qo.channelType}
<if test="qo.channelType!=null">
and channel_type = #{qo.channelType}
</if>
<if test="qo.assignedIdList != null and qo.assignedIdList.size > 0">
and assigned_by in
<foreach collection="qo.assignedIdList" open="(" separator="," close=")" item="item">
@ -82,7 +84,9 @@
from tb_clue
where DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= #{qo.createStartTime}
and DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{qo.createEndTime}
and channel_type =#{qo.channelType}
<if test="qo.channelType!=null">
and channel_type = #{qo.channelType}
</if>
<if test="qo.distributorId!=null">
and create_by = #{qo.distributorId}
</if>

@ -47,7 +47,9 @@
where DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= #{qo.createStartTime}
and DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{qo.createEndTime}
and company_id = #{qo.companyId}
and channel_type = #{qo.channelType}
<if test="qo.channelType!=null">
and channel_type = #{qo.channelType}
</if>
<if test="qo.enterIdList != null and qo.enterIdList.size > 0">
and create_by in
<foreach collection="qo.enterIdList" open="(" separator="," close=")" item="item">
@ -67,9 +69,11 @@
select DATE_FORMAT(create_time, '%Y-%m-%d') as createTime, count(1) as num
from tb_custom
where DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= #{qo.createStartTime}
and DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{qo.createEndTime}
and distributor_id = #{qo.distributorId}
and channel_type = #{qo.channelType}
and DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{qo.createEndTime}
and distributor_id = #{qo.distributorId}
<if test="qo.channelType!=null">
and channel_type = #{qo.channelType}
</if>
GROUP BY createTime
</select>
</mapper>

Loading…
Cancel
Save