Files
dzpt/src/main/resources/mapper/HisbillsHistoryMapper.xml
2025-11-21 10:06:18 +08:00

143 lines
5.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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.HisbillsHistoryMapper">
<insert id="saveHisHistoryData" parameterType="HashMap">
insert into hisbills_history (BRNM,
BRID,
ZFJE,
HISDDH,
GHDDH,
ZFFS,
CZY,
JYRQ,
JYSJ,
XTJSH,
ZDH,
JYKH,
ZFZT)
values (#{name}, #{brid}, #{zfje}, #{hisddh},
#{ghddh}, #{zffs}, #{czy}, #{jyrq}, #{jysj},
#{xtjsh}, #{zdh}, #{jykh}, #{zfzt})
</insert>
<select id="findHisBillsByDate" parameterType="HashMap" resultType="HashMap">
select *
from hisbill_history
where trade_date = #{trade_date}
and PayMethod != '2' <!-- 排除PayMethod=2的记录不参与对账 -->
<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>
<if test="prepayment_code != null and prepayment_code != ''">
and PayType != #{prepayment_code}
</if>
<if test="military_payment_code != null and military_payment_code != ''">
and PayType != #{military_payment_code}
</if>
</select>
<select id="findHisDetailByParam" parameterType="HashMap" resultType="HashMap">
select HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,PatientId as PatientID
,PatientName
,trade_date
from hisbill_history
where trade_date=#{trade_date}
and PayMethod != '2' <!-- 排除PayMethod=2的记录不参与对账 -->
<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>
<if test="prepayment_code != null and prepayment_code != ''">
and PayType != #{prepayment_code}
</if>
<if test="military_payment_code != null and military_payment_code != ''">
and PayType != #{military_payment_code}
</if>
<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>
<if test="orderby_je!=null and orderby_je!=''">
order by Amount desc
</if>
</select>
<delete id="deleteOriginalDataByDate" parameterType="HashMap">
delete
from hisbills_original
where trade_date = #{trade_date}
</delete>
<delete id="deleteHistoryDataByDate" parameterType="HashMap">
delete
from hisbills_history
where trade_date = #{trade_date}
</delete>
<insert id="insertHisBillsOriginalList" parameterType="java.util.List">
insert into
hisbills_original(
HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientName
,source
,trade_date
)
values
<foreach collection="hisBillList" index="index" item="itm" separator=",">
(
#{itm.HisOperCode},#{itm.PayMethod},#{itm.TradingStatus},#{itm.BizType},#{itm.PayType},#{itm.TradeTime},#{itm.Amount},#{itm.PlatformTransId},#{itm.HisTransId},#{itm.patientId},#{itm.PatientName},#{itm.source},#{itm.trade_date}
)
</foreach>
</insert>
<insert id="insertHisbillsHistoryList" parameterType="java.util.List">
insert into
hisbills_history(
HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientName
,source
,trade_date
)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.HisOperCode},#{itm.PayMethod},#{itm.TradingStatus},#{itm.BizType},#{itm.PayType},#{itm.TradeTime},#{itm.Amount},#{itm.PlatformTransId},#{itm.HisTransId},#{itm.patientId},#{itm.PatientName},#{itm.source},#{itm.trade_date}
)
</foreach>
</insert>
</mapper>