From 468f85daafba439568166180bd5d0b50232484e9 Mon Sep 17 00:00:00 2001 From: CYQ <123@163.com> Date: Tue, 14 Oct 2025 17:07:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=91=E9=A2=9D=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/processor/biz/BIZ022Processor.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ022Processor.java b/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ022Processor.java index 2bca062..5e212f0 100644 --- a/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ022Processor.java +++ b/MpsFormalBatch/src/main/java/com/gtsoft/mps/batch/processor/biz/BIZ022Processor.java @@ -70,13 +70,22 @@ public class BIZ022Processor extends AbstractBusinessProcessor { * 验证营销记录有效性 */ private int validateMarketingRecords(Connection connection, String batchMonth) throws SQLException { - String sql = "UPDATE mps_market m " + - "SET check_flag = CASE " + + String sql = "UPDATE mps_market m " + + "SET check_flag = CASE " + " WHEN EXISTS ( " + - " SELECT 1 FROM mps_import_water s " + - " WHERE s.customer_code = m.heating_no ) " + - " THEN '1' ELSE '9' END " + - "WHERE SUBSTR(entry_date, 1, 7) = ? and subcategory_id = 'BIZ022' and del_flag='0' "; + " SELECT 1 " + + " FROM ( " + + " SELECT customer_code " + + " FROM mps_import_water " + + " GROUP BY customer_code " + + " HAVING SUM(CAST(NULLIF(TRIM(current_payment_amount), '') AS DECIMAL(18,2))) > 20 " + + " ) s " + + " WHERE s.customer_code = m.heating_no " + + " ) THEN '1' ELSE '9' END " + + "WHERE " + + " SUBSTR(entry_date, 1, 7) = ? " + + " AND subcategory_id = 'BIZ022' " + + " AND del_flag = '0' "; return executeParameterizedSql(connection, sql, batchMonth); }