修改统计sql

master
wjt 10 months ago
parent c097f6e9c6
commit 8b32fa64c0

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

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

Loading…
Cancel
Save