Commit e9a9358f authored by Phạm Duy Phi's avatar Phạm Duy Phi

phipd commit

parent b918a41e
...@@ -139,11 +139,11 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -139,11 +139,11 @@ public class CustomerServiceImpl implements CustomerService {
sb.append(" join CUSTOMER b on a.CUSTOMER_ID = b.CUSTOMER_ID"); sb.append(" join CUSTOMER b on a.CUSTOMER_ID = b.CUSTOMER_ID");
sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY "); sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY ");
sb.append(" NULL) AS MOBILE"); sb.append(" NULL) AS MOBILE");
sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 5 GROUP BY "); sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 5 AND STATUS = 1 GROUP BY ");
sb.append(" CUSTOMER_ID) c on b.CUSTOMER_ID = c.CUSTOMER_ID"); sb.append(" CUSTOMER_ID) c on b.CUSTOMER_ID = c.CUSTOMER_ID");
sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY "); sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY ");
sb.append(" NULL) AS EMAIL"); sb.append(" NULL) AS EMAIL");
sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 2 GROUP BY "); sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 2 AND STATUS = 1 GROUP BY ");
sb.append(" CUSTOMER_ID) d on b.CUSTOMER_ID = d.CUSTOMER_ID "); sb.append(" CUSTOMER_ID) d on b.CUSTOMER_ID = d.CUSTOMER_ID ");
sb.append(" where 1 = 1"); sb.append(" where 1 = 1");
sb.append(" and a.COMPANY_SITE_ID = :p_company_site_id"); sb.append(" and a.COMPANY_SITE_ID = :p_company_site_id");
...@@ -258,9 +258,9 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -258,9 +258,9 @@ public class CustomerServiceImpl implements CustomerService {
sb.append(" from CUSTOMER_LIST_MAPPING a"); sb.append(" from CUSTOMER_LIST_MAPPING a");
sb.append(" join CUSTOMER b on a.CUSTOMER_ID = b.CUSTOMER_ID"); sb.append(" join CUSTOMER b on a.CUSTOMER_ID = b.CUSTOMER_ID");
sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY NULL) AS MOBILE"); sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY NULL) AS MOBILE");
sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 5 GROUP BY CUSTOMER_ID) c on b.CUSTOMER_ID = c.CUSTOMER_ID"); sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 5 AND STATUS = 1 GROUP BY CUSTOMER_ID) c on b.CUSTOMER_ID = c.CUSTOMER_ID");
sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY NULL) AS EMAIL"); sb.append(" left join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY NULL) AS EMAIL");
sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 2 GROUP BY CUSTOMER_ID) d on b.CUSTOMER_ID = d.CUSTOMER_ID"); sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 2 AND STATUS = 1 GROUP BY CUSTOMER_ID) d on b.CUSTOMER_ID = d.CUSTOMER_ID");
sb.append(" where 1 = 1"); sb.append(" where 1 = 1");
sb.append(" and a.COMPANY_SITE_ID = :p_company_site_id"); sb.append(" and a.COMPANY_SITE_ID = :p_company_site_id");
sb.append(" and a.CUSTOMER_LIST_ID = :p_customer_list_id"); sb.append(" and a.CUSTOMER_LIST_ID = :p_customer_list_id");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment