Ver código fonte

应付总账调整统计维度

liyuan 1 semana atrás
pai
commit
48800d9b8f

+ 16 - 10
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml

@@ -435,15 +435,18 @@
         </if>
         </if>
         <if test="order.type != null and order.type  == 0">
         <if test="order.type != null and order.type  == 0">
             and o.bs_type = 'XS'
             and o.bs_type = 'XS'
+            GROUP BY
+            o.saler_id,
+            o.customer_id,
+            DATE_FORMAT(o.busines_date,'%Y-%m')
         </if>
         </if>
         <if test="order.type != null and order.type  == 1">
         <if test="order.type != null and order.type  == 1">
             and o.bs_type = 'CG'
             and o.bs_type = 'CG'
+            GROUP BY
+            o.customer_id,
+            DATE_FORMAT(o.busines_date,'%Y-%m')
         </if>
         </if>
-        GROUP BY
-        o.saler_id,o.customer_id,
-            DATE_FORMAT(
-                o.busines_date,
-                '%Y-%m')
+
         ORDER BY o.saler_name,o.customer_name,
         ORDER BY o.saler_name,o.customer_name,
         DATE_FORMAT(
         DATE_FORMAT(
         o.busines_date,
         o.busines_date,
@@ -498,15 +501,18 @@
         </if>
         </if>
         <if test="order.type != null and order.type  == 0">
         <if test="order.type != null and order.type  == 0">
             and o.bs_type = 'XS'
             and o.bs_type = 'XS'
+            GROUP BY
+            o.saler_id,
+            o.customer_id,
+            DATE_FORMAT(o.busines_date,'%Y-%m')
         </if>
         </if>
         <if test="order.type != null and order.type  == 1">
         <if test="order.type != null and order.type  == 1">
             and o.bs_type = 'CG'
             and o.bs_type = 'CG'
+            GROUP BY
+            o.customer_id,
+            DATE_FORMAT(o.busines_date,'%Y-%m')
         </if>
         </if>
-        GROUP BY
-        o.saler_id,o.customer_id,
-        DATE_FORMAT(
-        o.busines_date,
-        '%Y-%m')
+
         ORDER BY o.saler_name,o.customer_name,
         ORDER BY o.saler_name,o.customer_name,
         DATE_FORMAT(
         DATE_FORMAT(
         o.busines_date,
         o.busines_date,