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

merge code

parent d4632514
...@@ -1627,19 +1627,30 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1627,19 +1627,30 @@ public class CustomerServiceImpl implements CustomerService {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
try { try {
stringBuilder.append(" with column_name_temp as ("); stringBuilder.append(" with column_name_temp as (");
stringBuilder.append(" select 'CUSTOMER_ID', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'CUSTOMER_ID' ,1 isFix from user_tab_columns, dual");
stringBuilder.append(" select 'CUSTOMER_NAME', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" union all");
stringBuilder.append(" select 'CUSTOMER_TYPE', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'CUSTOMER_NAME' ,1 isFix from user_tab_columns, dual");
stringBuilder.append(" select 'NAME', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" union all");
stringBuilder.append(" select 'CUSTOMER_TYPE' ,1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'NAME' ,1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'CURRENT_ADDRESS', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'CURRENT_ADDRESS', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'PLACE_OF_BIRTH', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'PLACE_OF_BIRTH', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'DATE_OF_BIRTH', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'DATE_OF_BIRTH', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'MOBILE_NUMBER', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'MOBILE_NUMBER', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'EMAIL', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'EMAIL', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'USERNAME', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'USERNAME', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" union all");
stringBuilder.append(" select 'CUSTOMER_TYPE', 1 isFix from user_tab_columns, dual"); stringBuilder.append(" select 'CUSTOMER_TYPE', 1 isFix from user_tab_columns, dual");
stringBuilder.append(" where table_name = 'CUSTOMER'"); stringBuilder.append(" where table_name = 'CUSTOMER'");
stringBuilder.append(" )"); stringBuilder.append(" )");
stringBuilder.append(" select * from column_name_temp"); stringBuilder.append(" select * from column_name_temp");
stringBuilder.append(" union all"); stringBuilder.append(" union all");
stringBuilder.append(" select title columnName, 0 isFix "); stringBuilder.append(" select title columnName, 0 isFix ");
...@@ -1647,7 +1658,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1647,7 +1658,7 @@ public class CustomerServiceImpl implements CustomerService {
stringBuilder.append(" where function_code = 'CUSTOMER'"); stringBuilder.append(" where function_code = 'CUSTOMER'");
stringBuilder.append(" and site_id = :p_company_site_id"); stringBuilder.append(" and site_id = :p_company_site_id");
stringBuilder.append(" and STATUS = 1"); stringBuilder.append(" and STATUS = 1");
stringBuilder.append(" and active = 1 "); stringBuilder.append(" and active = 1 ");
params.put("p_company_site_id", customizeFields.getCompanySiteId()); params.put("p_company_site_id", customizeFields.getCompanySiteId());
params.put("p_customer_id", customizeFields.getCustomerId()); params.put("p_customer_id", customizeFields.getCustomerId());
list = namedParameterJdbcTemplate.query(stringBuilder.toString(), params, BeanPropertyRowMapper.newInstance(FieldsToShowDTO.class)); list = namedParameterJdbcTemplate.query(stringBuilder.toString(), params, BeanPropertyRowMapper.newInstance(FieldsToShowDTO.class));
...@@ -1664,4 +1675,5 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1664,4 +1675,5 @@ public class CustomerServiceImpl implements CustomerService {
} }
} }
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