update:初版对账

This commit is contained in:
Yuan
2025-09-17 11:20:06 +08:00
parent e2959b738b
commit e63ace40fd
6 changed files with 49 additions and 74 deletions

View File

@@ -88,29 +88,29 @@
, PayType
, HisOperNum, PatientID, PatientName
, sort_date, trade_date, err_type, check_result, is_active)
select concat(b.I_JYRQ, ' ', b.I_JYSJ) as jysj
, b.I_DDH
, b.I_JYJE
, b.I_JYLX
, b.I_FXK
, b.I_JYSJ
select concat(b.C_JYRQ, ' ', b.C_JYSJ) as jysj
, b.C_YSDDH
, b.C_JYJE
, b.C_JYLX
, b.C_FKH
, b.C_JYSJ
, a.PlatformTransId
, a.BizType
, a.TradingStatus
, a.Amount
, a.PayType
, a.HisOperCode
, a.PatientID
, a.PatientId
, a.PatientName
, a.TradeTime
, a.trade_date
, ''
, '0'
, '1'
from (select * from hisbills_history where trade_date = #{trade_date}) a
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}) a
inner join
(select * from bankbills_history where I_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.I_DDH and a.TradingStatus = b.I_JYLX and a.Amount+0 = b.I_JYJE+0
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.C_YSDDH and a.TradingStatus = b.C_JYLX and a.Amount+0 = b.C_JYJE+0
</insert>
<insert id="insertHisUnilateral" parameterType="HashMap">
@@ -119,29 +119,29 @@
, HisOperNum, PatientID, PatientName
, sort_date, trade_date, err_type, check_result, is_active)
select a.TradeTime as jysj
, b.I_DDH
, b.I_JYJE
, b.I_JYLX
, b.I_FXK
, b.I_JYSJ
, b.C_YSDDH
, b.C_JYJE
, b.C_JYLX
, b.C_FKH
, b.C_JYSJ
, a.PlatformTransId
, a.BizType
, a.TradingStatus
, a.Amount
, a.PayType
, a.HisOperCode
, a.PatientID
, a.PatientId
, a.PatientName
, a.TradeTime
, a.trade_date
, '1'
, '1'
, '1'
from (select * from hisbills_history where trade_date = #{trade_date}) a
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}) a
left join
(select * from bankbills_history where I_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.I_DDH and a.TradingStatus = b.I_JYLX and a.Amount+0 = b.I_JYJE+0
where b.I_DDH is null
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.C_YSDDH and a.TradingStatus = b.C_JYLX and a.Amount+0 = b.C_JYJE+0
where b.C_YSDDH is null
</insert>
<insert id="insertThirdUnilateral" parameterType="HashMap">
@@ -149,29 +149,29 @@
, PayType
, HisOperNum, PatientID, PatientName
, sort_date, trade_date, err_type, check_result, is_active)
select concat(b.I_JYRQ, ' ', b.I_JYSJ) as jysj
, b.I_DDH
, b.I_JYJE
, b.I_JYLX
, b.I_FXK
, b.I_JYSJ
select concat(b.C_JYRQ, ' ', b.C_JYSJ) as jysj
, b.C_YSDDH
, b.C_JYJE
, b.C_JYLX
, b.C_FKH
, b.C_JYSJ
, a.HisTransId
, a.BizType
, a.TradingStatus
, a.Amount
, a.PayType
, a.HisOperCode
, a.PatientID
, a.PatientId
, a.PatientName
, b.I_JYSJ
, b.I_JYRQ
, b.C_JYSJ
, b.C_JYRQ
, '2'
, '1'
, '1'
from (select * from hisbills_history where trade_date = #{trade_date}) a
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}) a
right join
(select * from bankbills_history where I_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.I_DDH and a.TradingStatus = b.I_JYLX and a.Amount + 0 = b.I_JYJE + 0
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.C_YSDDH and a.TradingStatus = b.C_JYLX and a.Amount + 0 = b.C_JYJE + 0
where a.PlatformTransId is null
</insert>