bugfix:三方一对多his场景处理

This commit is contained in:
Yuan
2025-11-21 10:06:18 +08:00
parent c7747abc1e
commit 10ca4fae06
6 changed files with 218 additions and 12 deletions

View File

@@ -601,6 +601,7 @@
from third_join_his
where trade_date = #{trade_date}
and TranID != ''
and check_result != '0' <!-- 排除已对平的记录,这些记录不应该被删除 -->
group by TranID, H_JYLX
having count(TranID) > 1
</select>
@@ -612,6 +613,7 @@
where trade_date = #{trade_date}
and TranID = #{tranID}
and H_JYLX = #{h_jylx}
and check_result != '0' <!-- 不删除已对平的记录 -->
</delete>
<delete id="deleteThirdUnilateralByIddh" parameterType="HashMap">
@@ -622,6 +624,33 @@
and err_type = '2'
</delete>
<!-- 根据订单号删除third_join_his中所有相关记录用于一对多场景 -->
<delete id="deleteThirdJoinDataByI_DDH" parameterType="HashMap">
delete
from third_join_his
where trade_date = #{trade_date}
and I_DDH = #{i_ddh}
</delete>
<!-- 更新third_join_his中的银行单边记录补充HIS数据用于一对多场景 -->
<update id="updateThirdJoinDataWithHisData" parameterType="HashMap">
update third_join_his
set TradeTime = #{tradeTime},
TranID = #{tranID},
BizType = #{BizType},
H_JYLX = #{h_jylx},
Amount = #{amount},
PayType = #{payType},
HisOperNum = #{hisOperNum},
PatientID = #{patientid},
PatientName = #{patientname},
sort_date = #{sort_date},
err_type = #{err_type},
check_result = #{check_result}
where trade_date = #{trade_date}
and I_DDH = #{i_ddh}
</update>
<!--添加修改后的重复记录回数据库-->
<insert id="addNotUniqueData" parameterType="java.util.List">
insert into third_join_his(JYSJ