修改公积金金额重复统计的问题
This commit is contained in:
parent
30cea58021
commit
1eb1673da0
@ -104,20 +104,16 @@ public class BIZ032Processor extends AbstractBusinessProcessor {
|
||||
" e.dept_category AS branch_id, " +
|
||||
" a.jb_id AS marketer_code, " +
|
||||
" ? AS record_date, " +
|
||||
" COUNT(1) AS total_count, " +
|
||||
" SUM(h.count) AS total_count, " +
|
||||
" SUM(CASE WHEN a.yx_id = a.jb_id THEN h.payment_amount ELSE 0 END) AS self_marketing_amt, " +
|
||||
" SUM(CASE WHEN a.yx_id <> a.jb_id THEN h.payment_amount ELSE 0 END) AS other_marketing_amt, " +
|
||||
" MAX(COALESCE(g.pricing_rule, 1)) AS pricing_rule, " +
|
||||
" MAX(COALESCE(f.jb_percent, 1)) AS jb_percent " +
|
||||
" FROM mps_market a " +
|
||||
" FROM (select distinct jb_id,yx_id,surplus_account_name,subcategory_id,dept_id from mps_market where subcategory_id = 'BIZ032' AND SUBSTR(entry_date, 1, 7)=? AND check_flag = '1' ) a " +
|
||||
" LEFT JOIN sys_dept e ON a.dept_id = e.dept_id " +
|
||||
" LEFT JOIN business_percentage f ON e.dept_category = f.branch_id " +
|
||||
" LEFT JOIN business_subcategory g ON a.subcategory_id = g.type_id " +
|
||||
" LEFT JOIN mps_import_gjj_payment h ON a.surplus_account_name = h.counterparty_name " +
|
||||
" WHERE " +
|
||||
" a.subcategory_id = 'BIZ032' " +
|
||||
" AND SUBSTR(a.entry_date, 1, 7) = ? " +
|
||||
" AND a.check_flag = '1' " +
|
||||
" LEFT JOIN (select counterparty_name,sum(payment_amount) as payment_amount,count(1) as count from mps_import_gjj_payment where import_time=? group by counterparty_name) h ON a.surplus_account_name = h.counterparty_name " +
|
||||
" GROUP BY " +
|
||||
" e.dept_category, " +
|
||||
" a.jb_id " +
|
||||
@ -132,7 +128,7 @@ public class BIZ032Processor extends AbstractBusinessProcessor {
|
||||
"WHERE " +
|
||||
" mp.record_date = ? ", tableName);
|
||||
|
||||
return executeParameterizedSql(connection, sql, batchMonth, batchMonth, batchMonth);
|
||||
return executeParameterizedSql(connection, sql, batchMonth, batchMonth, batchMonth, batchMonth);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,18 +141,13 @@ public class BIZ032Processor extends AbstractBusinessProcessor {
|
||||
" e.dept_category AS branch_id, " +
|
||||
" a.yx_id AS marketer_code, " +
|
||||
" ? AS record_date, " +
|
||||
" COUNT(1) AS housing_fund_customer_count, " +
|
||||
" SUM(h.count) AS housing_fund_customer_count, " +
|
||||
" SUM(h.payment_amount) * MAX(COALESCE(g.pricing_rule, 1)) * MAX(COALESCE(f.yx_percent, 1)) AS housing_fund_customer_amount " +
|
||||
" FROM mps_market a " +
|
||||
" FROM (select distinct jb_id,yx_id,surplus_account_name,subcategory_id,dept_id from mps_market where subcategory_id = 'BIZ032' AND SUBSTR(entry_date, 1, 7)=? AND check_flag = '1' AND yx_id <> jb_id) a " +
|
||||
" LEFT JOIN sys_dept e ON a.dept_id = e.dept_id " +
|
||||
" LEFT JOIN business_percentage f ON e.dept_category = f.branch_id " +
|
||||
" LEFT JOIN business_subcategory g ON a.subcategory_id = g.type_id " +
|
||||
" LEFT JOIN mps_import_gjj_payment h ON a.surplus_account_name = h.counterparty_name " +
|
||||
" WHERE " +
|
||||
" a.subcategory_id = 'BIZ032' " +
|
||||
" AND SUBSTR(a.entry_date, 1, 7) = ? " +
|
||||
" AND a.yx_id <> a.jb_id " +
|
||||
" AND a.check_flag = '1' " +
|
||||
" LEFT JOIN (select counterparty_name,sum(payment_amount) as payment_amount,count(1) as count from mps_import_gjj_payment where import_time=? group by counterparty_name) h ON a.surplus_account_name = h.counterparty_name " +
|
||||
" GROUP BY " +
|
||||
" e.dept_category, " +
|
||||
" a.yx_id " +
|
||||
@ -170,6 +161,6 @@ public class BIZ032Processor extends AbstractBusinessProcessor {
|
||||
"WHERE " +
|
||||
" mp.record_date = ?", tableName);
|
||||
|
||||
return executeParameterizedSql(connection, sql, batchMonth, batchMonth, batchMonth);
|
||||
return executeParameterizedSql(connection, sql, batchMonth, batchMonth, batchMonth, batchMonth);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user