@Query("select c from CustomerListMapping c where c.customerId in (:p_ids) and c.customerListId =:p_customer_list_id and c.companySiteId=:p_company_site_id")
@Query("delete from CustomerListMapping c where c.customerId=:p_customer_id and c.customerListId=:p_customer_list_id and c.companySiteId=:p_company_site_id")
"select * from column_name_temp where columnName not in (select column_name from campaign_customerlist_column where column_name is not null)\n"+
"union all\n"+
"select title columnName, customize_field_id customizeFieldId, 0 isFix from customize_fields, dual\n"+
"where function_code = 'CUSTOMER'\n"+
" and site_id = :p_company_site_id\n"+
" and customize_field_id not in (select customize_field_id from campaign_customerlist_column where campaign_customerlist_column.campaign_id = :p_campaign_id)\n";
sb.append(" select * from column_name_temp where columnName not in (select column_name from campaign_customerlist_column where campaign_id = :p_campaign_id and column_name is not null)");
sb.append(" union all");
sb.append(" select title columnName, customize_field_id customizeFieldId, 0 isFix from customize_fields, dual");
sb.append(" where function_code = 'CUSTOMER'");
sb.append(" and site_id = :p_company_site_id");
sb.append(" and customize_field_id not in (select customize_field_id from campaign_customerlist_column where campaign_customerlist_column.campaign_id = :p_campaign_id)");
@@ -624,7 +627,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
"),\n"+
"customer_interactive_table as (\n"+
" select count(a.customer_id) campaignCustomerCalled, a.customer_list_id customerListId, a.campaign_id from campaign_customer a\n"+
" where a.status <> 0 and a.campaign_id = :p_campaign_id and in_campaign_status = 1\n"+
" where a.status <> 0 and a.campaign_id = :p_campaign_id\n"+
" group by a.customer_list_id, a.campaign_id\n"+
"),\n"+
"customer_not_interactive_table as (\n"+
...
...
@@ -655,7 +658,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
"select count(*) totalRow from data\n"+
")\n"+
"select a.customerListId, a.customerListCode, a.customerListName, a.totalCusList, a.totalCusCampaign, a.totalCusCalled, a.totalCusNotInteract, totalRow from data a, count_data\n"+
" select ccl.CUSTOMER_LIST_ID from campaign_customerlist ccl\n"+
" where ccl.campaign_id = :p_campaign_id and ccl.company_site_id = :p_company_site_id\n"+
"),\n"+
"customer_table as (\n"+
" select count(a.customer_id) totalCustomer, a.customer_list_id customerListId from customer_list_mapping a\n"+
" left join customer b on a.customer_id = b.customer_id\n"+
" where b.status = 1\n"+
" group by a.customer_list_id\n"+
"),\n"+
"customer_active_table as (\n"+
" select count(a.customer_id) customerActive, a.customer_list_id customerListId from customer_list_mapping a\n"+
" left join customer b on a.customer_id = b.customer_id\n"+
" where b.status = 1 and b.ipcc_status = 'active'\n"+
" group by a.customer_list_id\n"+
"),\n"+
"customer_lock_table as (\n"+
" select count(a.customer_id) customerLock, a.customer_list_id customerListId from customer_list_mapping a\n"+
" left join customer b on a.customer_id = b.customer_id\n"+
" where b.status = 1 and b.ipcc_status = 'locked'\n"+
" group by a.customer_list_id\n"+
"),\n"+
"customer_dnc_table as (\n"+
" select count(a.customer_id) customerDnc, a.customer_list_id customerListId from customer_list_mapping a\n"+
" left join customer b on a.customer_id = b.customer_id\n"+
" where b.status = 1 and b.call_allowed = 0\n"+
" group by a.customer_list_id\n"+
"),\n"+
"customer_filter_table as (\n"+
" select count(a.customer_id) customerFilter, a.customer_list_id customerListId from campaign_customer a\n"+
" where a.campaign_id = :p_campaign_id\n"+
" group by a.customer_list_id\n"+
"),\n"+
"data_temp as (\n"+
"select a.customer_list_id customerListId,\n"+
" a.customer_list_code customerListCode,\n"+
" a.customer_list_name customerListName,\n"+
" nvl(b.totalCustomer, 0) totalCusList,\n"+
" nvl(c.customerActive, 0) totalCusActive,\n"+
" nvl(d.customerLock, 0) totalCusLock,\n"+
" nvl(e.customerDnc, 0) totalCusDnc,\n"+
" nvl(null, 0) totalCusAddRemove,\n"+
" nvl(f.customerFilter, 0) totalCusFilter\n"+
"from customer_list a\n"+
"left join customer_table b on a.customer_list_id = b.customerListId\n"+
"left join customer_active_table c on a.customer_list_id = c.customerListId\n"+
"left join customer_lock_table d on a.customer_list_id = d.customerListId\n"+
"left join customer_dnc_table e on a.customer_list_id = e.customerListId\n"+
"left join customer_filter_table f on a.customer_list_id = f.customerListId\n"+
"where a.customer_list_id in (select CUSTOMER_LIST_ID from campaign_customer_id)\n"+
"),\n"+
"data as (\n"+
"select a.*, rownum row_ from data_temp a\n"+
"),\n"+
"count_data as (\n"+
"select count(*) totalRow from data_temp\n"+
")\n"+
"select a.customerListId, a.customerListCode, a.customerListName, a.totalCusList, a.totalCusActive, a.totalCusLock, a.totalCusDnc, a.totalCusAddRemove, a.totalCusFilter, totalRow from data a, count_data\n"+
sb.append(" inner join customer_list_mapping clm on c.customer_id = clm.customer_id");
sb.append(" where clm.customer_list_id in (select distinct cc.customer_list_id from campaign_customerlist cc where cc.campaign_id = :p_campaign_id and cc.company_site_id = :p_company_site_id)");
customer.nameRequired=Họ và tên không được để trống;
customer.emailMax50=Email không được quá 50 kí tự;
customer.mainPhoneRequired=Số điện thoại chính không được để trống
customer.secondPhoneRequired=Số điện thoại phụ không được để trống
customer.emailRequired=Số điện thoại email không được để trống
customer.emailMax100=Email không được quá 100 kí tự;
customer.invalidRecord=Bắt buộc nhập 1 trong 3 thông tin liên lạc(Số điện thoại chính, Số điện thoại phụ, Email);
customer.onlyNumber=Số điện thoại chỉ được nhập số;
customer.importSuccess=Import dữ liệu thành công
customer.importFailed=Import dữ liệu thất bại
customer.errorValidate=Validate dữ liệu lỗi
...
...
@@ -107,6 +106,7 @@ customer.importCustomer = IMPORT KHÁCH HÀNG
customer.notice=Chú ý: 1 bản ghi được coi là hợp lệ bắt buộc phải có thông tin Họ và Tên và 1 trong 3 thông tin liên lạc (số điện thoại chính, số điện thoại phụ hoặc email)
customer.emailInvalid=Email không đúng định dạng;
customer.emailExists=Email đã tồn tại;
customer.cusTypeInvalid=Loại khách hàng không hợp lệ;