zoujiajian 2 jaren geleden
bovenliggende
commit
4babe7b1eb
1 gewijzigde bestanden met toevoegingen van 35 en 35 verwijderingen
  1. 35 35
      netflix-dao/src/main/resources/mapper/YhShopWaitingSendPointsMapper.xml

+ 35 - 35
netflix-dao/src/main/resources/mapper/YhShopWaitingSendPointsMapper.xml

@@ -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 &lt;= #{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') &lt; #{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 &lt;= #{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') &lt; #{end}
-                </if>
-                group by date_format(send_time, '%Y-%m-%d')
-            </otherwise>
-        </choose>
-        )s
-    </select>
 </mapper>