Commit b3ffd0ad authored by đinh thị đầm's avatar đinh thị đầm

searchIndividualCustomer

parent c15a89e0
......@@ -1916,16 +1916,24 @@ public class CustomerServiceImpl implements CustomerService {
sb.append("select c.customer_id customerId,");
sb.append(" C.NAME name,");
sb.append(" cc.contact mobileNumber,");
sb.append(" cc2.contact email,");
sb.append(" a.mobile mobileNumber,");
sb.append(" b.Email email,");
sb.append(" c.customer_type customerType,");
sb.append(" C.COMPANY_NAME companyName,");
sb.append(" c.current_address currentAddress,");
sb.append(" c.Description description");
sb.append(" FROM CUSTOMER C");
sb.append(" INNER JOIN CUSTOMER_contact cc ON (C.CUSTOMER_ID = Cc.customer_id " +
"and cc.status = 1 and cc.contact_type = 5)");
sb.append(" INNER JOIN CUSTOMER_contact Cc2 ON (C.CUSTOMER_ID = Cc2.customer_id and cc2.status = 1 and cc2.contact_type = 2)");
sb.append(" inner join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY ");
sb.append(" NULL) AS MOBILE");
sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 5 AND STATUS = 1 GROUP BY ");
sb.append(" CUSTOMER_ID) a on c.CUSTOMER_ID = a.CUSTOMER_ID");
sb.append(" inner join (SELECT CUSTOMER_ID, LISTAGG(CONTACT, ', ') WITHIN GROUP (ORDER BY ");
sb.append(" NULL) AS EMAIL");
sb.append(" FROM CUSTOMER_CONTACT WHERE CONTACT_TYPE = 2 AND STATUS = 1 GROUP BY ");
sb.append(" CUSTOMER_ID) b on b.CUSTOMER_ID = c.CUSTOMER_ID ");
// sb.append(" INNER JOIN CUSTOMER_contact cc ON (C.CUSTOMER_ID = Cc.customer_id " +
// "and cc.status = 1 and cc.contact_type = 5)");
// sb.append(" INNER JOIN CUSTOMER_contact Cc2 ON (C.CUSTOMER_ID = Cc2.customer_id and cc2.status = 1 and cc2.contact_type = 2)");
sb.append("inner join customize_field_object cfo on c.customer_id = cfo.object_id and cfo.status = 1");
sb.append(" AND C.STATUS = 1");
sb.append(" AND C.customer_id not in (select customer_id from campaign_customer where campaign_id = :p_campaign_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