Browse Source

统计订单列表开发

anderx 3 years ago
parent
commit
58776a95ba

+ 78 - 4
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1622,7 +1622,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     case a.sales_type when 6 then 1 else 0 end gxfg,
     case a.sales_type when 7 then 1 else 0 end qtfg
     from t_order_new a left join department b on a.order_dep =b.id
-    where a.delete_sign in (0,2) and a.process_status  > 4
+    where a.delete_sign in (0,2) and a.process_status  > 0
     <if test=" startDate !=null and endDate != null">
       and a.create_time between #{startDate} and #{endDate}
     </if>
@@ -1634,10 +1634,10 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     </if>
     )x group by x.province)y left join district_glossory dg on y.province=dg.id
     <if test=" sort ==0">
-    order by y.total_amount
+    order by y.total_amount desc
     </if>
     <if test=" sort ==1">
-    order by y.counts
+    order by y.counts desc
     </if>
   </select>
 
@@ -1649,13 +1649,50 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
            a.sales_type salesType, a.channel_id channelId ,a.other
     from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
                         left join department dep on a.order_dep=dep.id
-    where a.delete_sign in(0,2) and a.process_status >4
+    where a.delete_sign in(0,2) and a.process_status >0
       <if test="province !=null ">
       and dep.province = #{province}
       </if>
     <if test="salesType !=null ">
       and a.sales_type = #{salesType}
     </if>
+    <if test="orderNo != null">
+      and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="name != null">
+      and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="contractNo != null">
+      and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="liquidationStatus != null">
+      and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
+    </if>
+    <if test="approval ==0">
+      and a.approval = 0
+    </if>
+    <if test="approval ==1">
+      and a.process_status = 7
+      and a.approval = 1
+    </if>
+    <if test="approval ==2">
+      and a.approval &gt; 1
+    </if>
+    <if test="amountStatus == 0">
+      and a.total_amount &lt; 10
+    </if>
+    <if test="amountStatus == 1">
+      and a.total_amount between 10 and 20
+    </if>
+    <if test="amountStatus == 2">
+      and a.total_amount between 20 and 30
+    </if>
+    <if test="amountStatus == 3">
+      and a.total_amount between 30 and 40
+    </if>
+    <if test="amountStatus == 4">
+      and a.total_amount  &gt; 40
+    </if>
     order by a.create_time desc
     <if test="page_sql!=null">
       ${page_sql}
@@ -1672,5 +1709,42 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="salesType !=null ">
       and a.sales_type = #{salesType}
     </if>
+    <if test="orderNo != null">
+      and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="name != null">
+      and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="contractNo != null">
+      and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
+    </if>
+    <if test="liquidationStatus != null">
+      and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
+    </if>
+    <if test="approval ==0">
+      and a.approval = 0
+    </if>
+    <if test="approval ==1">
+      and a.process_status = 7
+      and a.approval = 1
+    </if>
+    <if test="approval ==2">
+      and a.approval &gt; 1
+    </if>
+    <if test="amountStatus == 0">
+      and a.total_amount &lt; 10
+    </if>
+    <if test="amountStatus == 1">
+      and a.total_amount between 10 and 20
+    </if>
+    <if test="amountStatus == 2">
+      and a.total_amount between 20 and 30
+    </if>
+    <if test="amountStatus == 3">
+      and a.total_amount between 30 and 40
+    </if>
+    <if test="amountStatus == 4">
+      and a.total_amount  &gt; 40
+    </if>
   </select>
 </mapper>

+ 58 - 0
src/main/java/com/goafanti/order/bo/InputStatisticsOrderList.java

@@ -3,9 +3,67 @@ package com.goafanti.order.bo;
 public class InputStatisticsOrderList {
     private Integer province;
     private Integer salesType;
+    private String orderNo;
+    private String name;
+    private String contractNo;
+
+    private Integer liquidationStatus;
+    private Integer approval;
+    /**
+     * 0 10万元以下 1 10万~20万 2 20万~30万 3 30万~40万  4 40万以上
+     */
+    private Integer amountStatus;
     private Integer pageNo;
     private Integer pageSize;
 
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public Integer getLiquidationStatus() {
+        return liquidationStatus;
+    }
+
+    public void setLiquidationStatus(Integer liquidationStatus) {
+        this.liquidationStatus = liquidationStatus;
+    }
+
+    public Integer getApproval() {
+        return approval;
+    }
+
+    public void setApproval(Integer approval) {
+        this.approval = approval;
+    }
+
+    public Integer getAmountStatus() {
+        return amountStatus;
+    }
+
+    public void setAmountStatus(Integer amountStatus) {
+        this.amountStatus = amountStatus;
+    }
+
     public Integer getProvince() {
         return province;
     }

+ 7 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -598,6 +598,13 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		Map<String, Object> params = new HashMap<String, Object>();
 		if (in.getProvince()!=null)params.put("province",in.getProvince());
 		if (in.getSalesType()!=null)params.put("salesType",in.getSalesType());
+		if (in.getOrderNo()!=null)params.put("orderNo",in.getOrderNo());
+		if (in.getName()!=null)params.put("name",in.getName());
+		if (in.getContractNo()!=null)params.put("contractNo",in.getContractNo());
+		if (in.getLiquidationStatus()!=null)params.put("liquidationStatus",in.getLiquidationStatus());
+		if (in.getApproval()!=null)params.put("approval",in.getApproval());
+		if (in.getAmountStatus()!=null)params.put("amountStatus",in.getAmountStatus());
+
 		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectstatisticsOrderListPage",
 				"selectstatisticsOrderListCount", params, in.getPageNo(), in.getPageSize());
 		return p;

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -1,7 +1,7 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
 jdbc.password=123456
 #jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false