update:医保对账

This commit is contained in:
Yuan
2025-10-27 08:49:28 +08:00
parent 94e8850a40
commit 3e9a25dd38
32 changed files with 2134 additions and 38 deletions

View File

@@ -17,6 +17,10 @@
,trade_date
,his_wsdl_id
,HisTransId
,clr_type
,insutype
,ybzhAmount
,ybtcAmount
from hisbill_history
<where>
<if test="payType!=null and payType!=''">
@@ -97,24 +101,25 @@
<insert id="insertAllHisBillOriginalHY" parameterType="java.util.List">
insert into
hisbill_original_hy(VisitzOrg,BizType,PayType,Amount,ZFAmount,YBZHAmount,YBTCAmount,Receipt_no,PatientID,PatientName,TradeTime,HisTime,HisOperNum,PowerTranID,trade_date)
hisbill_original_hy(VisitzOrg,BizType,PayType,Amount,ZFAmount,YBZHAmount,YBTCAmount,Receipt_no,PatientID,PatientName,TradeTime,HisTime,HisOperNum,PowerTranID,trade_date,clr_type,insutype)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.visitzOrg},#{itm.bizType},#{itm.payType},#{itm.amount},#{itm.zfAmount},#{itm.ybzhAmount},#{itm.ybtcAmount},
#{itm.receiptNO},#{itm.patientID},#{itm.patientName},#{itm.tradeTime},#{itm.hisTime},#{itm.hisOperNum},#{itm.powerTranID},#{itm.trade_date}
#{itm.receiptNO},#{itm.patientID},#{itm.patientName},#{itm.tradeTime},#{itm.hisTime},#{itm.hisOperNum},#{itm.powerTranID},#{itm.trade_date},
#{itm.clrType},#{itm.insutype}
)
</foreach>
</insert>
<insert id="insertAllHisBillHistory" parameterType="java.util.List">
insert into
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId)
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId,clr_type,insutype,ybzhAmount,ybtcAmount)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.payMethod},#{itm.tradingStatus},#{itm.bizType},#{itm.payType},#{itm.tradeTime},#{itm.hisOperCode},#{itm.amount},#{itm.remarks},#{itm.platformTransId},#{itm.patientId}
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId}
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId},#{itm.clrType},#{itm.insutype},#{itm.ybzhAmount},#{itm.ybtcAmount}
)
</foreach>
</insert>
@@ -147,6 +152,10 @@
,trade_date
,his_wsdl_id
,HisTransId
,clr_type
,insutype
,ybzhAmount
,ybtcAmount
from hisbill_history
where trade_date=#{trade_date}
<if test="payType!=null and payType!=''">
@@ -162,7 +171,7 @@
<select id="findHisDetailByTimeAndYSDDH" parameterType="HashMap" resultType="HashMap">
select PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,
PatientId,PatientName,HisTransId
PatientId,PatientName,HisTransId,clr_type,insutype,ybzhAmount,ybtcAmount
from hisbill_history
where trade_date=#{searchTime}
and PlatformTransId = #{c_ysddh}
@@ -177,7 +186,7 @@
</select>
<select id="findHisCashDetail" parameterType="HashMap" resultType="HashMap">
select PayMethod, TradingStatus, BizType, PayType, TradeTime, HisOperCode, Amount, remarks, PlatformTransId, PatientId, PatientName, trade_date, his_wsdl_id, HisTransId
select PayMethod, TradingStatus, BizType, PayType, TradeTime, HisOperCode, Amount, remarks, PlatformTransId, PatientId, PatientName, trade_date, his_wsdl_id, HisTransId, clr_type, insutype, ybzhAmount, ybtcAmount
from hisbill_history
where trade_date=#{trade_date} and PayType='5'
</select>
@@ -200,4 +209,23 @@
</if>
</where>
</select>
<!-- 医保对账按险种和清算类别分组统计不限制PayType -->
<select id="findMedicalInsuranceGroupData" parameterType="HashMap" resultType="HashMap">
select
insutype as INSUTYPE,
clr_type as CLR_TYPE,
count(1) as FIXMEDINS_SETL_CNT,
cast(IFNULL(sum(Amount),0) as decimal(19,2)) as MEDFEE_SUMAMT,
cast(IFNULL(sum(ybtcAmount),0) as decimal(19,2)) as FUND_PAY_SUMAMT,
cast(IFNULL(sum(ybzhAmount),0) as decimal(19,2)) as ACCT_PAY
from hisbill_history
where trade_date = #{trade_date}
and insutype is not null
and insutype != ''
and clr_type is not null
and clr_type != ''
group by insutype, clr_type
order by insutype, clr_type
</select>
</mapper>