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

@@ -48,14 +48,12 @@
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientId as PatientID
,PatientName
,source
,trade_date
from hisbills_history
from hisbill_history
where trade_date=#{trade_date}
and PayMethod != '2' <!-- 排除PayMethod=2的记录不参与对账 -->
<if test="military_code != null and military_code != ''">
@@ -73,6 +71,9 @@
<if test="tranID!=null and tranID!=''">
and HisTransId=#{tranID}
</if>
<if test="platformTransId!=null and platformTransId!=''">
and PlatformTransId=#{platformTransId}
</if>
<if test="h_jylx!=null and h_jylx!=''">
and TradingStatus=#{h_jylx}
</if>

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