|
|
@@ -4,6 +4,41 @@
|
|
|
|
|
|
<select id="getWMoneyStatisticsDataView"
|
|
|
resultType="com.cyksj.model.views.YhShopBrokenLineCpsUserWMoneyView">
|
|
|
+ select min(curdate) as firstDate,
|
|
|
+ max(curdate) as lastDate from (select
|
|
|
+ <if test="today">
|
|
|
+ date_format(send_time, '%H') as `curdate`
|
|
|
+ </if>
|
|
|
+ <if test="!today">
|
|
|
+ date_format(send_time, '%Y-%m-%d') `curdate`
|
|
|
+ </if>
|
|
|
+ from `yh_shop_distribute_waiting_send_points`
|
|
|
+ where shop_user_id = #{yhShopUserId}
|
|
|
+ and send_status = 'waiting'
|
|
|
+ <choose>
|
|
|
+ <when test="today">
|
|
|
+ <if test="first != null">
|
|
|
+ and send_time >= #{first}
|
|
|
+ </if>
|
|
|
+ <if test="end != null">
|
|
|
+ and send_time <= #{end}
|
|
|
+ </if>
|
|
|
+ group by date_format(send_time, '%H')
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <if test="first != null">
|
|
|
+ and date_format(send_time, '%Y-%m-%d') >= #{first}
|
|
|
+ </if>
|
|
|
+ <if test="end != null">
|
|
|
+ and date_format(send_time, '%Y-%m-%d') < #{end}
|
|
|
+ </if>
|
|
|
+ group by date_format(send_time, '%Y-%m-%d')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ )s
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getWMoneyStatisticsDate" resultType="com.cyksj.model.views.YhShopUserWMoneyStatisticsDataView">
|
|
|
select
|
|
|
<if test="today">
|
|
|
date_format(send_time, '%H') as `hour`,
|
|
|
@@ -38,39 +73,4 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="getWMoneyStatisticsDate" resultType="com.cyksj.model.views.YhShopUserWMoneyStatisticsDataView">
|
|
|
- select min(curdate) as firstDate,
|
|
|
- max(curdate) as lastDate from (select
|
|
|
- <if test="today">
|
|
|
- date_format(send_time, '%H') as `curdate`
|
|
|
- </if>
|
|
|
- <if test="!today">
|
|
|
- date_format(send_time, '%Y-%m-%d') `curdate`
|
|
|
- </if>
|
|
|
- from `yh_shop_distribute_waiting_send_points`
|
|
|
- where shop_user_id = #{yhShopUserId}
|
|
|
- and send_status = 'waiting'
|
|
|
- <choose>
|
|
|
- <when test="today">
|
|
|
- <if test="first != null">
|
|
|
- and send_time >= #{first}
|
|
|
- </if>
|
|
|
- <if test="end != null">
|
|
|
- and send_time <= #{end}
|
|
|
- </if>
|
|
|
- group by date_format(send_time, '%H')
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- <if test="first != null">
|
|
|
- and date_format(send_time, '%Y-%m-%d') >= #{first}
|
|
|
- </if>
|
|
|
- <if test="end != null">
|
|
|
- and date_format(send_time, '%Y-%m-%d') < #{end}
|
|
|
- </if>
|
|
|
- group by date_format(send_time, '%Y-%m-%d')
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- )s
|
|
|
- </select>
|
|
|
</mapper>
|