168 lines
8.4 KiB
XML
168 lines
8.4 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.czlis.liswork.mapper.LisWorkGermMapper">
|
|
<sql id="selectLabPatVoWSW">
|
|
select jyrq,yq,ybh,jzbz,jgbz,dybz,brly,brdh,brxm,brxb,nl,nldw,ksdh,jymd,yljg,alarmflag,finish,fslx,autojgbz,lstd,shcs,yblx,sqh,yhdh,ch,zjf,CONVERT(varchar(10), DATEDIFF(day, CONVERT(varchar(10),sqsj,110), CONVERT(varchar(10),isnull(dysj,getdate()),110)))+'天' as cp_pyzq from lab_pat
|
|
</sql>
|
|
|
|
<select id="getLabResultMedInfo" resultType="com.czlis.common.core.domain.entity.lis.LabResultMed">
|
|
select a.*,m.ywmc,
|
|
case
|
|
when isnull(a.mic,'')!='' then isnull(c.micref,d.micref)
|
|
when isnull(a.rad,'')!='' then isnull(c.radref,d.radref)
|
|
else '' end as ckz,e.bz as cp_bz from lab_resultmed a
|
|
join xm_info b on b.yq=a.yq and b.xmdh=a.xmdh
|
|
left join xm_med m on m.ywdh=a.ywdh
|
|
left join com_dict e on e.zdlb='germclass' and e.zddh=b.germclass
|
|
left join xm_meddetail c on b.germclass=c.xmdh and c.ywdh=a.ywdh
|
|
left join xm_meddetail d on d.ywzmc = '细菌' and d.yq=a.yq and d.ywdh=a.ywdh
|
|
where a.jyrq = #{jyrq} and a.yq = #{yq}
|
|
<if test="ybh != null and ybh !=''">and a.ybh = #{ybh}</if>
|
|
<if test="xmdh != null and xmdh !=''">and a.xmdh = #{xmdh}</if>
|
|
<if test="xh != null">and a.xh = #{xh}</if>
|
|
<if test="ywdh != null and ywdh != ''">and a.ywdh = #{ywdh}</if>
|
|
</select>
|
|
<select id="getSampleListWSW" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
|
<include refid="selectLabPatVoWSW"></include>
|
|
<where>
|
|
<if test="yq != null and yq !=''">and yq = #{yq}</if>
|
|
<if test="jyrq != null">and jyrq = #{jyrq}</if>
|
|
</where>
|
|
order by yq,jyrq DESC,right(space(20) + ybh,20) DESC
|
|
</select>
|
|
<select id="getSampleListday" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
|
<include refid="selectLabPatVoWSW"></include>
|
|
<where>
|
|
<if test="days != null and days != 0">and jyrq >=CONVERT(varchar(10),getdate() - ${days},120)</if>
|
|
<if test="yq != null and yq !=''">and yq = #{yq}</if>
|
|
</where>
|
|
order by yq,jyrq DESC,right(space(20) + ybh,20) DESC
|
|
</select>
|
|
<select id="getpatjyrq" resultType="Date">
|
|
select max(jyrq) from lab_pat where yq = #{yq} and ybh=#{ybh}
|
|
</select>
|
|
<update id="changepatjyrq" >
|
|
update lab_pat set jyrq = #{jyrq1} where yq = #{yq} and ybh=#{ybh} and jyrq=#{jyrq}
|
|
</update>
|
|
<update id="changeresultjyrq" >
|
|
update lab_result set jyrq = #{jyrq1} where yq = #{yq} and ybh=#{ybh} and jyrq=#{jyrq}
|
|
</update>
|
|
<update id="updatemediumjyrq">
|
|
update lab_germsheet_new set jyrq = #{jyrq1} where yq = #{yq} and ybh=#{ybh} and jyrq=#{jyrq}
|
|
</update>
|
|
<select id="getBactMedium" resultType="com.czlis.common.core.domain.entity.lis.BactMedium">
|
|
SELECT * FROM bact_medium
|
|
<where>
|
|
<if test="mediumno != null and mediumno !=''">and mediumno >=#{mediumno}</if>
|
|
</where>
|
|
</select>
|
|
<select id="getmedium" resultType="com.czlis.liswork.pojo.DTO.MediumDTO">
|
|
SELECT lab_germsheet_new.gsid,
|
|
lab_germsheet_new.jyrq,
|
|
lab_germsheet_new.yq,
|
|
lab_germsheet_new.ybh,
|
|
lab_germsheet_new.mediumno,
|
|
lab_germsheet_new.sheetdate,
|
|
lab_germsheet_new.sheetuser,
|
|
lab_germsheet_new.medium,
|
|
bact_medium.mediumname,
|
|
bact_medium.watchinterval,
|
|
bact_medium.conidtions,
|
|
bact_medium.culturehour,
|
|
bact_medium.comments
|
|
FROM lab_germsheet_new
|
|
left join bact_medium on
|
|
bact_medium.mediumno=lab_germsheet_new.mediumno
|
|
WHERE ( lab_germsheet_new.jyrq = #{jyrq} ) AND
|
|
( lab_germsheet_new.yq = #{yq}) AND
|
|
( lab_germsheet_new.ybh = #{ybh} )
|
|
</select>
|
|
<select id="getmediumno" resultType="String">
|
|
select max(mediumno) from bact_specimen_medium a join lab_reqdetail b on a.req_itemid=b.sqxmdh where specimencode=#{yblx} and b.sqh=#{sqh};
|
|
</select>
|
|
<select id="getmediumnox" resultType="String">
|
|
select max(mediumno) from bact_specimen_medium where specimencode=#{yblx} and req_itemid='-1';
|
|
</select>
|
|
<select id="getBactMediumgroupdet" resultType="com.czlis.common.core.domain.entity.lis.BactMediumgroupdet">
|
|
SELECT * FROM bact_mediumgroupdet WHERE mediumgroupno = #{mediumno}
|
|
</select>
|
|
<insert id="insertmedium" parameterType="com.czlis.common.core.domain.entity.lis.LabGermsheetNew">
|
|
insert into lab_germsheet_new (jyrq, yq,
|
|
ybh, mediumno, sheetdate,
|
|
sheetuser, medium, condtions,
|
|
smear, dyeing, colonyresult,
|
|
colonynum, otherresult)
|
|
values (#{jyrq}, #{yq},
|
|
#{ybh}, #{mediumno}, #{sheetdate},
|
|
#{sheetuser}, #{medium}, #{condtions},
|
|
#{smear}, #{dyeing}, #{colonyresult},
|
|
#{colonynum}, #{otherresult})
|
|
</insert>
|
|
<update id="updatemedium" parameterType="com.czlis.common.core.domain.entity.lis.LabGermsheetNew">
|
|
update lab_germsheet_new
|
|
set jyrq = #{jyrq},
|
|
yq = #{yq},
|
|
ybh = #{ybh},
|
|
mediumno = #{mediumno},
|
|
sheetdate = #{sheetdate},
|
|
sheetuser = #{sheetuser},
|
|
medium = #{medium},
|
|
condtions = #{condtions},
|
|
smear = #{smear},
|
|
dyeing = #{dyeing},
|
|
colonyresult = #{colonyresult},
|
|
colonynum = #{colonynum},
|
|
otherresult = #{otherresult}
|
|
where gsid = #{gsid}
|
|
</update>
|
|
<delete id="deletemedium" parameterType="Long">
|
|
delete from lab_germsheet_new where gsid = #{gsid}
|
|
</delete>
|
|
<delete id="deletemediums" parameterType="Long[]">
|
|
DELETE FROM lab_germsheet_new WHERE gsid IN
|
|
<foreach collection="array" item="gsid" open="(" separator="," close=")">
|
|
#{gsid}
|
|
</foreach>
|
|
</delete>
|
|
<select id="getXmMedDetail" resultType="com.czlis.common.core.domain.entity.lis.XmMedDetail">
|
|
SELECT * FROM xm_meddetail
|
|
where ywzmc = '细菌' and yq = #{yq} and xmdh = #{xmdh}
|
|
<if test="yq != null and yq != ''">and yq = #{yq} </if>
|
|
<if test="xmdh != null and xmdh != ''">and xmdh = #{xmdh}</if>
|
|
<if test="ywdh != null and ywdh != ''">and ywdh = #{ywdh}</if>
|
|
</select>
|
|
<select id="getXmMedDetailNew" resultType="com.czlis.common.core.domain.entity.lis.XmMedDetail">
|
|
SELECT xm_meddetail.*
|
|
FROM xm_meddetail join xm_info on xm_info.germclass=xm_meddetail.xmdh
|
|
where xm_meddetail.yq = '_med_'
|
|
<if test="yq != null and yq != ''">and xm_info.yq = #{yq} </if>
|
|
<if test="xmdh != null and xmdh != ''">and xm_info.xmdh = #{xmdh}</if>
|
|
<if test="ywdh != null and ywdh != ''">and xm_meddetail.ywdh = #{ywdh}</if>
|
|
</select>
|
|
<select id="getXmMedDetailBZ" resultType="String">
|
|
SELECT com_dict.bz from xm_info join com_dict
|
|
on zdlb = 'germclass' AND zddh =xm_info.germclass
|
|
<where>
|
|
<if test="yq != null and yq != ''">and xm_info.yq = #{yq} </if>
|
|
<if test="xmdh != null and xmdh != ''">and xm_info.xmdh = #{xmdh}</if>
|
|
</where>
|
|
</select>
|
|
<select id="getmedgrouplist" resultType="map">
|
|
SELECT distinct ywzmc FROM xm_medgroup ORDER BY ywzmc
|
|
</select>
|
|
<select id="getmedgroup" resultType="com.czlis.common.core.domain.entity.lis.XmMedgroup">
|
|
select xm_medgroup.*,xm_med.ywmc from xm_medgroup join xm_med on xm_med.ywdh=xm_medgroup.ywdh
|
|
<where>
|
|
<if test="ywzmc != null and ywzmc != ''"> and xm_medgroup.ywzmc = #{ywzmc}</if>
|
|
</where>
|
|
order by xm_medgroup.xh
|
|
</select>
|
|
<select id="getGermTextDict" resultType="com.czlis.common.core.domain.entity.lis.XmTextResult">
|
|
select * from xm_textresult where yq = '_text_' AND xmdh = 'text'
|
|
order by xh
|
|
</select>
|
|
<select id="getLabPat" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
|
select top 1 * from lab_pat where yq = #{yq} and ybh = #{ybh}
|
|
</select>
|
|
</mapper> |