Browse Source

2024年7月8日17:11:24 陆运大屏接口

纪新园 1 year ago
parent
commit
ef39053f22

+ 15 - 1
blade-service/blade-land/src/main/java/org/springblade/land/mapper/OrderMapper.xml

@@ -260,12 +260,26 @@
           AND t1.is_deleted = 0
           AND t2.is_deleted = 0
           AND t2.kind = '2'
+        <if test="type != null and type != '' and type != '散货'">
+            AND YEAR ( t2.arrival_time ) = YEAR ( CURRENT_DATE )
+            AND MONTH ( t2.arrival_time ) = MONTH ( CURRENT_DATE )
+        </if>
+        <if test="type != null and type != '' and type == '散货'">
+            AND YEAR ( t1.arrival_time ) = YEAR ( CURRENT_DATE )
+            AND MONTH ( t1.arrival_time ) = MONTH ( CURRENT_DATE )
+        </if>
         GROUP BY
             t1.id,
             t2.id,
             t2.plate_no,
             t2.arrival_time
-        ORDER BY
+        <if test="type != null and type != '' and type != '散货'">
+            ORDER BY
+            t2.arrival_time DESC
+        </if>
+        <if test="type != null and type != '' and type == '散货'">
+            ORDER BY
             t1.arrival_time DESC
+        </if>
     </select>
 </mapper>