Commit 3b3b1c1d authored by Phạm Duy Phi's avatar Phạm Duy Phi

phipd commit

parent 3031556e
This diff is collapsed.
This diff is collapsed.
...@@ -515,23 +515,27 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -515,23 +515,27 @@ public class CustomerServiceImpl implements CustomerService {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("SELECT"); sb.append("SELECT");
sb.append(" CUSTOMER_LIST_ID customerListId,"); sb.append(" a.CUSTOMER_LIST_ID customerListId,");
sb.append(" COMPANY_SITE_ID companySiteId,"); sb.append(" a.COMPANY_SITE_ID companySiteId,");
sb.append(" CUSTOMER_LIST_CODE customerListCode,"); sb.append(" a.CUSTOMER_LIST_CODE customerListCode,");
sb.append(" CUSTOMER_LIST_NAME customerListName,"); sb.append(" a.CUSTOMER_LIST_NAME customerListName,");
sb.append(" STATUS status,"); sb.append(" a.STATUS status,");
sb.append(" CREATE_BY createBy,"); sb.append(" a.CREATE_BY createBy,");
sb.append(" CREATE_AT createAt,"); sb.append(" a.CREATE_AT createAt,");
sb.append(" UPDATE_BY updateBy,"); sb.append(" a.UPDATE_BY updateBy,");
sb.append(" UPDATE_AT updateAt,"); sb.append(" a.UPDATE_AT updateAt,");
sb.append(" SOURCE source,"); sb.append(" a.SOURCE source,");
sb.append(" DEPT_CREATE deptCreate"); sb.append(" a.DEPT_CREATE deptCreate,");
sb.append(" FROM CUSTOMER_LIST"); sb.append(" b.count count");
sb.append(" FROM CUSTOMER_LIST a");
sb.append(" LEFT JOIN (SELECT COUNT(CAMPAIGN_ID) as count, CUSTOMER_LIST_ID");
sb.append(" FROM CAMPAIGN_CUSTOMERLIST");
sb.append(" GROUP BY CUSTOMER_LIST_ID) b");
sb.append(" ON a.CUSTOMER_LIST_ID = b.CUSTOMER_LIST_ID");
sb.append(" WHERE 1 = 1"); sb.append(" WHERE 1 = 1");
sb.append(" AND STATUS = 1"); sb.append(" AND a.STATUS = 1");
sb.append(" AND COMPANY_SITE_ID = :p_company_site_id"); sb.append(" AND a.COMPANY_SITE_ID = :p_company_site_id");
sb.append(" ORDER BY a.CREATE_AT DESC");
sb.append(" ORDER BY CREATE_AT DESC");
SQLQuery query = session.createSQLQuery(sb.toString()); SQLQuery query = session.createSQLQuery(sb.toString());
...@@ -548,6 +552,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -548,6 +552,7 @@ public class CustomerServiceImpl implements CustomerService {
query.addScalar("updateAt", new DateType()); query.addScalar("updateAt", new DateType());
query.addScalar("source", new StringType()); query.addScalar("source", new StringType());
query.addScalar("deptCreate", new StringType()); query.addScalar("deptCreate", new StringType());
query.addScalar("count", new StringType());
query.setResultTransformer(Transformers.aliasToBean(CustomerListDTO.class)); query.setResultTransformer(Transformers.aliasToBean(CustomerListDTO.class));
int count = 0; int count = 0;
......
...@@ -21,6 +21,7 @@ public class CustomerListDTO extends BaseDTO { ...@@ -21,6 +21,7 @@ public class CustomerListDTO extends BaseDTO {
private Date updateAt; private Date updateAt;
private String source; private String source;
private String deptCreate; private String deptCreate;
private String count;
private Long totalCusInList; private Long totalCusInList;
private Long totalCusInteract; private Long totalCusInteract;
private Long totalCusNotInteract; private Long totalCusNotInteract;
......
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