lis8.0/transitPF/src/main/resources/mapper/RegTransitSampleMapper.xml

235 lines
16 KiB
XML
Raw Normal View History

2025-11-10 15:58:11 +08:00
<?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">
2025-11-11 09:39:08 +08:00
<mapper namespace="com.czlis.transitPF.mapper.RegTransitSampleMapper">
2025-11-10 15:58:11 +08:00
2025-11-11 09:39:08 +08:00
<select id="getRegTransitSample" resultType="com.czlis.transitPF.pojo.RegTransitSample">
select * from Reg_TransitSample
2025-11-10 15:58:11 +08:00
<where>
<if test="Barcode != null and Barcode !=''">and Barcode = #{Barcode}</if>
2025-11-11 18:29:30 +08:00
<if test="SrcHospName != null and SrcHospName !=''">and SrcHospName like '%'+#{SrcHospName}+'%' </if>
2025-11-13 16:01:42 +08:00
<if test="DstHospName != null and DstHospName !=''">and DstHospName like '%'+#{DstHospName}+'%' </if>
<if test="DstHospCode != null and DstHospCode !=''">and DstHospCode like '%'+#{DstHospCode}+'%' </if>
<if test="SrcHospCode != null and SrcHospCode !=''">and SrcHospCode like '%'+#{SrcHospCode}+'%' </if>
2025-11-11 18:29:30 +08:00
<if test="PatName != null and PatName !=''">and PatName like '%'+#{PatName}+'%'</if>
<if test="checkPUR != null and checkPUR !=''">and checkPUR like '%'+#{checkPUR}+'%'</if>
<if test="Status != null and Status !=''">and Status = #{Status}</if>
<if test="AffirmUserName != null and AffirmUserName !=''">and AffirmUserName like '%'+#{AffirmUserName}+'%'</if>
<if test="SignInUserName != null and SignInUserName !=''">and SignInUserName like '%'+#{SignInUserName}+'%'</if>
<if test="DateType == '登记时间'">and (OrderTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '采样时间'">and (AffirmTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '送出时间'">and (SendPackTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if>
2025-11-10 15:58:11 +08:00
</where>
</select>
2025-11-11 09:39:08 +08:00
<select id="getRegTransitSampleDetail" resultType="com.czlis.transitPF.pojo.RegTransitSampleDetail">
select * from Reg_TransitSample_detail
2025-11-10 15:58:11 +08:00
<where>
<if test="Barcode != null and Barcode !=''">and Barcode = #{Barcode}</if>
</where>
</select>
2025-11-11 18:29:30 +08:00
<insert id="addRegTransitSample">
insert into reg_TransitSample(
<if test="PatId != null and PatId != ''">PatId,</if>
<if test="PatCardType != null and PatCardType != ''">PatCardType,</if>
<if test="PatCardNo != null and PatCardNo != ''">PatCardNo,</if>
<if test="PatType != null and PatType != ''">PatType,</if>
<if test="RegNo != null and RegNo != ''">RegNo,</if>
<if test="PatName != null and PatName != ''">PatName,</if>
<if test="PatSex != null and PatSex != ''">PatSex,</if>
<if test="PatAge != null and PatAge != ''">PatAge,</if>
<if test="AgeUnit != null and AgeUnit != ''">AgeUnit,</if>
<if test="PatAgeShow != null and PatAgeShow != ''">PatAgeShow,</if>
<if test="PatBirthday != null and PatBirthday != ''">PatBirthday,</if>
<if test="PatIdentity != null and PatIdentity != ''">PatIdentity,</if>
<if test="Phone != null and Phone != ''">Phone,</if>
<if test="Address != null and Address != ''">Address,</if>
<if test="PatFeeType != null and PatFeeType != ''">PatFeeType,</if>
<if test="DepartCode != null and DepartCode != ''">DepartCode,</if>
<if test="DepartName != null and DepartName != ''">DepartName,</if>
<if test="AreaCode != null and AreaCode != ''">AreaCode,</if>
<if test="AreaName != null and AreaName != ''">AreaName,</if>
<if test="PatBed != null and PatBed != ''">PatBed,</if>
<if test="DiagnosisCode != null and DiagnosisCode != ''">DiagnosisCode,</if>
<if test="DiagnosisName != null and DiagnosisName != ''">DiagnosisName,</if>
<if test="OrderPatId != null and OrderPatId != ''">OrderPatId,</if>
<if test="OrderUserCode != null and OrderUserCode != ''">OrderUserCode,</if>
<if test="OrderUserName != null and OrderUserName != ''">OrderUserName,</if>
<if test="OrderTime != null">OrderTime,</if>
<if test="SrcHospCode != null and SrcHospCode != ''">SrcHospCode,</if>
<if test="SrcHospName != null and SrcHospName != ''">SrcHospName,</if>
<if test="Barcode != null and Barcode != ''">Barcode,</if>
<if test="SrcHospBarcode != null and SrcHospBarcode != ''">SrcHospBarcode,</if>
<if test="TubeCode != null and TubeCode != ''">TubeCode,</if>
<if test="TubeName != null and TubeName != ''">TubeName,</if>
<if test="tubeColor != null and tubeColor != ''">tubeColor,</if>
<if test="SampleTypeCode != null and SampleTypeCode != ''">SampleTypeCode,</if>
<if test="SampleTypeName != null and SampleTypeName != ''">SampleTypeName,</if>
<if test="BodyCode != null and BodyCode != ''">BodyCode,</if>
<if test="BodyName != null and BodyName != ''">BodyName,</if>
<if test="IsER != null and IsER != ''">IsER,</if>
<if test="Status != null and Status != ''">Status,</if>
<if test="AffirmTime != null">AffirmTime,</if>
<if test="AffirmUserCode != null and AffirmUserCode != ''">AffirmUserCode,</if>
<if test="AffirmUserName != null and AffirmUserName != ''">AffirmUserName,</if>
<if test="SendPackTime != null ">SendPackTime,</if>
<if test="SendUserCode != null and SendUserCode != ''">SendUserCode,</if>
<if test="SendUserName != null and SendUserName != ''">SendUserName,</if>
<if test="SignInTime != null ">SignInTime,</if>
<if test="SignInUserCode != null and SignInUserCode != ''">SignInUserCode,</if>
<if test="SignInUserName != null and SignInUserName != ''">SignInUserName,</if>
<if test="DstHospCode != null and DstHospCode != ''">DstHospCode,</if>
<if test="DstHospName != null and DstHospName != ''">DstHospName,</if>
<if test="ExpressComCode != null and ExpressComCode != ''">ExpressComCode,</if>
<if test="ExpressComName != null and ExpressComName != ''">ExpressComName,</if>
<if test="PackSerial != null and PackSerial != ''">PackSerial,</if>
<if test="ExpressNum != null and ExpressNum != ''">ExpressNum,</if>
create_by,create_time,update_by,update_time
)values(
<if test="PatId != null and PatId != ''">#{PatId},</if>
<if test="PatCardType != null and PatCardType != ''">#{PatCardType},</if>
<if test="PatCardNo != null and PatCardNo != ''">#{PatCardNo},</if>
<if test="PatType != null and PatType != ''">#{PatType},</if>
<if test="RegNo != null and RegNo != ''">#{RegNo},</if>
<if test="PatName != null and PatName != ''">#{PatName},</if>
<if test="PatSex != null and PatSex != ''">#{PatSex},</if>
<if test="PatAge != null and PatAge != ''">#{PatAge},</if>
<if test="AgeUnit != null and AgeUnit != ''">#{AgeUnit},</if>
<if test="PatAgeShow != null and PatAgeShow != ''">#{PatAgeShow},</if>
<if test="PatBirthday != null and PatBirthday != ''">#{PatBirthday},</if>
<if test="PatIdentity != null and PatIdentity != ''">#{PatIdentity},</if>
<if test="Phone != null and Phone != ''">#{Phone},</if>
<if test="Address != null and Address != ''">#{Address},</if>
<if test="PatFeeType != null and PatFeeType != ''">#{PatFeeType},</if>
<if test="DepartCode != null and DepartCode != ''">#{DepartCode},</if>
<if test="DepartName != null and DepartName != ''">#{DepartName},</if>
<if test="AreaCode != null and AreaCode != ''">#{AreaCode},</if>
<if test="AreaName != null and AreaName != ''">#{AreaName},</if>
<if test="PatBed != null and PatBed != ''">#{PatBed},</if>
<if test="DiagnosisCode != null and DiagnosisCode != ''">#{DiagnosisCode},</if>
<if test="DiagnosisName != null and DiagnosisName != ''">#{DiagnosisName},</if>
<if test="OrderPatId != null and OrderPatId != ''">#{OrderPatId},</if>
<if test="OrderUserCode != null and OrderUserCode != ''">#{OrderUserCode},</if>
<if test="OrderUserName != null and OrderUserName != ''">#{OrderUserName},</if>
<if test="OrderTime != null">#{OrderTime},</if>
<if test="SrcHospCode != null and SrcHospCode != ''">#{SrcHospCode},</if>
<if test="SrcHospName != null and SrcHospName != ''">#{SrcHospName},</if>
<if test="Barcode != null and Barcode != ''">#{Barcode},</if>
<if test="SrcHospBarcode != null and SrcHospBarcode != ''">#{SrcHospBarcode},</if>
<if test="TubeCode != null and TubeCode != ''">#{TubeCode},</if>
<if test="TubeName != null and TubeName != ''">#{TubeName},</if>
<if test="tubeColor != null and tubeColor != ''">#{tubeColor},</if>
<if test="SampleTypeCode != null and SampleTypeCode != ''">#{SampleTypeCode},</if>
<if test="SampleTypeName != null and SampleTypeName != ''">#{SampleTypeName},</if>
<if test="BodyCode != null and BodyCode != ''">#{BodyCode},</if>
<if test="BodyName != null and BodyName != ''">#{BodyName},</if>
<if test="IsER != null and IsER != ''">#{IsER},</if>
<if test="Status != null and Status != ''">#{Status},</if>
<if test="AffirmTime != null">#{AffirmTime},</if>
<if test="AffirmUserCode != null and AffirmUserCode != ''">#{AffirmUserCode},</if>
<if test="AffirmUserName != null and AffirmUserName != ''">#{AffirmUserName},</if>
<if test="SendPackTime != null ">#{SendPackTime},</if>
<if test="SendUserCode != null and SendUserCode != ''">#{SendUserCode},</if>
<if test="SendUserName != null and SendUserName != ''">#{SendUserName},</if>
<if test="SignInTime != null ">#{SignInTime},</if>
<if test="SignInUserCode != null and SignInUserCode != ''">#{SignInUserCode},</if>
<if test="SignInUserName != null and SignInUserName != ''">#{SignInUserName},</if>
<if test="DstHospCode != null and DstHospCode != ''">#{DstHospCode},</if>
<if test="DstHospName != null and DstHospName != ''">#{DstHospName},</if>
<if test="ExpressComCode != null and ExpressComCode != ''">#{ExpressComCode},</if>
<if test="ExpressComName != null and ExpressComName != ''">#{ExpressComName},</if>
<if test="PackSerial != null and PackSerial != ''">#{PackSerial},</if>
<if test="ExpressNum != null and ExpressNum != ''">#{ExpressNum},</if>
#{create_by},#{create_time},#{update_by},#{update_time}
)
</insert>
<insert id="addRegTransitSampleDetail">
insert into reg_TransitSample_detail(
<if test="OrderItemCode != null and OrderItemCode != ''">OrderItemCode,</if>
<if test="OrderItemName != null and OrderItemName != ''">OrderItemName,</if>
<if test="GroupItemCode != null and GroupItemCode != ''">GroupItemCode,</if>
<if test="GroupItemName != null and GroupItemName != ''">GroupItemName,</if>
<if test="SrcOrderItemCode != null and SrcOrderItemCode != ''">SrcOrderItemCode,</if>
<if test="SrcOrderItemName != null and SrcOrderItemName != ''">SrcOrderItemName,</if>
<if test="FeeCode != null and FeeCode != ''">FeeCode,</if>
<if test="FeeName != null and FeeName != ''">FeeName,</if>
<if test="Cost != null">Cost,</if>
<if test="Status != null and Status != ''">Status,</if>
Barcode,OrderItemSerial,create_by,create_time,update_by,update_time
)values(
<if test="OrderItemCode != null and OrderItemCode != ''">#{OrderItemCode},</if>
<if test="OrderItemName != null and OrderItemName != ''">#{OrderItemName},</if>
<if test="GroupItemCode != null and GroupItemCode != ''">#{GroupItemCode},</if>
<if test="GroupItemName != null and GroupItemName != ''">#{GroupItemName},</if>
<if test="SrcOrderItemCode != null and SrcOrderItemCode != ''">#{SrcOrderItemCode},</if>
<if test="SrcOrderItemName != null and SrcOrderItemName != ''">#{SrcOrderItemName},</if>
<if test="FeeCode != null and FeeCode != ''">#{FeeCode},</if>
<if test="FeeName != null and FeeName != ''">#{FeeName},</if>
<if test="Cost != null">#{Cost},</if>
<if test="Status != null and Status != ''">#{Status},</if>
#{Barcode},#{OrderItemSerial},#{create_by},#{create_time},#{update_by},#{update_time}
)
</insert>
<delete id="delRegTransitSample">
delete from reg_TransitSample where Barcode = #{barcode}
</delete>
<delete id="delRegTransitSampleDetail">
delete from reg_TransitSample_detail where Barcode = #{barcode}
</delete>
<update id="updateTest">
update reg_TransitSample set checkPUR = #{checkPUR} WHERE Barcode = #{barcode}
</update>
2025-11-13 16:01:42 +08:00
<select id="getRegTransitSampleSign" resultType="com.czlis.transitPF.pojo.RegTransitSample">
<![CDATA[select * from Reg_TransitSample where Status in (select dict_code from reg_dict where dict_type = 'ZT' AND CAST(dict_code AS INT) < 50)]]>
<if test="SrcHospCode != null and SrcHospCode != ''"> and SrcHospCode = #{SrcHospCode}</if>
<if test="DstHospCode != null and DstHospCode != ''"> and DstHospCode = #{DstHospCode}</if>
<if test="Status != null and Status != ''"> and Status = #{Status}</if>
<if test="Barcode != null and Barcode != ''"> and Barcode = #{Barcode}</if>
<if test="PatName != null and PatName != ''"> and PatName like '%'+#{PatName}+'%'</if>
<if test="DateType == '登记时间'">and (OrderTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '采样时间'">and (AffirmTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '送出时间'">and (SendPackTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if>
</select>
<update id="updateRegTransitSample">
update reg_TransitSample
<set>
<if test="Status != null and Status != ''">Status = #{Status},</if>
<if test="BackReasons != null and BackReasons != ''">BackReasons = #{BackReasons},</if>
<if test="SignInTime != null">SignInTime = #{SignInTime},</if>
<if test="SignInUserCode != null and SignInUserCode != ''">SignInUserCode = #{SignInUserCode},</if>
<if test="SignInUserName != null and SignInUserName != ''">SignInUserName = #{SignInUserName},</if>
<if test="DstHospCode != null and DstHospCode != ''">DstHospCode = #{DstHospCode},</if>
<if test="DstHospName != null and DstHospName != ''">DstHospName = #{DstHospName},</if>
<if test="BackUserCode != null and BackUserCode != ''">BackUserCode = #{BackUserCode},</if>
<if test="BackUserName != null and BackUserName != ''">BackUserName = #{BackUserName},</if>
<if test="BackTime != null">BackTime = #{BackTime},</if>
update_by = #{update_by},update_time = #{update_time}
</set>
where barcode = #{barcode}
</update>
<select id="getRegTransitSampleSignBack">
<![CDATA[select * from Reg_TransitSample where Status in (select dict_code from reg_dict where dict_type = 'ZT' AND dict_code = '100')]]>
<if test="SrcHospCode != null and SrcHospCode != ''"> and SrcHospCode = #{SrcHospCode}</if>
<if test="DstHospCode != null and DstHospCode != ''"> and DstHospCode = #{DstHospCode}</if>
<if test="Status != null and Status != ''"> and Status = #{Status}</if>
<if test="Barcode != null and Barcode != ''"> and Barcode = #{Barcode}</if>
<if test="PatName != null and PatName != ''"> and PatName = #{PatName}</if>
<if test="DateType == '登记时间'">and (OrderTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '采样时间'">and (AffirmTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '送出时间'">and (SendPackTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if>
</select>
2025-11-10 15:58:11 +08:00
</mapper>