支行名称改为关联sys_dept表获取

This commit is contained in:
CYQ 2025-10-21 16:45:38 +08:00
parent 4009c675c4
commit 0f7bff9922

View File

@ -36,72 +36,74 @@ public class MarketingValidInvalidProcessor extends AbstractBusinessProcessor {
// 插入营销人员信息与经办人员不重复的
String insertSql =
"INSERT INTO marketing_valid_invalid ( " +
" branch_name " +
" ,employee_name " +
" ,marketing_code " +
" ,customer_name " +
" ,customer_id " +
" ,invalid_business " +
" ,valid_business " +
" ,check_flag " +
" ,tenant_id " +
" ,create_dept " +
" ,create_by " +
" ,create_time " +
" ,record_month " +
")( " +
"select " +
" dept_name " +
" ,jb_name " +
" ,jb_id " +
" ,cust_name " +
" ,cust_id " +
" ,CASE " +
" WHEN check_flag='9' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,CASE " +
" WHEN check_flag='1' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,check_flag " +
" ,b.tenant_id " +
" ,b.dept_id " +
" ,b.user_id " +
" ,? " +
" ,? " +
"from mps_market a " +
"INNER JOIN sys_user b ON a.jb_id = b.mkt_no AND b.del_flag = '0' " +
"where SUBSTR(a.entry_date,1,7)=? and a.del_flag='0' and a.check_flag<>'0' " +
"union " +
"select " +
" dept_name " +
" ,yx_name " +
" ,yx_id " +
" ,cust_name " +
" ,cust_id " +
" ,CASE " +
" WHEN check_flag='9' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,CASE " +
" WHEN check_flag='1' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,check_flag " +
" ,b.tenant_id " +
" ,b.dept_id " +
" ,b.user_id " +
" ,? " +
" ,? " +
"from mps_market a " +
"INNER JOIN sys_user b ON a.yx_id = b.mkt_no AND b.del_flag = '0' " +
"where SUBSTR(a.entry_date,1,7)=? and a.del_flag='0' and a.check_flag<>'0'" +
"INSERT INTO marketing_valid_invalid ( " +
" branch_name " +
" ,employee_name " +
" ,marketing_code " +
" ,customer_name " +
" ,customer_id " +
" ,invalid_business " +
" ,valid_business " +
" ,check_flag " +
" ,tenant_id " +
" ,create_dept " +
" ,create_by " +
" ,create_time " +
" ,record_month " +
")( " +
"select " +
" e.dept_name " +
" ,a.jb_name " +
" ,a.jb_id " +
" ,a.cust_name " +
" ,a.cust_id " +
" ,CASE " +
" WHEN check_flag='9' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,CASE " +
" WHEN check_flag='1' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,check_flag " +
" ,b.tenant_id " +
" ,b.dept_id " +
" ,b.user_id " +
" ,? " +
" ,? " +
"from mps_market a " +
"INNER JOIN sys_user b ON a.jb_id = b.mkt_no AND b.del_flag = '0' " +
"left join sys_dept e ON b.dept_id = e.dept_id " +
"where SUBSTR(a.entry_date,1,7)=? and a.del_flag='0' and a.check_flag<>'0' " +
"union " +
"select " +
" e.dept_name " +
" ,a.yx_name " +
" ,a.yx_id " +
" ,a.cust_name " +
" ,a.cust_id " +
" ,CASE " +
" WHEN check_flag='9' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,CASE " +
" WHEN check_flag='1' " +
" then subcategory_name " +
" ELSE '' " +
" END " +
" ,check_flag " +
" ,b.tenant_id " +
" ,b.dept_id " +
" ,b.user_id " +
" ,? " +
" ,? " +
"from mps_market a " +
"INNER JOIN sys_user b ON a.yx_id = b.mkt_no AND b.del_flag = '0' " +
"left join sys_dept e ON b.dept_id = e.dept_id " +
"where SUBSTR(a.entry_date,1,7)=? and a.del_flag='0' and a.check_flag<>'0' " +
")";
Timestamp now = Timestamp.valueOf(LocalDateTime.now());