187 lines
7.8 KiB
XML
187 lines
7.8 KiB
XML
<?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.HisDetailMapper">
|
|
|
|
<select id="findHisDetail" parameterType="HashMap" resultType="HashMap">
|
|
select HisOperCode
|
|
,PayMethod
|
|
,TradingStatus
|
|
,BizType
|
|
,PayType
|
|
,TradeTime
|
|
,Amount
|
|
,PlatformTransId
|
|
,HisTransId
|
|
,PatientID
|
|
,PatientName
|
|
,trade_date
|
|
,source
|
|
|
|
from hisbills_history
|
|
<where>
|
|
<if test="payType!=null and payType!=''">
|
|
and PayType = #{payType}
|
|
</if>
|
|
<if test="startTime!=null and startTime!=''">
|
|
and trade_date >= #{startTime}
|
|
</if>
|
|
<if test="endTime!=null and endTime!=''">
|
|
and trade_date <= #{endTime}
|
|
</if>
|
|
<if test="likeFiled!=null and likeFiled!=''">
|
|
and PlatformTransId like concat('%',concat(#{likeFiled},'%'))
|
|
</if>
|
|
</where>
|
|
order by trade_date,TradeTime
|
|
</select>
|
|
|
|
<delete id="deleteHisBillOriginalByParam" parameterType="HashMap">
|
|
delete from hisbill_original where trade_date=#{trade_date}
|
|
</delete>
|
|
|
|
<delete id="deleteHisBillOriginalWNByParam" parameterType="HashMap">
|
|
delete from hisbill_original_wn where trade_date=#{trade_date}
|
|
</delete>
|
|
|
|
<delete id="deleteHisBillOriginalHYByParam" parameterType="HashMap">
|
|
delete from hisbill_original_hy where trade_date=#{trade_date}
|
|
</delete>
|
|
|
|
<delete id="deleteHisBillByParam" parameterType="HashMap">
|
|
delete from hisbill_history where trade_date=#{trade_date}
|
|
</delete>
|
|
|
|
<insert id="insertAllHisBillOriginal" parameterType="java.util.List">
|
|
insert into
|
|
hisbill_original(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id)
|
|
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}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<insert id="insertAllHisBillOriginalWN" parameterType="java.util.List">
|
|
insert into hisbill_original_wn(sjlx, hzxm, patid, jyje, tyje, zflsh, jyrq, sftkjl, zffs, jylx, czyh,
|
|
trade_date, his_wsdl_id)
|
|
values
|
|
<foreach collection="list" index="index" item="itm" separator=",">
|
|
(
|
|
#{itm.sjlx},#{itm.hzxm},#{itm.patid},#{itm.jyje},#{itm.tyje},#{itm.zflsh},#{itm.jyrq},
|
|
#{itm.sftkjl},#{itm.zffs},#{itm.jylx},#{itm.czyh},#{itm.trade_date},#{itm.his_wsdl_id}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<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)
|
|
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}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
<!--insert into hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id)
|
|
select a.PayMethod,a.TradingStatus,a.BizType,a.PayType,a.TradeTime,a.HisOperCode,a.Amount,a.remarks,a.PlatformTransId,a.PatientId,a.PatientName,a.trade_date,a.his_wsdl_id
|
|
from hisbill_original a
|
|
where a.trade_date=#{trade_date} 之前的存一份省的又改回来-->
|
|
<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)
|
|
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}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<delete id="deleteTempTable">
|
|
delete from temp_hisbill_history
|
|
</delete>
|
|
|
|
<insert id="findHisDetailToTemp" parameterType="HashMap">
|
|
insert into temp_hisbill_history
|
|
select a.PayMethod,a.TradingStatus,a.BizType,a.PayType,a.TradeTime,a.HisOperCode,a.Amount,a.remarks,a.PlatformTransId,a.PatientId,a.PatientName,a.trade_date,a.his_wsdl_id
|
|
from hisbill_history a
|
|
left join (select PlatformTransId from hisbill_history where TradingStatus='2' and trade_date=#{trade_date}) b
|
|
on a.PlatformTransId=b.PlatformTransId
|
|
where a.trade_date=#{trade_date} and b.PlatformTransId is null and a.PayType!='5'
|
|
</insert>
|
|
|
|
<select id="findHisDetailByParam" parameterType="HashMap" resultType="HashMap">
|
|
select BRNM
|
|
,BRID
|
|
,ZFJE
|
|
,HISDDH
|
|
,GHDDH
|
|
,ZFFS
|
|
,CZY
|
|
,JYRQ
|
|
,JYSJ
|
|
,XTJSH
|
|
,ZDH
|
|
,JYKH
|
|
,ZFZT
|
|
|
|
from hisbills_history
|
|
where trade_date=#{trade_date}
|
|
<if test="h_ghddh!=null and h_ghddh!=''">
|
|
and H_GHDDH=#{h_ghddh}
|
|
</if>
|
|
<if test="zfzt!=null and zfzt!=''">
|
|
and ZFZT=#{zfzt}
|
|
</if>
|
|
|
|
<if test="orderby_je!=null and orderby_je!=''">
|
|
order by ZFJE desc
|
|
</if>
|
|
</select>
|
|
|
|
<select id="findHisDetailByTimeAndYSDDH" parameterType="HashMap" resultType="HashMap">
|
|
select PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,
|
|
PatientId,PatientName
|
|
from hisbill_history
|
|
where trade_date=#{searchTime}
|
|
and PlatformTransId = #{c_ysddh}
|
|
</select>
|
|
|
|
<select id="findHisDetailFirmNumByTime" parameterType="HashMap" resultType="HashMap">
|
|
select his_wsdl_id,count(1) as firmNum
|
|
from hisbill_history
|
|
where TradeTime >= #{startTime}
|
|
and TradeTime <= #{endTime}
|
|
group by his_wsdl_id
|
|
</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
|
|
from hisbill_history
|
|
where trade_date=#{trade_date} and PayType='5'
|
|
</select>
|
|
|
|
<select id="findHisDetailCountData" parameterType="HashMap" resultType="HashMap">
|
|
select count(1) as num,cast(IFNULL(sum(Amount),0) as decimal(19,2)) as money
|
|
from hisbill_history
|
|
<where>
|
|
<if test="payType!=null and payType!=''">
|
|
and PayType = #{payType}
|
|
</if>
|
|
<if test="startTime!=null and startTime!=''">
|
|
and TradeTime >= #{startTime}
|
|
</if>
|
|
<if test="endTime!=null and endTime!=''">
|
|
and TradeTime <= #{endTime}
|
|
</if>
|
|
<if test="likeFiled!=null and likeFiled!=''">
|
|
and PlatformTransId like concat('%',concat(#{likeFiled},'%'))
|
|
</if>
|
|
</where>
|
|
</select>
|
|
</mapper> |