Commit 2785f1b2 authored by ='s avatar =

hungtt-commit

parent 5abbb94f
...@@ -1585,6 +1585,13 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1585,6 +1585,13 @@ public class CustomerServiceImpl implements CustomerService {
sb.append(" from customer_contact cc"); sb.append(" from customer_contact cc");
sb.append(" where cc.contact_type = 2"); sb.append(" where cc.contact_type = 2");
sb.append(" and status = 1"); sb.append(" and status = 1");
sb.append(" )," +
"cusInCampaign as (" +
"select * from campaign_customer " +
"where campaign_id = :p_campaign_id " +
"and company_site_id = :p_company_site_id " +
"and customer_list_id is null " +
"and in_campaign_status = 1");
sb.append(" ), datas as ("); sb.append(" ), datas as (");
sb.append(" select c.customer_id customerId,"); sb.append(" select c.customer_id customerId,");
sb.append(" c.name,"); sb.append(" c.name,");
...@@ -1595,6 +1602,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1595,6 +1602,7 @@ public class CustomerServiceImpl implements CustomerService {
sb.append(" c.current_address currentAddress,"); sb.append(" c.current_address currentAddress,");
sb.append(" c.description"); sb.append(" c.description");
sb.append(" from customer c"); sb.append(" from customer c");
sb.append(" inner join cusInCampaign cc on c.customer_id = cc.customer_id");
sb.append(" left join cusPhone cP on c.customer_id = cP.cusId"); sb.append(" left join cusPhone cP on c.customer_id = cP.cusId");
sb.append(" left join cusEmail cE on c.customer_id = cE.cusId"); sb.append(" left join cusEmail cE on c.customer_id = cE.cusId");
sb.append(" )"); sb.append(" )");
...@@ -1613,8 +1621,11 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1613,8 +1621,11 @@ public class CustomerServiceImpl implements CustomerService {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("p_page_number", campaignCustomerDTO.getPage()); param.put("p_page_number", campaignCustomerDTO.getPage());
param.put("p_page_size", campaignCustomerDTO.getPageSize()); param.put("p_page_size", campaignCustomerDTO.getPageSize());
param.put("p_campaign_id", campaignCustomerDTO.getCampaignId());
param.put("p_company_site_id", campaignCustomerDTO.getCompanySiteId());
customerList = namedParameterJdbcTemplate.query(sb.toString(), param, new BeanPropertyRowMapper<>(CustomerDTO.class)); customerList = namedParameterJdbcTemplate.query(sb.toString(), param, new BeanPropertyRowMapper<>(CustomerDTO.class));
} catch (Exception e) { } catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return null; return null;
} }
return customerList; return customerList;
......
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