diff --git a/src/main/java/com/saye/hospitalgd/entity/BankbillHistory.java b/src/main/java/com/saye/hospitalgd/entity/BankbillHistory.java index 72de062..8ad886c 100644 --- a/src/main/java/com/saye/hospitalgd/entity/BankbillHistory.java +++ b/src/main/java/com/saye/hospitalgd/entity/BankbillHistory.java @@ -150,5 +150,9 @@ public class BankbillHistory implements Serializable { * 医疗总费用 */ private String medfeeSumamt; + /** + * 是否住院订单 (0:否 1:是) + */ + private String isInpatient; } diff --git a/src/main/java/com/saye/hospitalgd/mapper/TransactionDetailMapper.java b/src/main/java/com/saye/hospitalgd/mapper/TransactionDetailMapper.java index 1c71ffb..e03b5b0 100644 --- a/src/main/java/com/saye/hospitalgd/mapper/TransactionDetailMapper.java +++ b/src/main/java/com/saye/hospitalgd/mapper/TransactionDetailMapper.java @@ -74,6 +74,8 @@ public interface TransactionDetailMapper { void deleteHisAndThirdJoinDataByParamAndNotUnique(HashMap map) throws Exception; + void deleteThirdUnilateralByIddh(HashMap map) throws Exception; + void addNotUniqueData(List> list) throws Exception; /** diff --git a/src/main/java/com/saye/hospitalgd/mapper/UnilateralMapper.java b/src/main/java/com/saye/hospitalgd/mapper/UnilateralMapper.java index ececa12..961931f 100644 --- a/src/main/java/com/saye/hospitalgd/mapper/UnilateralMapper.java +++ b/src/main/java/com/saye/hospitalgd/mapper/UnilateralMapper.java @@ -38,4 +38,9 @@ public interface UnilateralMapper { * 根据ID删除单边账记录 */ void deleteUnilateralById(HashMap map) throws Exception; + + /** + * 根据订单号删除银行单边账 + */ + void deleteBankUnilateralByI_DDH(HashMap map) throws Exception; } diff --git a/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/BankGetDataMethodByJHLZF.java b/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/BankGetDataMethodByJHLZF.java index d50aea9..4f82a37 100644 --- a/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/BankGetDataMethodByJHLZF.java +++ b/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/BankGetDataMethodByJHLZF.java @@ -587,6 +587,9 @@ public class BankGetDataMethodByJHLZF { // 订单号: AF列(索引31), 柜台编号: AG列(索引32), 系统参考号: AH列(索引33), // 持卡人姓名: AI列(索引34), 付款凭证号: AJ列(索引35), 备注1: AK列(索引36), 备注2: AL列(索引37) + // 获取终端号(C列,索引2)用于判断是否为住院订单 + String zdh = s1.length > 2 ? s1[2].trim() : ""; + // 交易日期和时间 jyrq = s1.length > 13 ? s1[13] : ""; String jysj = s1.length > 14 ? s1[14] : ""; // 交易时间在第14列(索引14) @@ -609,6 +612,7 @@ public class BankGetDataMethodByJHLZF { bankbillHistory.setCJyrq(jyrq); // N列(索引13): 交易日期 bankbillHistory.setCJysj(jysj); // P列(索引15): 交易时间 bankbillHistory.setCJyje(s1.length > 20 ? s1[20] : "0"); // U列(索引20): 交易金额 + bankbillHistory.setCZdh(zdh); // C列(索引2): 终端号 // QR列(索引16): 支付方式(Excel中就是微信支付、支付宝等) String zffs = s1.length > 16 ? s1[16].trim() : "建行龙支付"; @@ -689,6 +693,15 @@ public class BankGetDataMethodByJHLZF { bankbillHistory.setCFdjc(""); // 分店简称(空) bankbillHistory.setCZddh(""); // 子订单号(空) bankbillHistory.setBillTableName("建行龙支付对账单"); // 对账表名 + + // 根据终端号判断是否为住院订单 + // 终端号为10091548或10091549的为住院订单,不参与对账 + if ("10091548".equals(zdh) || "10091549".equals(zdh)) { + bankbillHistory.setIsInpatient("1"); // 标记为住院订单 + log.info("标记为住院订单: 终端号=" + zdh + ", 订单号=" + bankbillHistory.getCShddh()); + } else { + bankbillHistory.setIsInpatient("0"); // 标记为非住院订单 + } bankbillHistoryList.add(bankbillHistory); log.info("成功解析第 " + (i + 1) + " 行数据"); diff --git a/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/ReconciliationMethod.java b/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/ReconciliationMethod.java index 2ab3643..146f5ec 100644 --- a/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/ReconciliationMethod.java +++ b/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/ReconciliationMethod.java @@ -489,8 +489,10 @@ public class ReconciliationMethod { delMap.put("h_jylx", h_jylx); transactionDetailService.deleteHisAndThirdJoinDataByParamAndNotUnique(delMap); - //删除当天已经生成的该条对应的可能错帐记录 - unilateralService.deleteUnilateralByIdandStatus(delMap); + // 删除当天生成的、与此重复订单号相关的、所有类型的单边账(包括HIS单边和银行单边) + unilateralService.deleteUnilateralByIdandStatus(delMap); // 按 HIS 字段删除 + delMap.put("i_ddh", tranid); // tranid 与 i_ddh 在此场景下是同一个订单号 + unilateralService.deleteBankUnilateralByI_DDH(delMap); // 按银行字段删除 } @@ -532,7 +534,8 @@ public class ReconciliationMethod { String amountStr = StringDUtil.changeNullToEmpty(hisDetailMap.get("AMOUNT")); if (!"".equals(amountStr)) { try { - hisTotal = hisTotal.add(new java.math.BigDecimal(amountStr)); + // 使用 toBigDecimal 统一精度进行累加 + hisTotal = hisTotal.add(AmountUtil.toBigDecimal(amountStr)); } catch (Exception e) { // 金额异常时跳过特殊处理,走原有逻辑 hisTotal = null; @@ -545,7 +548,11 @@ public class ReconciliationMethod { HashMap bankDetailMap = list2.get(0); String bankAmtStr = StringDUtil.changeNullToEmpty(bankDetailMap.get("I_JYJE")); - if (AmountUtil.isAmountEqual(hisTotal.toString(), bankAmtStr)) { + // 统一为两位小数的 BigDecimal 再进行比较,避免精度问题 + java.math.BigDecimal hisTotalDecimal = AmountUtil.toBigDecimal(hisTotal.toString()); + java.math.BigDecimal bankAmtDecimal = AmountUtil.toBigDecimal(bankAmtStr); + + if (AmountUtil.isAmountEqual(hisTotalDecimal, bankAmtDecimal)) { // 以第一条 HIS 记录为代表,构造一条正常关联记录 HashMap hisDetailMap = list.get(0); @@ -566,21 +573,26 @@ public class ReconciliationMethod { String i_ddh = StringDUtil.changeNullToEmpty(bankDetailMap.get("I_DDH")); HashMap addMap = new HashMap<>(); + + // 银行端字段 addMap.put("jysj", i_jyrq + " " + i_jysj); addMap.put("i_ddh", i_ddh); addMap.put("i_jyje", i_jyje); addMap.put("i_jylx", i_jylx); addMap.put("i_jyqd", i_jyqd); - addMap.put("tradeTime", tradeTime); - addMap.put("tranID", tranid); + // HIS 端字段 + addMap.put("tradeTime", tradeTime); + addMap.put("tranID", tranid); // HIS-平台流水号 addMap.put("BizType", bizType); addMap.put("h_jylx", hJylx); - addMap.put("amount", amount); + addMap.put("amount", amount); // HIS-汇总金额 addMap.put("payType", payType); addMap.put("hisOperNum", hisopernum); addMap.put("patientid", patientid); addMap.put("patientname", patientname); + + // 公共及状态字段 addMap.put("sort_date", tradeTime); addMap.put("trade_date", trade_date); addMap.put("err_type", ""); @@ -588,7 +600,21 @@ public class ReconciliationMethod { addMap.put("is_active", "1"); addMap.put("join_id", ""); - trueList.add(addMap); + // 删除第三方单边账记录(third_join_his 中 err_type = '2') + HashMap delThirdMap = new HashMap<>(); + delThirdMap.put("trade_date", trade_date); + delThirdMap.put("i_ddh", i_ddh); + transactionDetailService.deleteThirdUnilateralByIddh(delThirdMap); + + // 立即写入聚合后的正常对账记录 + transactionDetailService.addNotUniqueData(Collections.singletonList(addMap)); + + // 清除因银行单边账先生成而残留的记录 + HashMap delBankUnilateralMap = new HashMap<>(); + delBankUnilateralMap.put("trade_date", trade_date); + delBankUnilateralMap.put("i_ddh", i_ddh); + unilateralService.deleteBankUnilateralByI_DDH(delBankUnilateralMap); + // 已按“合并金额相等”视为正常账,不再按单条金额匹配,直接处理下一组重复 TranID continue; } @@ -673,8 +699,8 @@ public class ReconciliationMethod { int errNum = 0; - //如果两边都有 取出数据设置差异 - if (hisIterator.hasNext() && bankIterator.hasNext()) { + // 循环处理差异账 + while (hisIterator.hasNext() && bankIterator.hasNext()) { HashMap hisDetailMap = hisIterator.next(); HashMap bankDetailMap = bankIterator.next(); @@ -749,7 +775,12 @@ public class ReconciliationMethod { //将记录添加到单边账表 unilateralService.insertUnilateral(addUnilateralMap); - } else if (hisIterator.hasNext()) { + + + } + + // 处理HIS单边账 + while (hisIterator.hasNext()) { HashMap hisDetailMap = hisIterator.next(); @@ -818,7 +849,10 @@ public class ReconciliationMethod { //将记录添加到单边账表 unilateralService.insertUnilateral(addUnilateralMap); - } else if (bankIterator.hasNext()) { + } + + // 处理银行单边账 + while (bankIterator.hasNext()) { HashMap bankDetailMap = bankIterator.next(); String i_jyje = StringDUtil.changeNullToEmpty(bankDetailMap.get("I_JYJE")); diff --git a/src/main/java/com/saye/hospitalgd/service/TransactionDetailService.java b/src/main/java/com/saye/hospitalgd/service/TransactionDetailService.java index 98f8f93..ad928ed 100644 --- a/src/main/java/com/saye/hospitalgd/service/TransactionDetailService.java +++ b/src/main/java/com/saye/hospitalgd/service/TransactionDetailService.java @@ -71,6 +71,8 @@ public interface TransactionDetailService { */ void deleteHisAndThirdJoinDataByParamAndNotUnique(HashMap map) throws Exception; + void deleteThirdUnilateralByIddh(HashMap map) throws Exception; + /** * @description: 添加处理后的非唯一记录回数据 * @author thuang diff --git a/src/main/java/com/saye/hospitalgd/service/UnilateralService.java b/src/main/java/com/saye/hospitalgd/service/UnilateralService.java index 6f2e23e..066879f 100644 --- a/src/main/java/com/saye/hospitalgd/service/UnilateralService.java +++ b/src/main/java/com/saye/hospitalgd/service/UnilateralService.java @@ -36,4 +36,9 @@ public interface UnilateralService { * 根据ID删除单边账记录 */ void deleteUnilateralById(HashMap map) throws Exception; + + /** + * 根据订单号删除银行单边账 + */ + void deleteBankUnilateralByI_DDH(HashMap map) throws Exception; } diff --git a/src/main/java/com/saye/hospitalgd/service/impl/TransactionDetailServiceImpl.java b/src/main/java/com/saye/hospitalgd/service/impl/TransactionDetailServiceImpl.java index b8e56fb..f5aaff0 100644 --- a/src/main/java/com/saye/hospitalgd/service/impl/TransactionDetailServiceImpl.java +++ b/src/main/java/com/saye/hospitalgd/service/impl/TransactionDetailServiceImpl.java @@ -159,6 +159,11 @@ public class TransactionDetailServiceImpl implements TransactionDetailService { transactionDetailMapper.deleteHisAndThirdJoinDataByParamAndNotUnique(map); } + @Override + public void deleteThirdUnilateralByIddh(HashMap map) throws Exception { + transactionDetailMapper.deleteThirdUnilateralByIddh(map); + } + @Override public void addNotUniqueData(List> list) throws Exception { transactionDetailMapper.addNotUniqueData(list); diff --git a/src/main/java/com/saye/hospitalgd/service/impl/UnilateralServiceImpl.java b/src/main/java/com/saye/hospitalgd/service/impl/UnilateralServiceImpl.java index 4224ba3..e472e5c 100644 --- a/src/main/java/com/saye/hospitalgd/service/impl/UnilateralServiceImpl.java +++ b/src/main/java/com/saye/hospitalgd/service/impl/UnilateralServiceImpl.java @@ -86,4 +86,9 @@ public class UnilateralServiceImpl implements UnilateralService { public void deleteUnilateralById(HashMap map) throws Exception { unilateralMapper.deleteUnilateralById(map); } + + @Override + public void deleteBankUnilateralByI_DDH(HashMap map) throws Exception { + unilateralMapper.deleteBankUnilateralByI_DDH(map); + } } diff --git a/src/main/resources/mapper/BankbillHistoryMapper.xml b/src/main/resources/mapper/BankbillHistoryMapper.xml index c1aa444..48c50bf 100644 --- a/src/main/resources/mapper/BankbillHistoryMapper.xml +++ b/src/main/resources/mapper/BankbillHistoryMapper.xml @@ -30,12 +30,12 @@ insert into - bankbill_history(C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name,FUND_PAY_SUMAMT,ACCT_PAY,MEDFEE_SUMAMT) + bankbill_history(C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name,FUND_PAY_SUMAMT,ACCT_PAY,MEDFEE_SUMAMT,is_inpatient) values ( #{itm.cQsrq},#{itm.cJyrq},#{itm.cJysj},#{itm.cZdh},#{itm.cCard},#{itm.cJylx},#{itm.cJyje},#{itm.cQsje},#{itm.cSxf},#{itm.cSjzfje},#{itm.cCkh},#{itm.cLsh},#{itm.cKlx} - ,#{itm.cFkh},#{itm.cZffs},#{itm.cYsddh},#{itm.cShddh},#{itm.cBzzd},#{itm.cQbyhje},#{itm.cShyhje},#{itm.cYjylsh},#{itm.cFqqs},#{itm.cFqsxf},#{itm.cFqfwf},#{itm.cFqfxf},#{itm.cQtyhje},#{itm.cThddh},#{itm.cFkfy},#{itm.cFdjc},#{itm.cZddh},#{itm.billTableName},#{itm.fundPaySumamt},#{itm.acctPay},#{itm.medfeeSumamt} + ,#{itm.cFkh},#{itm.cZffs},#{itm.cYsddh},#{itm.cShddh},#{itm.cBzzd},#{itm.cQbyhje},#{itm.cShyhje},#{itm.cYjylsh},#{itm.cFqqs},#{itm.cFqsxf},#{itm.cFqfwf},#{itm.cFqfxf},#{itm.cQtyhje},#{itm.cThddh},#{itm.cFkfy},#{itm.cFdjc},#{itm.cZddh},#{itm.billTableName},#{itm.fundPaySumamt},#{itm.acctPay},#{itm.medfeeSumamt},#{itm.isInpatient} ) @@ -136,6 +136,7 @@ left join (select C_YSDDH from bankbill_history where C_JYLX = '2' and C_JYRQ = #{trade_date}) b on a.C_YSDDH = b.C_YSDDH where a.C_JYRQ = #{trade_date} + and (a.is_inpatient is null or a.is_inpatient = '0') -- 排除住院订单 and b.C_YSDDH is null @@ -231,12 +232,12 @@ insert into - bankbill_original(C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name,FUND_PAY_SUMAMT,ACCT_PAY,MEDFEE_SUMAMT) + bankbill_original(C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name,FUND_PAY_SUMAMT,ACCT_PAY,MEDFEE_SUMAMT,is_inpatient) values ( #{itm.cQsrq},#{itm.cJyrq},#{itm.cJysj},#{itm.cZdh},#{itm.cCard},#{itm.cJylx},#{itm.cJyje},#{itm.cQsje},#{itm.cSxf},#{itm.cSjzfje},#{itm.cCkh},#{itm.cLsh},#{itm.cKlx} - ,#{itm.cFkh},#{itm.cZffs},#{itm.cYsddh},#{itm.cShddh},#{itm.cBzzd},#{itm.cQbyhje},#{itm.cShyhje},#{itm.cYjylsh},#{itm.cFqqs},#{itm.cFqsxf},#{itm.cFqfwf},#{itm.cFqfxf},#{itm.cQtyhje},#{itm.cThddh},#{itm.cFkfy},#{itm.cFdjc},#{itm.cZddh},#{itm.billTableName},#{itm.fundPaySumamt},#{itm.acctPay},#{itm.medfeeSumamt} + ,#{itm.cFkh},#{itm.cZffs},#{itm.cYsddh},#{itm.cShddh},#{itm.cBzzd},#{itm.cQbyhje},#{itm.cShyhje},#{itm.cYjylsh},#{itm.cFqqs},#{itm.cFqsxf},#{itm.cFqfwf},#{itm.cFqfxf},#{itm.cQtyhje},#{itm.cThddh},#{itm.cFkfy},#{itm.cFdjc},#{itm.cZddh},#{itm.billTableName},#{itm.fundPaySumamt},#{itm.acctPay},#{itm.medfeeSumamt},#{itm.isInpatient} ) diff --git a/src/main/resources/mapper/BankbillsHistoryMapper.xml b/src/main/resources/mapper/BankbillsHistoryMapper.xml index 1688476..40e1999 100644 --- a/src/main/resources/mapper/BankbillsHistoryMapper.xml +++ b/src/main/resources/mapper/BankbillsHistoryMapper.xml @@ -40,6 +40,7 @@ select * from bankbill_history where C_JYRQ = #{trade_date} + and (is_inpatient is null or is_inpatient = '0') insert into bankbills_original ( diff --git a/src/main/resources/mapper/HisbillsHistoryMapper.xml b/src/main/resources/mapper/HisbillsHistoryMapper.xml index 2b105c2..0c888ef 100644 --- a/src/main/resources/mapper/HisbillsHistoryMapper.xml +++ b/src/main/resources/mapper/HisbillsHistoryMapper.xml @@ -24,6 +24,7 @@ select * from hisbill_history where trade_date = #{trade_date} + and PayMethod != '2' and PayType != #{military_code} @@ -56,6 +57,7 @@ from hisbills_history where trade_date=#{trade_date} + and PayMethod != '2' and PayType != #{military_code} diff --git a/src/main/resources/mapper/TransactionDetailMapper.xml b/src/main/resources/mapper/TransactionDetailMapper.xml index 1275a85..43d8b39 100644 --- a/src/main/resources/mapper/TransactionDetailMapper.xml +++ b/src/main/resources/mapper/TransactionDetailMapper.xml @@ -80,6 +80,8 @@ inner join bankbill_history b on a.PlatformTransId = b.C_YSDDH where b.C_JYRQ >= #{startTime} and b.C_JYRQ <= #{endTime} + and a.PayMethod != '2' -- 排除不参与对账的记录 + and (b.is_inpatient is null or b.is_inpatient = '0') -- 排除住院订单 and a.PayType != #{prepayment_code} @@ -120,6 +122,7 @@ , '0' , '1' from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code} + and PayMethod != '2' -- 排除不参与对账的记录 and payType!=#{military_code} @@ -134,7 +137,7 @@ ) a inner join - (select * from bankbill_history where C_JYRQ = #{trade_date}) b + (select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单 on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2) @@ -163,6 +166,7 @@ , '1' , '1' from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code} + and PayMethod != '2' -- 排除不参与对账的记录 and payType!=#{military_code} @@ -177,7 +181,7 @@ ) a left join - (select * from bankbill_history where C_JYRQ = #{trade_date}) b + (select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单 on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2) where b.C_SHDDH is null @@ -207,6 +211,7 @@ , '1' , '1' from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code} + and PayMethod != '2' -- 排除不参与对账的记录 and payType!=#{military_code} @@ -221,7 +226,7 @@ ) a right join - (select * from bankbill_history where C_JYRQ = #{trade_date}) b + (select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单 on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2) where a.PlatformTransId is null @@ -252,6 +257,7 @@ , '0' , '1' from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code} + and PayMethod != '2' -- 排除不参与对账的记录 and HisOperCode not in @@ -290,6 +296,7 @@ , '1' , '1' from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code} + and PayMethod != '2' -- 排除不参与对账的记录 and HisOperCode not in @@ -329,6 +336,7 @@ , '1' , '1' from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code} + and PayMethod != '2' -- 排除不参与对账的记录 and HisOperCode not in @@ -589,11 +597,11 @@ --> @@ -606,6 +614,14 @@ and H_JYLX = #{h_jylx} + + delete + from third_join_his + where trade_date = #{trade_date} + and I_DDH = #{i_ddh} + and err_type = '2' + + insert into third_join_his(JYSJ diff --git a/src/main/resources/mapper/UnilateralMapper.xml b/src/main/resources/mapper/UnilateralMapper.xml index c832111..1e7a61e 100644 --- a/src/main/resources/mapper/UnilateralMapper.xml +++ b/src/main/resources/mapper/UnilateralMapper.xml @@ -244,4 +244,12 @@ delete from unmanger_unilateral where id = #{id} + + + delete + from unmanger_unilateral + where trade_date = #{trade_date} + and I_DDH = #{i_ddh} + and err_type = '2' + \ No newline at end of file