Bladeren bron

优化下 报表查询 数量

Your Name 2 jaren geleden
bovenliggende
commit
d189a20cc0

+ 67 - 0
java110-bean/src/main/java/com/java110/dto/corder/CorderDto.java

@@ -19,10 +19,21 @@ public class CorderDto extends PageDto implements Serializable {
     private String finishTime;
     private String remark;
     private String statusCd;
+    private String staffNameLike;
+    private String startTime;
+    private String endTime;
     private List<CbusinessVo> cBusiness;
     private String orderTypeCdName;
     private String userName;
 
+    private String bId;
+
+    private String businessTypeCd;
+
+    private String action;
+
+    private String actionObj;
+
     public String getoId() {
         return oId;
     }
@@ -142,4 +153,60 @@ public class CorderDto extends PageDto implements Serializable {
     public void setName(String name) {
         this.name = name;
     }
+
+    public String getStaffNameLike() {
+        return staffNameLike;
+    }
+
+    public void setStaffNameLike(String staffNameLike) {
+        this.staffNameLike = staffNameLike;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getbId() {
+        return bId;
+    }
+
+    public void setbId(String bId) {
+        this.bId = bId;
+    }
+
+    public String getBusinessTypeCd() {
+        return businessTypeCd;
+    }
+
+    public void setBusinessTypeCd(String businessTypeCd) {
+        this.businessTypeCd = businessTypeCd;
+    }
+
+    public String getAction() {
+        return action;
+    }
+
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    public String getActionObj() {
+        return actionObj;
+    }
+
+    public void setActionObj(String actionObj) {
+        this.actionObj = actionObj;
+    }
 }

+ 46 - 1
java110-db/src/main/resources/mapper/order/CorderServiceDaoImplMapper.xml

@@ -29,16 +29,30 @@
 
 
     <select id="getCorderInfo" parameterType="Map" resultType="Map">
-        select ca.`name` appName,t.create_time createTime,cbt.`name`,t.user_id,u.name userName,t.ext_transaction_id extTransactionId,t.status_cd statusCd,t.o_id oId
+        select ca.`name` appName,
+        t.create_time createTime,
+        cbt.`name`,
+        t.user_id,u.name userName,
+        t.ext_transaction_id extTransactionId,
+        t.status_cd statusCd,
+        t.o_id oId,
+        cb.business_type_cd businessTypeCd,
+        cb.b_id bId,
+        coi.action,
+        coi.action_obj actionObj
         from c_orders t
         left join c_business cb on t.o_id = cb.o_id
         left join c_business_type cbt on cb.business_type_cd = cbt.business_type_cd
+        left join c_order_item coi on cb.b_id = coi.b_id
         left join u_user u on t.user_id = u.user_id
         left join c_app ca on t.app_id = ca.app_id
         where 1 =1
         <if test="oId !=null and oId != ''">
             and t.o_id= #{oId}
         </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
         <if test="extTransactionId !=null and extTransactionId != ''">
             and t.ext_transaction_id= #{extTransactionId}
         </if>
@@ -48,6 +62,15 @@
         <if test="appId !=null and appId != ''">
             and t.app_id= #{appId}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.createTime &gt;= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.createTime &lt;= #{endTime}
+        </if>
+        <if test="staffNameLike !=null and staffNameLike != ''">
+            and u.name like concat('%',#{staffNameLike},'%')
+        </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -58,13 +81,35 @@
     <select id="queryCordersCount" parameterType="Map" resultType="Map">
         select count(1) count
         from c_orders t
+        left join c_business cb on t.o_id = cb.o_id
+        left join c_business_type cbt on cb.business_type_cd = cbt.business_type_cd
+        left join u_user u on t.user_id = u.user_id
+        left join c_app ca on t.app_id = ca.app_id
         where 1 =1
         <if test="oId !=null and oId != ''">
             and t.o_id= #{oId}
         </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="extTransactionId !=null and extTransactionId != ''">
+            and t.ext_transaction_id= #{extTransactionId}
+        </if>
+        <if test="orderTypeCd !=null and orderTypeCd != ''">
+            and t.order_type_cd= #{orderTypeCd}
+        </if>
         <if test="appId !=null and appId != ''">
             and t.app_id= #{appId}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.createTime &gt;= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.createTime &lt;= #{endTime}
+        </if>
+        <if test="staffNameLike !=null and staffNameLike != ''">
+            and u.name like concat('%',#{staffNameLike},'%')
+        </if>
 
     </select>
 

+ 3 - 1
service-common/src/main/java/com/java110/common/cmd/corders/ListCordersCmd.java

@@ -16,7 +16,9 @@ import org.springframework.http.ResponseEntity;
 import java.util.ArrayList;
 import java.util.List;
 
-
+/**
+ * 受理订单查询
+ */
 @Java110Cmd(serviceCode = "corders.listCorders")
 public class ListCordersCmd extends Cmd {