zdd 2 роки тому
батько
коміт
930d53ec77

+ 2 - 2
supply-chain-order-service/src/main/java/com/hywa/orderservice/service/impl/TransferOrderServiceImpl.java

@@ -57,9 +57,9 @@ public class TransferOrderServiceImpl implements TransferOrderService {
             criteria.andStatusEqualTo((short)7);
         }
         PageHelper.startPage(pageNum, pageSize, true);
-        String orderBy = "tOrder.create_time,tOrder.water_number asc"; //新订单:时间正序,新订单在下面,老订单在上面
+        String orderBy = "tOrder.create_time desc,tOrder.water_number asc"; //新订单:时间正序,新订单在下面,老订单在上面
         if(status == 2) {//完成订单:时间倒序,新订单在上面,老订单在下面
-            orderBy = "CONCAT(tOrder.create_time,tOrder.water_number) DESC";
+            orderBy = "CONCAT(tOrder.create_time,tOrder.water_number) desc";
         }
         PageHelper.orderBy(orderBy);
         List<TransferOrder> transferOrders = transferOrderMapper.selectByExampleTwo(transferOrderExample);

+ 5 - 5
supply-chain-order-service/src/main/resources/mappers/TransferOrderMapper.xml

@@ -613,7 +613,7 @@
   </select>
   <select id="selectViewsAndOrdersBetweenDays"
     resultType="com.hywa.orderclient.forms.ViewsAndOrdersRep">
-    select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT  DATE_FORMAT(DATE_SUB(str_to_date(#{endTime},"%Y-%m-%d"),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate
+    select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT  DATE_FORMAT(DATE_SUB(str_to_date(#{endTime},"%Y-%m-%d"),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate
     FROM (SELECT help_category_id id
     FROM mysql.help_category
     ORDER BY help_category_id LIMIT #{recentDays}) a) b left join
@@ -636,7 +636,7 @@
   <select id="selectViewsAndOrdersBetweenHours"
     resultType="com.hywa.orderclient.forms.ViewsAndOrdersRep">
     select a.id time,ifnull(b.cnt,0) orders,ifnull(c.cnt,0) views from(
-    SELECT (help_category_id-1) id
+    SELECT (CAST(help_category_id AS SIGNED) -1) id
     FROM mysql.help_category
     ORDER BY help_category_id
     LIMIT 24) a left join
@@ -656,7 +656,7 @@
   </select>
   <select id="selectViewsAndOrdersRecentDays"
     resultType="com.hywa.orderclient.forms.ViewsAndOrdersRep">
-     select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT  DATE_FORMAT(DATE_SUB(NOW(),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate
+     select b.tempDate time,ifnull(c.cnt,0) views,ifnull(d.cnt,0) orders from (SELECT  DATE_FORMAT(DATE_SUB(NOW(),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate
     FROM (SELECT help_category_id id
     FROM mysql.help_category
     ORDER BY help_category_id LIMIT #{recentDays}) a) b left join
@@ -770,7 +770,7 @@
 
   <select id="selectOrdersNumberRecentDays" resultType="com.hywa.orderclient.forms.OrderNumberStatisticForm">
   select b.tempDate time, ifnull(l.cnt,0) orders
-  from (SELECT  DATE_FORMAT(DATE_SUB(NOW(),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT #{recentDays}) a) b
+  from (SELECT  DATE_FORMAT(DATE_SUB(NOW(),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT #{recentDays}) a) b
   left join (select date_format(o.pay_time,'%Y-%m-%d') payTime,count(distinct o.id) cnt
     from t_bp_order_info o
     where o.status != '0' and o.status != '4' and o.status is not null
@@ -793,7 +793,7 @@
 
   <select id="selectOrdersNumberBetweenDays" resultType="com.hywa.orderclient.forms.OrderNumberStatisticForm">
     select b.tempDate time, ifnull(l.cnt,0) orders
-    from (SELECT  DATE_FORMAT(DATE_SUB(NOW(),INTERVAL a.id-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT 30) a) b
+    from (SELECT  DATE_FORMAT(DATE_SUB(NOW(),INTERVAL CAST(a.id AS SIGNED)-1 DAY),'%Y-%m-%d') tempDate FROM (SELECT help_category_id id FROM mysql.help_category ORDER BY help_category_id LIMIT 30) a) b
     left join (select date_format(o.pay_time,'%Y-%m-%d') payTime,count(distinct o.id) cnt
     from t_bp_order_info o
       where o.status != '0' and o.status != '4' and o.status is not null