增加金额校验

This commit is contained in:
CYQ 2025-10-14 17:07:01 +08:00
parent 9a09539001
commit 468f85daaf

View File

@ -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);
}