‘linchangsheng’ 8 months ago
parent
commit
a65422a4e0

+ 4 - 1
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/workorder/OrderBaseCMapper.java

@@ -20,7 +20,10 @@ public interface OrderBaseCMapper {
                                                      @Param("adminWebsitIds") List<String> adminWebsitIds,
                                                      @Param("adminUserType") Integer adminUserType,
                                                      @Param("orderSmallType") String orderSmallType,
-                                                     @Param("orderSmallTypeText") String orderSmallTypeText);
+                                                     @Param("orderSmallTypeText") String orderSmallTypeText,
+                                                     @Param("startTime") String startTime,
+                                                     @Param("endTime") String endTime
+    );
 
     /**
      * 工单首页的统计

+ 3 - 1
mall-server-api/src/main/java/com/gree/mall/manager/controller/workerorder/OrderBaseController.java

@@ -95,10 +95,12 @@ public class OrderBaseController {
     @PostMapping("/status/count")
     @ApiOperation(value = "按工单状态统计")
     public ResponseHelper<List<Map<String,Object>>> countStatus(
+            @RequestParam(required = false) String startTime,
+            @RequestParam(required = false) String endTime,
             @RequestParam(required = false) String orderSmallType,
             @RequestParam(required = false) String orderSmallTypeText
     ) {
-        List<Map<String, Object>> maps = orderBaseLogic.countStatus(orderSmallType,orderSmallTypeText);
+        List<Map<String, Object>> maps = orderBaseLogic.countStatus(startTime,endTime,orderSmallType,orderSmallTypeText);
         return ResponseHelper.success(maps);
     }
 

+ 3 - 2
mall-server-api/src/main/java/com/gree/mall/manager/logic/workorder/OrderBaseLogic.java

@@ -180,9 +180,10 @@ public class OrderBaseLogic {
      *
      * @return
      */
-    public List<Map<String, Object>> countStatus(String orderSmallType, String orderSmallTypeText) {
+    public List<Map<String, Object>> countStatus(String startTime,String endTime,String orderSmallType, String orderSmallTypeText) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
-        List<Map<String, Object>> maps = orderBaseCMapper.countOrderStatus(adminUser.getCompanyWechatId(), adminUser.getAdminWebsitIds(), adminUser.getType(), orderSmallType, orderSmallTypeText);
+        List<Map<String, Object>> maps = orderBaseCMapper.countOrderStatus(adminUser.getCompanyWechatId(), adminUser.getAdminWebsitIds(),
+                adminUser.getType(), orderSmallType, orderSmallTypeText,startTime,endTime);
         return maps;
     }
 

+ 19 - 0
mall-server-api/src/main/resources/mapper/workorder/OrderBaseCMapper.xml

@@ -16,6 +16,10 @@
         <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
             and a.order_small_type_text = #{orderSmallTypeText}
         </if>
+
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
         group by order_status_text
     union
         select
@@ -31,6 +35,9 @@
         <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
             and a.order_small_type_text = #{orderSmallTypeText}
         </if>
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
     union
         select
             count(distinct a.id)  'total',
@@ -45,6 +52,9 @@
         <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
             and a.order_small_type_text = #{orderSmallTypeText}
         </if>
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
     union
         select
         count(distinct a.id)  'total',
@@ -59,6 +69,9 @@
         <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
             and a.order_small_type_text = #{orderSmallTypeText}
         </if>
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
     union
         select
         count(distinct a.id)  'total',
@@ -73,6 +86,9 @@
         <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
             and a.order_small_type_text = #{orderSmallTypeText}
         </if>
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
     union
         select
         count(distinct a.id)  'total',
@@ -87,6 +103,9 @@
         <if test="orderSmallTypeText != null and orderSmallTypeText != ''">
             and a.order_small_type_text = #{orderSmallTypeText}
         </if>
+        <if test="startTime != null and startTime != ''">
+            and a.create_time between #{startTime} and #{endTime}
+        </if>
     </select>
 
     <select id="countOrderBaseIndex" resultType="com.gree.mall.manager.bean.workorder.OrderBaseCountBean">