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

@@ -7,6 +7,7 @@
<result column="QUARTZ_GROUP" property="quartzGroup" jdbcType="VARCHAR" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="QUARTZ_CLASS" property="quartzClass" jdbcType="VARCHAR" />
<result column="QUARTZ_TYPE" property="quartzType" jdbcType="VARCHAR" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="CREATEUSERID" property="createUserId" jdbcType="VARCHAR" />
<result column="EXPRESSION" property="expression" jdbcType="VARCHAR" />
@@ -16,12 +17,15 @@
<!-- 查询所有任务 -->
<select id="findAll" parameterType="HashMap" resultMap="BaseResultMap">
select bqc.CONFIGID,bqc.QUARTZ_NAME,bqc.QUARTZ_GROUP,bqc.STATUS,bqc.QUARTZ_CLASS,bqc.REMARK,bqc.CREATEUSERID,bqc.EXPRESSION,bqc.CREATE_TIME from base_quartz_config bqc
select bqc.CONFIGID,bqc.QUARTZ_NAME,bqc.QUARTZ_GROUP,bqc.STATUS,bqc.QUARTZ_CLASS,bqc.QUARTZ_TYPE,bqc.REMARK,bqc.CREATEUSERID,bqc.EXPRESSION,bqc.CREATE_TIME from base_quartz_config bqc
<where>
<if test="part_name!=null and part_name!=''">
<if test="quartz_name!=null and quartz_name!=''">
and bqc.QUARTZ_NAME like concat('%',concat(#{quartz_name},'%'))
</if>
<if test="part_type!=null and part_type!=''">
<if test="quartz_type!=null and quartz_type!=''">
and bqc.QUARTZ_TYPE = #{quartz_type}
</if>
<if test="configId!=null and configId!=''">
and bqc.CONFIGID = #{configId}
</if>
</where>
@@ -30,14 +34,14 @@
<!-- 根据id查询定时任务 -->
<select id="findEntityById" resultMap="BaseResultMap">
select CONFIGID,QUARTZ_NAME,QUARTZ_GROUP,STATUS,QUARTZ_CLASS,REMARK,CREATEUSERID,EXPRESSION,CREATE_TIME from base_quartz_config
select CONFIGID,QUARTZ_NAME,QUARTZ_GROUP,STATUS,QUARTZ_CLASS,QUARTZ_TYPE,REMARK,CREATEUSERID,EXPRESSION,CREATE_TIME from base_quartz_config
where CONFIGID=#{id}
</select>
<!-- 更新定时任务 -->
<update id="updateQuartzConfigByEntity" parameterType="com.saye.hospitalgd.model.BaseQuartzConfigEntity">
update base_quartz_config set QUARTZ_NAME=#{quartzName},QUARTZ_GROUP=#{quartzGroup},STATUS=#{status},QUARTZ_CLASS=#{quartzClass}
,REMARK=#{remark},CREATEUSERID=#{createUserId},EXPRESSION=#{expression}
,QUARTZ_TYPE=#{quartzType},REMARK=#{remark},CREATEUSERID=#{createUserId},EXPRESSION=#{expression}
where CONFIGID=#{configId}
</update>
@@ -53,14 +57,14 @@
<!-- 添加定时任务 -->
<insert id="addQuartz" parameterType="hashMap">
insert into base_quartz_config(configid, quartz_name, status, quartz_class, remark, createuserid, expression, create_time)
values(#{id},#{quartzName},#{status}, #{quartz_class}, #{remark}, #{createuserid}, #{expression}, #{create_time} )
insert into base_quartz_config(configid, quartz_name, status, quartz_class, quartz_type, remark, createuserid, expression, create_time)
values(#{id},#{quartzName},#{status}, #{quartz_class}, #{quartz_type}, #{remark}, #{createuserid}, #{expression}, #{create_time} )
</insert>
<!-- 更新定时任务信息 -->
<update id="updateQuartzConfigById">
update base_quartz_config set QUARTZ_NAME=#{quartzName},QUARTZ_GROUP=#{quartzGroup},QUARTZ_CLASS=#{quartzClass}
,REMARK=#{remark},EXPRESSION=#{expression}
,QUARTZ_TYPE=#{quartzType},REMARK=#{remark},EXPRESSION=#{expression}
where CONFIGID=#{configId}
</update>

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>

View File

@@ -27,6 +27,9 @@
<if test="military_code != null and military_code != ''">
and PayType != #{military_code}
</if>
<if test="medical_insurance_code != null and medical_insurance_code != ''">
and PayType != #{medical_insurance_code}
</if>
</select>
<select id="findHisDetailByParam" parameterType="HashMap" resultType="HashMap">

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.saye.hospitalgd.mapper.MedicalInsuranceReconciliationMapper">
<!-- ResultMap for proper field mapping -->
<resultMap id="MedicalInsuranceResultMap" type="HashMap">
<result column="id" property="id" jdbcType="VARCHAR"/>
<result column="trade_date" property="trade_date" jdbcType="VARCHAR"/>
<result column="insutype" property="insutype" jdbcType="VARCHAR"/>
<result column="clr_type" property="clr_type" jdbcType="VARCHAR"/>
<result column="medfee_sumamt" property="medfee_sumamt" jdbcType="DECIMAL"/>
<result column="fund_pay_sumamt" property="fund_pay_sumamt" jdbcType="DECIMAL"/>
<result column="acct_pay" property="acct_pay" jdbcType="DECIMAL"/>
<result column="fixmedins_setl_cnt" property="fixmedins_setl_cnt" jdbcType="INTEGER"/>
<result column="stmt_rslt" property="stmt_rslt" jdbcType="VARCHAR"/>
<result column="stmt_rslt_dscr" property="stmt_rslt_dscr" jdbcType="VARCHAR"/>
<result column="api_result" property="api_result" jdbcType="VARCHAR"/>
<result column="create_time" property="create_time" jdbcType="VARCHAR"/>
<result column="modify_time" property="modify_time" jdbcType="VARCHAR"/>
</resultMap>
<!-- 插入医保对账结果 -->
<insert id="insertMedicalInsuranceReconciliationResult" parameterType="HashMap">
insert into medical_insurance_reconciliation_result (
id, trade_date, insutype, clr_type,
medfee_sumamt, fund_pay_sumamt, acct_pay, fixmedins_setl_cnt,
stmt_rslt, stmt_rslt_dscr, api_result,
create_time, modify_time
) values (
#{id}, #{trade_date}, #{insutype}, #{clr_type},
#{medfee_sumamt}, #{fund_pay_sumamt}, #{acct_pay}, #{fixmedins_setl_cnt},
#{stmt_rslt}, #{stmt_rslt_dscr}, #{api_result},
#{create_time}, #{modify_time}
)
</insert>
<!-- 批量插入医保对账结果 -->
<insert id="insertMedicalInsuranceReconciliationResultBatch" parameterType="java.util.List">
insert into medical_insurance_reconciliation_result (
id, trade_date, insutype, clr_type,
medfee_sumamt, fund_pay_sumamt, acct_pay, fixmedins_setl_cnt,
stmt_rslt, stmt_rslt_dscr, api_result,
create_time, modify_time
) values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.id}, #{itm.trade_date}, #{itm.insutype}, #{itm.clr_type},
#{itm.medfee_sumamt}, #{itm.fund_pay_sumamt}, #{itm.acct_pay}, #{itm.fixmedins_setl_cnt},
#{itm.stmt_rslt}, #{itm.stmt_rslt_dscr}, #{itm.api_result},
#{itm.create_time}, #{itm.modify_time}
)
</foreach>
</insert>
<!-- 查询医保对账结果 -->
<select id="findMedicalInsuranceReconciliationResult" parameterType="HashMap" resultMap="MedicalInsuranceResultMap">
select
id,
trade_date,
insutype,
clr_type,
medfee_sumamt,
fund_pay_sumamt,
acct_pay,
fixmedins_setl_cnt,
stmt_rslt,
stmt_rslt_dscr,
api_result,
DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') as create_time,
DATE_FORMAT(modify_time, '%Y-%m-%d %H:%i:%s') as modify_time
from medical_insurance_reconciliation_result
<where>
<if test="trade_date != null and trade_date != ''">
and trade_date = #{trade_date}
</if>
<if test="startDate != null and startDate != ''">
and trade_date &gt;= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and trade_date &lt;= #{endDate}
</if>
<if test="insutype != null and insutype != ''">
and insutype = #{insutype}
</if>
<if test="clr_type != null and clr_type != ''">
and clr_type = #{clr_type}
</if>
<if test="clrType != null and clrType != ''">
and clr_type = #{clrType}
</if>
<if test="stmt_rslt != null and stmt_rslt != ''">
and stmt_rslt = #{stmt_rslt}
</if>
<if test="stmtRslt != null and stmtRslt != ''">
and stmt_rslt = #{stmtRslt}
</if>
</where>
order by create_time desc, trade_date desc, insutype, clr_type
</select>
<!-- 删除医保对账结果 -->
<delete id="deleteMedicalInsuranceReconciliationResult" parameterType="HashMap">
delete from medical_insurance_reconciliation_result
where trade_date = #{trade_date}
</delete>
</mapper>