412 lines
13 KiB
XML
Raw Normal View History

2025-07-04 00:22:41 +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">
<mapper namespace="com.czlis.interfaceCommon.mapper.LabResultMapper">
2025-08-07 10:50:59 +08:00
<select id="getLabResult" parameterType="com.czlis.common.core.domain.entity.lis.LabResult" resultType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
select *
from lab_result
<where>
<if test="jyrq != null ">
and jyrq = #{jyrq}
</if>
<if test="yq != null and yq != ''">
and yq = #{yq}
</if>
<if test="ybh != null and ybh != ''">
and ybh = #{ybh}
</if>
<if test="xmdh != null and xmdh != ''">
and xmdh = #{xmdh}
</if>
</where>
</select>
2025-09-19 22:50:07 +08:00
2025-08-07 10:50:59 +08:00
<select id="getLabResultList" parameterType="com.czlis.common.core.domain.entity.lis.LabResult" resultType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
select
lab_result.jyrq, lab_result.yq, lab_result.ybh, lab_result.xmdh, wyh, csjg, od, cutoff, lab_result.jgbz, bz1, bz2, yhdh, instrid, operdt,
2025-08-15 19:57:36 +08:00
operna, refs, flag, lab_result.dw, result_flag, alarm_flag, redo_flag, sqxmdh, redo_text,xm_info.xmmc,xm_info.ygzq,xm_info.ygzd
2025-09-05 19:39:38 +08:00
,textresult,xm_info.xsws
2025-07-04 00:22:41 +08:00
from lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh
<where>
<if test="jyrq != null ">
and lab_result.jyrq = #{jyrq}
</if>
<if test="yq != null and yq != ''">
and lab_result.yq = #{yq}
</if>
<if test="ybh != null and ybh != ''">
and lab_result.ybh = #{ybh}
</if>
</where> ORDER BY xm_info.dyxh
</select>
2025-09-02 17:47:53 +08:00
<select id="getLabResultWithSql" resultType="com.czlis.common.core.domain.entity.lis.LabResult">
select
lab_result.jyrq, lab_result.yq, lab_result.ybh, lab_result.xmdh, wyh, csjg, od, cutoff, lab_result.jgbz, bz1, bz2, yhdh, instrid, operdt,
operna, refs, flag, lab_result.dw, result_flag, alarm_flag, redo_flag, sqxmdh, redo_text,xm_info.xmmc,xm_info.ygzq,xm_info.ygzd
2025-09-05 19:39:38 +08:00
,textresult,xm_info.xsws
2025-09-02 17:47:53 +08:00
from lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh
<where>
<if test="jyrq != null ">
and lab_result.jyrq = #{jyrq}
</if>
<if test="yq != null and yq != ''">
and lab_result.yq = #{yq}
</if>
<if test="ybh != null and ybh != ''">
and lab_result.ybh = #{ybh}
</if>
</where> ${wheresql}
</select>
2025-08-07 10:50:59 +08:00
<delete id="delLabResult" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
delete from lab_result
2025-11-04 12:21:19 +08:00
<where>
<if test="jyrq != null ">
and lab_result.jyrq = #{jyrq}
</if>
<if test="yq != null and yq != ''">
and lab_result.yq = #{yq}
</if>
<if test="ybh != null and ybh != ''">
and lab_result.ybh = #{ybh}
</if>
<if test="xmdh != null and xmdh != ''">
and lab_result.xmdh = #{xmdh}
</if>
<if test="csjg != null and csjg != ''">
and lab_result.csjg = #{csjg}
</if>
</where>
2025-07-04 00:22:41 +08:00
</delete>
2025-10-17 18:25:22 +08:00
<delete id="delLabResultAll" >
delete from lab_result
where jyrq = #{jyrq}
and yq = #{yq,jdbcType=CHAR}
and ybh = #{ybh,jdbcType=VARCHAR}
</delete>
2025-08-18 19:12:19 +08:00
<delete id="delNullLabResult" >
delete from lab_result
where jyrq = #{jyrq}
and yq = #{yq,jdbcType=CHAR}
and ybh = #{ybh,jdbcType=VARCHAR}
and (rtrim(csjg) ='' or csjg is null)
</delete>
2025-08-07 10:50:59 +08:00
<insert id="insertLabResult" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
insert into lab_result (jyrq, yq, ybh,
xmdh, wyh, csjg, od,
cutoff, jgbz, bz1, bz2,
yhdh, instrid, operdt,
operna, refs, flag,
dw, result_flag, alarm_flag,
redo_flag, sqxmdh, redo_text,
bz3, textresult)
values (#{jyrq}, #{yq,jdbcType=CHAR}, #{ybh,jdbcType=VARCHAR},
#{xmdh,jdbcType=VARCHAR}, #{wyh,jdbcType=VARCHAR}, #{csjg,jdbcType=VARCHAR}, #{od,jdbcType=VARCHAR},
#{cutoff,jdbcType=VARCHAR}, #{jgbz,jdbcType=CHAR}, #{bz1,jdbcType=VARCHAR}, #{bz2,jdbcType=VARCHAR},
#{yhdh,jdbcType=VARCHAR}, #{instrid,jdbcType=INTEGER}, #{operdt,jdbcType=TIMESTAMP},
#{operna,jdbcType=VARCHAR}, #{refs,jdbcType=VARCHAR}, #{flag,jdbcType=VARCHAR},
2025-09-11 18:29:26 +08:00
#{dw,jdbcType=VARCHAR}, #{result_flag,jdbcType=CHAR}, #{alarm_flag,jdbcType=CHAR},
#{redo_flag,jdbcType=CHAR}, #{sqxmdh,jdbcType=VARCHAR}, #{redo_text,jdbcType=VARCHAR},
2025-07-04 00:22:41 +08:00
#{bz3,jdbcType=VARCHAR}, #{textresult,jdbcType=LONGVARCHAR})
</insert>
2025-10-23 20:34:07 +08:00
<insert id="insertLabResultByBarcode">
insert into lab_result (jyrq, yq, ybh,xmdh,csjg,refs,dw,sqxmdh)
select distinct #{jyrq},#{yq},#{ybh},a.xmdh,(case ISNULL(a.mrz,'') when '' then '未做' else a.mrz end),
b.dyckz,b.dw ,r.sqh from lab_reqdetail r
join xm_reqitem_vs_reportitem a on r.sqxmdh=a.sqxmdh and isnull(def,'') !='1'
join xm_info b on a.yq=b.yq and a.xmdh=b.xmdh
where r.sqh=#{sqh} and a.yq=#{yq}
and (select count(1) from lab_result x where x.xmdh=a.xmdh and x.jyrq=#{jyrq} and x.yq=#{yq} and x.ybh=#{ybh})=0
</insert>
2025-08-07 10:50:59 +08:00
<insert id="insertSelective" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
insert into lab_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jyrq != null">
jyrq,
</if>
<if test="yq != null">
yq,
</if>
<if test="ybh != null">
ybh,
</if>
<if test="xmdh != null">
xmdh,
</if>
<if test="wyh != null">
wyh,
</if>
<if test="csjg != null">
csjg,
</if>
<if test="od != null">
od,
</if>
<if test="cutoff != null">
cutoff,
</if>
<if test="jgbz != null">
jgbz,
</if>
<if test="bz1 != null">
bz1,
</if>
<if test="bz2 != null">
bz2,
</if>
<if test="yhdh != null">
yhdh,
</if>
<if test="instrid != null">
instrid,
</if>
<if test="operdt != null">
operdt,
</if>
<if test="operna != null">
operna,
</if>
<if test="refs != null">
refs,
</if>
<if test="flag != null">
flag,
</if>
<if test="dw != null">
dw,
</if>
2025-09-11 18:29:26 +08:00
<if test="result_flag != null">
2025-07-04 00:22:41 +08:00
result_flag,
</if>
2025-09-11 18:29:26 +08:00
<if test="alarm_flag != null">
2025-07-04 00:22:41 +08:00
alarm_flag,
</if>
2025-09-11 18:29:26 +08:00
<if test="redo_flag != null">
2025-07-04 00:22:41 +08:00
redo_flag,
</if>
<if test="sqxmdh != null">
sqxmdh,
</if>
2025-09-11 18:29:26 +08:00
<if test="redo_text != null">
2025-07-04 00:22:41 +08:00
redo_text,
</if>
<if test="bz3 != null">
bz3,
</if>
<if test="textresult != null">
textresult,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jyrq != null">
#{jyrq},
</if>
<if test="yq != null">
#{yq,jdbcType=CHAR},
</if>
<if test="ybh != null">
#{ybh,jdbcType=VARCHAR},
</if>
<if test="xmdh != null">
#{xmdh,jdbcType=VARCHAR},
</if>
<if test="wyh != null">
#{wyh,jdbcType=VARCHAR},
</if>
<if test="csjg != null">
#{csjg,jdbcType=VARCHAR},
</if>
<if test="od != null">
#{od,jdbcType=VARCHAR},
</if>
<if test="cutoff != null">
#{cutoff,jdbcType=VARCHAR},
</if>
<if test="jgbz != null">
#{jgbz,jdbcType=CHAR},
</if>
<if test="bz1 != null">
#{bz1,jdbcType=VARCHAR},
</if>
<if test="bz2 != null">
#{bz2,jdbcType=VARCHAR},
</if>
<if test="yhdh != null">
#{yhdh,jdbcType=VARCHAR},
</if>
<if test="instrid != null">
#{instrid,jdbcType=INTEGER},
</if>
<if test="operdt != null">
#{operdt,jdbcType=TIMESTAMP},
</if>
<if test="operna != null">
#{operna,jdbcType=VARCHAR},
</if>
<if test="refs != null">
#{refs,jdbcType=VARCHAR},
</if>
<if test="flag != null">
#{flag,jdbcType=VARCHAR},
</if>
<if test="dw != null">
#{dw,jdbcType=VARCHAR},
</if>
2025-09-11 18:29:26 +08:00
<if test="result_flag != null">
#{result_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
</if>
2025-09-11 18:29:26 +08:00
<if test="alarm_flag != null">
#{alarm_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
</if>
2025-09-11 18:29:26 +08:00
<if test="redo_flag != null">
#{redo_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
</if>
<if test="sqxmdh != null">
#{sqxmdh,jdbcType=VARCHAR},
</if>
2025-09-11 18:29:26 +08:00
<if test="redo_text != null">
#{redo_text,jdbcType=VARCHAR},
2025-07-04 00:22:41 +08:00
</if>
<if test="bz3 != null">
#{bz3,jdbcType=VARCHAR},
</if>
<if test="textresult != null">
#{textresult,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
2025-08-07 10:50:59 +08:00
<update id="updateByPrimaryKeySelective" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
update lab_result
<set>
<if test="wyh != null">
wyh = #{wyh,jdbcType=VARCHAR},
</if>
<if test="csjg != null">
csjg = #{csjg,jdbcType=VARCHAR},
</if>
<if test="od != null">
od = #{od,jdbcType=VARCHAR},
</if>
<if test="cutoff != null">
cutoff = #{cutoff,jdbcType=VARCHAR},
</if>
<if test="jgbz != null">
jgbz = #{jgbz,jdbcType=CHAR},
</if>
<if test="bz1 != null">
bz1 = #{bz1,jdbcType=VARCHAR},
</if>
<if test="bz2 != null">
bz2 = #{bz2,jdbcType=VARCHAR},
</if>
<if test="yhdh != null">
yhdh = #{yhdh,jdbcType=VARCHAR},
</if>
<if test="instrid != null">
instrid = #{instrid,jdbcType=INTEGER},
</if>
<if test="operdt != null">
operdt = #{operdt,jdbcType=TIMESTAMP},
</if>
<if test="operna != null">
operna = #{operna,jdbcType=VARCHAR},
</if>
<if test="refs != null">
refs = #{refs,jdbcType=VARCHAR},
</if>
<if test="flag != null">
flag = #{flag,jdbcType=VARCHAR},
</if>
<if test="dw != null">
dw = #{dw,jdbcType=VARCHAR},
</if>
2025-09-11 18:29:26 +08:00
<if test="result_flag != null">
result_flag = #{result_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
</if>
2025-09-11 18:29:26 +08:00
<if test="alarm_flag != null">
alarm_flag = #{alarm_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
</if>
2025-09-11 18:29:26 +08:00
<if test="redo_flag != null">
redo_flag = #{redo_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
</if>
<if test="sqxmdh != null">
sqxmdh = #{sqxmdh,jdbcType=VARCHAR},
</if>
2025-09-11 18:29:26 +08:00
<if test="redo_text != null">
redo_text = #{redo_text,jdbcType=VARCHAR},
2025-07-04 00:22:41 +08:00
</if>
<if test="bz3 != null">
bz3 = #{bz3,jdbcType=VARCHAR},
</if>
<if test="textresult != null">
textresult = #{textresult,jdbcType=LONGVARCHAR},
</if>
</set>
where jyrq = #{jyrq}
and yq = #{yq,jdbcType=CHAR}
and ybh = #{ybh,jdbcType=VARCHAR}
and xmdh = #{xmdh,jdbcType=VARCHAR}
</update>
2025-08-07 10:50:59 +08:00
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
update lab_result
set wyh = #{wyh,jdbcType=VARCHAR},
csjg = #{csjg,jdbcType=VARCHAR},
od = #{od,jdbcType=VARCHAR},
cutoff = #{cutoff,jdbcType=VARCHAR},
jgbz = #{jgbz,jdbcType=CHAR},
bz1 = #{bz1,jdbcType=VARCHAR},
bz2 = #{bz2,jdbcType=VARCHAR},
yhdh = #{yhdh,jdbcType=VARCHAR},
instrid = #{instrid,jdbcType=INTEGER},
operdt = #{operdt,jdbcType=TIMESTAMP},
operna = #{operna,jdbcType=VARCHAR},
refs = #{refs,jdbcType=VARCHAR},
flag = #{flag,jdbcType=VARCHAR},
dw = #{dw,jdbcType=VARCHAR},
2025-09-11 18:29:26 +08:00
result_flag = #{result_flag,jdbcType=CHAR},
alarm_flag = #{alarm_flag,jdbcType=CHAR},
redo_flag = #{redo_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
sqxmdh = #{sqxmdh,jdbcType=VARCHAR},
2025-09-11 18:29:26 +08:00
redo_text = #{redo_text,jdbcType=VARCHAR},
2025-07-04 00:22:41 +08:00
bz3 = #{bz3,jdbcType=VARCHAR},
textresult = #{textresult,jdbcType=LONGVARCHAR}
where jyrq = #{jyrq}
and yq = #{yq,jdbcType=CHAR}
and ybh = #{ybh,jdbcType=VARCHAR}
and xmdh = #{xmdh,jdbcType=VARCHAR}
</update>
2025-08-07 10:50:59 +08:00
<update id="updateLabResult" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
2025-07-04 00:22:41 +08:00
update lab_result
set wyh = #{wyh,jdbcType=VARCHAR},
csjg = #{csjg,jdbcType=VARCHAR},
od = #{od,jdbcType=VARCHAR},
cutoff = #{cutoff,jdbcType=VARCHAR},
jgbz = #{jgbz,jdbcType=CHAR},
bz1 = #{bz1,jdbcType=VARCHAR},
bz2 = #{bz2,jdbcType=VARCHAR},
yhdh = #{yhdh,jdbcType=VARCHAR},
instrid = #{instrid,jdbcType=INTEGER},
operdt = #{operdt,jdbcType=TIMESTAMP},
operna = #{operna,jdbcType=VARCHAR},
refs = #{refs,jdbcType=VARCHAR},
flag = #{flag,jdbcType=VARCHAR},
dw = #{dw,jdbcType=VARCHAR},
2025-09-11 18:29:26 +08:00
result_flag = #{result_flag,jdbcType=CHAR},
alarm_flag = #{alarm_flag,jdbcType=CHAR},
redo_flag = #{redo_flag,jdbcType=CHAR},
2025-07-04 00:22:41 +08:00
sqxmdh = #{sqxmdh,jdbcType=VARCHAR},
2025-09-11 18:29:26 +08:00
redo_text = #{redo_text,jdbcType=VARCHAR},
2025-07-04 00:22:41 +08:00
bz3 = #{bz3,jdbcType=VARCHAR}
where jyrq = #{jyrq}
and yq = #{yq,jdbcType=CHAR}
and ybh = #{ybh,jdbcType=VARCHAR}
and xmdh = #{xmdh,jdbcType=VARCHAR}
</update>
2025-10-29 17:59:05 +08:00
<update id="updateLabResultText" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
update lab_result
set textresult = #{textresult,jdbcType=LONGVARCHAR}
where jyrq = #{jyrq}
and yq = #{yq,jdbcType=CHAR}
and ybh = #{ybh,jdbcType=VARCHAR}
and xmdh = #{xmdh,jdbcType=VARCHAR}
</update>
2025-07-04 00:22:41 +08:00
</mapper>