From 1eb1673da0574f370ba28942c85901ac616ea906 Mon Sep 17 00:00:00 2001 From: CYQ <123@163.com> Date: Thu, 6 Nov 2025 15:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E7=A7=AF=E9=87=91?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E9=87=8D=E5=A4=8D=E7=BB=9F=E8=AE=A1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/processor/biz/BIZ032Processor.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ032Processor.java b/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ032Processor.java index dde9e34..875d0af 100644 --- a/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ032Processor.java +++ b/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ032Processor.java @@ -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); } } \ No newline at end of file