he2802 1 gadu atpakaļ
vecāks
revīzija
7ea22a9212

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/bo/TopOrderStatisticsBo.java

@@ -46,4 +46,7 @@ public class TopOrderStatisticsBo implements Serializable {
     private Integer type;
 
     private Integer sort;
+
+    @ApiModelProperty("业务员ID")
+    private String createSysUserId;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/bo/TopOrderStatisticsViewBo.java

@@ -38,5 +38,7 @@ public class TopOrderStatisticsViewBo implements Serializable {
     @ApiModelProperty("业务号")
     private String createNo;
 
+    @ApiModelProperty("业务员ID")
+    private String createSysUserId;
 
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/vo/TopOrderStatisticsDetailVo.java

@@ -61,4 +61,6 @@ public class TopOrderStatisticsDetailVo implements Serializable {
     @ApiModelProperty("业务层次")
     private String businessName;
 
+    @ApiModelProperty("业务员ID")
+    private String createSysUserId;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/vo/TopOrderStatisticsTwoVo.java

@@ -45,5 +45,8 @@ public class TopOrderStatisticsTwoVo implements Serializable {
     @ApiModelProperty("企业ID")
     private String tenantId;
 
+    @ApiModelProperty("业务员ID")
+    private String createSysUserId;
+
 
 }

+ 51 - 38
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml

@@ -124,8 +124,8 @@
         <if test="purchaseOrg != null and purchaseOrg != ''">
             AND vto.purchase_org LIKE CONCAT( '%', #{purchaseOrg}, '%' )
         </if>
-        <if test="createNo != null and createNo != ''">
-            AND vto.create_no LIKE CONCAT( '%', #{createNo}, '%' )
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND vto.create_sys_user_id LIKE CONCAT( '%', #{createNo}, '%' )
         </if>
         <if test="startTime != null and startTime != ''">
             AND vto.buy_time <![CDATA[ >= ]]> #{startTime}
@@ -1078,7 +1078,7 @@
                     allu.tenant_id,
                     SUM( allu.money2 ) money
                     <if test="tenantId != null and tenantId != ''">
-                        , allu.create_no,allu.create_username
+                        , allu.create_sys_user_id,allu.create_username
                     </if>
                 FROM
                     (
@@ -1086,7 +1086,7 @@
                             tenant_id,
                             SUM( order_received - order_refunded ) money2
                             <if test="tenantId != null and tenantId != ''">
-                                , create_no,any_value(create_username) as create_username
+                                , create_sys_user_id,any_value(create_username) as create_username
                             </if>
                         FROM
                             top_old_order
@@ -1110,14 +1110,14 @@
                         GROUP BY
                             tenant_id
                         <if test="tenantId != null and tenantId != ''">
-                            , create_no
+                            , create_sys_user_id
                         </if>
                         UNION ALL
                         SELECT
                             og.tenant_id,
                             IFNULL( SUM( og.goods_received ), 0 ) money2
                             <if test="tenantId != null and tenantId != ''">
-                                ,'' AS create_no, '' as create_username
+                                ,'' AS create_sys_user_id, '' as create_username
                             </if>
                         FROM
                             `order` o
@@ -1148,7 +1148,7 @@
                 GROUP BY
                     allu.tenant_id
                 <if test="tenantId != null and tenantId != ''">
-                    , allu.create_no,allu.create_username
+                    , allu.create_sys_user_id,allu.create_username
                 </if>
                 ORDER BY
                     money DESC
@@ -1188,7 +1188,7 @@
         <if test="customerId != null and customerId != ''">
             AND o.tenant_id  = #{customerId}
         </if>
-        <if test="createNo != null and createNo != ''">
+        <if test="createSysUserId != null and createSysUserId != ''">
             AND 1=0
         </if>
         )) money
@@ -1204,8 +1204,8 @@
         <if test="tenantId != null and tenantId != ''">
             AND vo.tenant_id = #{tenantId}
         </if>
-        <if test="createNo != null and createNo != ''">
-            AND vo.create_no = #{createNo}
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND vo.create_sys_user_id = #{createSysUserId}
         </if>
         <if test="customerId != null and customerId != ''">
             AND vo.tenant_id  = #{customerId}
@@ -1223,7 +1223,7 @@
         allu.tenant_id,
         SUM(order_num2) order_num
         <if test="tenantId != null and tenantId != ''">
-            , allu.create_no,allu.create_username
+            , allu.create_sys_user_id,allu.create_username
         </if>
         FROM
         (
@@ -1231,7 +1231,7 @@
         tenant_id,
         COUNT( * ) order_num2
         <if test="tenantId != null and tenantId != ''">
-            , create_no,any_value(create_username) as create_username
+            , create_sys_user_id,any_value(create_username) as create_username
         </if>
         FROM
         top_old_order
@@ -1255,14 +1255,14 @@
         GROUP BY
         tenant_id
         <if test="tenantId != null and tenantId != ''">
-            , create_no
+            , create_sys_user_id
         </if>
         UNION ALL
         SELECT
         og.tenant_id,
         COUNT( * ) order_num2
         <if test="tenantId != null and tenantId != ''">
-            ,'' AS create_no, '' as create_username
+            ,'' AS create_sys_user_id, '' as create_username
         </if>
         FROM
         `order` o
@@ -1293,7 +1293,7 @@
         GROUP BY
         allu.tenant_id
         <if test="tenantId != null and tenantId != ''">
-            , allu.create_no,allu.create_username
+            , allu.create_sys_user_id,allu.create_username
         </if>
         ORDER BY
         order_num DESC
@@ -1327,7 +1327,7 @@
         <if test="customerId != null and customerId != ''">
             AND o.tenant_id  = #{customerId}
         </if>
-        <if test="createNo != null and createNo != ''">
+        <if test="createSysUserId != null and createSysUserId != ''">
             AND 1=0
         </if>
         ))
@@ -1350,8 +1350,8 @@
         <if test="customerId != null and customerId != ''">
             AND tenant_id  = #{customerId}
         </if>
-        <if test="createNo != null and createNo != ''">
-            AND create_no = #{createNo}
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND create_sys_user_id = #{createSysUserId}
         </if>
     </select>
 
@@ -1496,8 +1496,8 @@
                 <if test="tenantId != null and tenantId != ''">
                     AND oo.tenant_id = #{tenantId}
                 </if>
-                <if test="createNo != null and createNo != ''">
-                    AND oo.create_no = #{createNo}
+                <if test="createSysUserId != null and createSysUserId != ''">
+                    AND oo.create_sys_user_id = #{createSysUserId}
                 </if>
                 <if test="businessName != null and businessName != ''">
                     AND ouu.business_name = #{businessName}
@@ -1546,7 +1546,7 @@
                             <if test="tenantId != null and tenantId != ''">
                                 AND og.tenant_id = #{tenantId}
                             </if>
-                            <if test="createNo != null and createNo != ''">
+                            <if test="createSysUserId != null and createSysUserId != ''">
                                 AND 1=0
                             </if>
                             <if test="customerId != null and customerId != ''">
@@ -1600,8 +1600,8 @@
             <if test="tenantId != null and tenantId != ''">
                 AND oo.tenant_id = #{tenantId}
             </if>
-            <if test="createNo != null and createNo != ''">
-                AND oo.create_no = #{createNo}
+            <if test="createSysUserId != null and createSysUserId != ''">
+                AND oo.create_sys_user_id = #{createSysUserId}
             </if>
             <if test="customerId != null and customerId != ''">
                 AND oo.tenant_id  = #{customerId}
@@ -1651,7 +1651,7 @@
         <if test="customerId != null and customerId != ''">
             AND og.tenant_id  = #{customerId}
         </if>
-        <if test="createNo != null and createNo != ''">
+        <if test="createSysUserId != null and createSysUserId != ''">
             AND 1=0
         </if>
                 ) nou
@@ -1694,6 +1694,9 @@
                 <if test="customerId != null and customerId != ''">
                     AND oo.tenant_id  = #{customerId}
                 </if>
+                <if test="createSysUserId != null and createSysUserId != ''">
+                    AND oo.create_sys_user_id = #{createSysUserId}
+                </if>
             )
                 order_num
         FROM
@@ -1716,7 +1719,7 @@
         <if test="tenantId != null and tenantId != ''">
             AND og.tenant_id = #{tenantId}
         </if>
-        <if test="createNo != null and createNo != ''">
+        <if test="createSysUserId != null and createSysUserId != ''">
             AND 1=0
         </if>
         <if test="customerId != null and customerId != ''">
@@ -1833,7 +1836,7 @@
         SUM( allu.money2 ) money,
         SUM(order_num2) order_num
         <if test="tenantId != null and tenantId != ''">
-            , allu.create_no,allu.create_username
+            , allu.create_sys_user_id,allu.create_username
         </if>
         FROM
         (
@@ -1843,7 +1846,7 @@
         SUM( order_received - order_refunded ) money2,
         COUNT( * ) order_num2
         <if test="tenantId != null and tenantId != ''">
-            , create_no,any_value(create_username) as create_username
+            , create_sys_user_id,any_value(create_username) as create_username
         </if>
         FROM
         top_old_order
@@ -1868,7 +1871,7 @@
         GROUP BY
         tenant_id
         <if test="tenantId != null and tenantId != ''">
-            , create_no
+            , create_sys_user_id
         </if>
         UNION ALL
         SELECT
@@ -1877,7 +1880,7 @@
         IFNULL( SUM( og.goods_received ), 0 ) money2,
         COUNT( * ) order_num2
         <if test="tenantId != null and tenantId != ''">
-            ,'' AS create_no, '' as create_username
+            ,'' AS create_sys_user_id, '' as create_username
         </if>
         FROM
         `order` o
@@ -1909,7 +1912,7 @@
         GROUP BY
         allu.tenant_id
         <if test="tenantId != null and tenantId != ''">
-            , allu.create_no,allu.create_username
+            , allu.create_sys_user_id,allu.create_username
         </if>
         ORDER BY
         tenant_id DESC
@@ -1964,12 +1967,16 @@
         <if test="createNo != null and createNo != ''">
             AND oo.create_no = #{createNo}
         </if>
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND oo.create_sys_user_id = #{createSysUserId}
+        </if>
         <if test="businessName != null and businessName != ''">
             AND ouu.business_name = #{businessName}
         </if>
         <if test="customerId != null and customerId != ''">
             AND oo.tenant_id  = #{customerId}
         </if>
+
         GROUP BY
         ouu.business_name UNION ALL
         SELECT
@@ -2016,6 +2023,9 @@
         <if test="createNo != null and createNo != ''">
             AND 1=0
         </if>
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND 1=0
+        </if>
         <if test="customerId != null and customerId != ''">
             AND og.tenant_id  = #{customerId}
         </if>
@@ -2075,6 +2085,9 @@
         <if test="createNo != null and createNo != ''">
             AND too.create_no = #{createNo}
         </if>
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND too.create_sys_user_id = #{createSysUserId}
+        </if>
         UNION ALL
         SELECT
         o.order_id as order_id,
@@ -2101,7 +2114,7 @@
         <if test="tenantId != null and tenantId != ''">
             AND o.tenant_id = #{tenantId}
         </if>
-        <if test="createNo != null and createNo != ''">
+        <if test="createSysUserId != null and createSysUserId != ''">
             AND 1=0
         </if>
         ) a WHERE 1=1
@@ -2168,8 +2181,8 @@
         <if test="tenantId != null and tenantId != ''">
             AND too.tenant_id = #{tenantId}
         </if>
-        <if test="createNo != null and createNo != ''">
-            AND too.create_no = #{createNo}
+        <if test="createSysUserId != null and createSysUserId != ''">
+            AND too.create_sys_user_id = #{createSysUserId}
         </if>
         UNION ALL
         SELECT
@@ -2211,7 +2224,7 @@
         <if test="tenantId != null and tenantId != ''">
             AND og.tenant_id = #{tenantId}
         </if>
-        <if test="createNo != null and createNo != ''">
+        <if test="createSysUserId != null and createSysUserId != ''">
             AND 1=0
         </if>
         <if test="customerId != null and customerId != ''">
@@ -2236,8 +2249,8 @@
     <select id="getTenantCreateList" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderStatisticsViewBo"
             resultType="com.zhongzheng.modules.top.order.vo.TopOrderStatisticsTwoVo">
         SELECT
-            create_no,
-            create_username
+            create_username,
+            create_sys_user_id
         FROM
             top_old_order
         WHERE
@@ -2245,9 +2258,9 @@
         <if test="tenantId != null and tenantId != ''">
             AND tenant_id = #{tenantId}
         </if>
-          AND create_no IS NOT NULL
+          AND create_sys_user_id IS NOT NULL
         GROUP BY
-            create_no,
+            create_sys_user_id,
             create_username
     </select>
 </mapper>