qin 1 рік тому
батько
коміт
184dd14b48
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      src/main/resources/mapper/statistics/OrderMapper.xml

+ 3 - 3
src/main/resources/mapper/statistics/OrderMapper.xml

@@ -135,10 +135,10 @@
             IFNULL(c.now_country_id,-1) AS countryId,
             IFNULL(c.now_street_id,-1) AS streetId,
             count(DISTINCT c.customer_id) as customerNum,
-            CONCAT(',',c.customer_type_id,',') as customerTypeId
+            CONCAT_WS(',',csp.customer_type_id) as customerTypeId
         FROM
             ${dbName}_customer.c_customer_subsidy_${operatorId} c
-            join (select subsidy_customer_id from  ${dbName}_customer.c_customer_subsidy_supplier_${operatorId} where yn =0 and enabled = 1 group by subsidy_customer_id) csp
+            join (select subsidy_customer_id,customer_type_id from  ${dbName}_customer.c_customer_subsidy_supplier_${operatorId} where yn =0 and enabled = 1 group by subsidy_customer_id) csp
                 on c.subsidy_customer_id = csp.subsidy_customer_id
                LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
         WHERE
@@ -146,7 +146,7 @@
           AND o.order_type = 2
           and c.yn =0
           and o.yn = 0
-        GROUP BY c.now_street_id,c.customer_type_id;
+        GROUP BY c.now_street_id,CONCAT_WS(',',csp.customer_type_id);
     </select>
 
     <select id="getSubsidyCustomerMealList" resultType="com.poteviohealth.cgp.statistics.model.outdto.Customer">