lis8.0/liswork/src/main/resources/mapper/LisWorkPageInfoMapper.xml
2025-11-06 17:53:16 +08:00

207 lines
9.2 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.LisWorkPageInfoMapper">
<select id="getLabGraphList" resultType="com.czlis.common.core.domain.entity.lis.LabGraph">
select * from lab_graph where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
</select>
<select id="getLabOldGraphList" resultType="com.czlis.common.core.domain.entity.lis.LabOldGraph">
select * from lab_oldgraph where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
</select>
<select id="getLabGraphUnitList" resultType="com.czlis.common.core.domain.entity.lis.LabGraphUnit">
select * from lab_graphunit where yq = #{yq}
<if test="txmc != null and txmc != ''"> and txmc = #{txmc}</if>
</select>
<select id="getRedo" resultType="com.czlis.common.core.domain.entity.lis.LabResultRe">
SELECT lab_result_re.*
FROM lab_result_re,xm_info
WHERE ( lab_result_re.yq = xm_info.yq ) and
( lab_result_re.xmdh = xm_info.xmdh ) and
( ( lab_result_re.jyrq = #{jyrq} ) AND
( lab_result_re.yq = #{yq} ) AND
( lab_result_re.ybh =#{ybh} ) )
ORDER BY xm_info.dyxh asc
</select>
<select id="getLabResultRe" resultType="com.czlis.common.core.domain.entity.lis.LabResultRe">
select *
from lab_result_re
<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>
<delete id="deleteRedo" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
delete from lab_result_re
<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>
</delete>
<insert id="insertLabResultRe" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
insert into lab_result_re (jyrq, yq, ybh,xmdh,csjg)
values (#{jyrq},#{yq},#{ybh},#{xmdh},#{csjg})
</insert>
<update id="updateLabResultRe" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
update lab_result_re
<set>
<if test="xmdh != null">
xmdh = #{xmdh},
</if>
<if test="csjg != null">
csjg = #{csjg},
</if>
</set>
<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>
</update>
<select id="getReqdetail" resultType="map">
SELECT lab_reqdetail.sqh , lab_reqdetail.xh , lab_reqdetail.sqxmdh , lab_reqdetail.sqxmmc , lab_reqdetail.sl , lab_reqdetail.dj , lab_reqdetail.zt , lab_reqdetail.jjzt , lab_reqdetail.bz1 , lab_reqdetail.bz2 , lab_reqmain.ksdh , lab_reqmain.sqys , lab_reqmain.sqsj , lab_reqmain.jsys , lab_reqmain.jssj , lab_reqmain.brly , lab_reqmain.brdh , lab_reqmain.brxm , lab_reqdetail.numbk1 , lab_reqdetail.numbk2 FROM lab_reqdetail , lab_reqmain WHERE ( lab_reqdetail.sqh = lab_reqmain.sqh ) and ( ( lab_reqmain.sqh = #{sqh} ) )
</select>
<select id="getOtherinstr" resultType="map">
<![CDATA[
SELECT lab_pat.jyrq,
lab_pat.yq,
lab_pat.ybh,
lab_instr.yqmc,
lab_instr.yljg,(select bz from com_dict where zdlb='HOS' and zddh=lab_instr.yljg) as gjmc,
lab_pat.brdh
FROM lab_pat,
lab_instr
WHERE ( lab_pat.yq = lab_instr.yq )
AND ( lab_pat.brdh = #{brdh} AND lab_pat.brxm = #{brxm} AND lab_pat.jyrq >= #{dayStart} AND lab_pat.jyrq <= #{dayEnd})
]]>
</select>
<select id="getReqInfo" resultType="map">
SELECT isnull(lab_reqmain.sqys,'') as sqys,
lab_reqmain.sqsj,
isnull(lab_reqmain.jsys,'') as jsys,
lab_reqmain.jssj,
isnull(lab_reqmain.zxys,'') as zxys,
lab_reqmain.zxsj,
lab_reqmain.cysj,
isnull(lab_reqmain.cyr,'') as cyr,
isnull(lab_reqmain.bbsjr,'') as bbsjr,
lab_reqmain.bbsjsj,
lab_reqmain.libpos,
isnull(lab_reqmain.inlibtime,'') as inlibtime,
isnull(lab_reqmain.inlibman,'') as inlibman,
isnull(lab_reqmain.outlibtime,'') as outlibtime,
isnull(lab_reqmain.outlibman,'') as outlibman,
lab_reqmain.sjsj,
isnull(lab_reqmain.phone,'') as phone,
isnull(lab_reqmain.phone1,'') as phone1,
isnull(lab_reqmain.sfzh,'') as sfzh,
isnull(lab_reqmain.addr,'') as addr,
lab_pat.yhdh as cp_jyz,
lab_pat.hdys as cp_hdz,
lab_pat.confirmdt,
isnull(lab_pat.sn_tss,'') as sn_tss,
isnull(lab_pat.sn_result,'') as sn_result,
isnull(lab_pat.sjys,'') as sjys
FROM lab_reqmain ,lab_pat
WHERE lab_reqmain.sqh = lab_pat.sqh and lab_pat.jyrq = #{jyrq} and lab_pat.yq = #{yq} and lab_pat.ybh = #{ybh}
</select>
<select id="getOtherinstrDetail" resultType="map">
select b.jyrq,c.xmmc,b.csjg,b.ybh,b.yq,
(case a.brxb when '1' then '男' when '2' then '女' end) as brxb ,
convert(varchar(100),a.nl)+(case a.nldw when '1' then '岁' when '2' then '月' when '3' then '天' end) as nl
from lab_pat a, lab_result b,xm_info c
where a.jyrq = b.jyrq and a.yq = b.yq and a.ybh = b.ybh and a.jgbz = '2'
and c.yq = b.yq and c.xmdh = b.xmdh and a.jyrq = #{jyrq} and a.yq = #{yq} and a.brdh = #{brdh}
</select>
<select id="getHisResult" resultType="com.czlis.liswork.pojo.HistoryResult">
select b.jyrq,c.xmdh, c.xmmc,b.csjg,b.ybh,b.yq,d.yqdl,d.yqmc,a.brdh,
(case a.brxb when '1' then '男' when '2' then '女' end) as brxb ,
c.cksx,c.ckxx,
convert(varchar(100),a.nl)+(case a.nldw when '1' then '岁' when '2' then '月' when '3' then '天' end) as nl,
a.brxm as brxm,b.result_flag,(select top 1 zdmc from com_dict where zdlb = 'HOS' and zddh = a.yljg) as yljg
from lab_pat a, lab_result b,xm_info c,lab_instr d
where a.jyrq = b.jyrq and a.yq = b.yq and a.ybh = b.ybh and a.jgbz = '2'
and c.yq = b.yq and c.xmdh = b.xmdh and d.yq = a.yq
<if test="startda != null">and a.jyrq >= #{startda}</if>
<if test="endda != null">and #{endda} >= a.jyrq </if>
<if test="yqdl != null and yqdl != ''"> and d.yqdl = #{yqdl}</if>
<if test="brdh != null and brdh != ''"> and a.brdh = #{brdh}</if>
<if test="brxm != null and brxm !=''">and a.brxm = #{brxm}</if>
<if test="mzh != null and mzh !=''">and a.mzh = #{mzh}</if>
<if test="sfzh != null and sfzh !=''">and a.sfzh = #{sfzh}</if>
<if test="instrlist != null and instrlist !=''">and a.yq in ${instrlist} </if>
<if test="jyrq != null "> and a.jyrq = #{jyrq}</if>
<if test="yq != null and yq != ''"> and a.yq = #{yq}</if>
<if test="ybh != null and ybh != ''"> and a.ybh = #{ybh}</if>
order by c.dyxh asc
</select>
<select id="getbgxm" resultType="map">
SELECT distinct xm_reqitem_vs_reportitem.sqxmdh,
xm_reqitem_vs_reportitem.yq,
xm_reqitem_vs_reportitem.xmdh,
xm_reqitem_vs_reportitem.tdh,
xm_reqitem_vs_reportitem.mrz,xm_info.dyxh,xm_info.xmmc
FROM xm_reqitem_vs_reportitem,xm_info
WHERE ( xm_reqitem_vs_reportitem.sqxmdh = #{sqxmdh} ) AND (isnull(xm_reqitem_vs_reportitem.def,'')!='1') and
( xm_reqitem_vs_reportitem.yq = #{yq} ) and xm_reqitem_vs_reportitem.yq=xm_info.yq and xm_reqitem_vs_reportitem.xmdh=xm_info.xmdh
</select>
<select id="getInputmdl">
SELECT lab_inputmdl.mbmc ,
lab_inputmdl.srbh ,
lab_inputmdl.zdsr ,
lab_inputmdl.qsybh ,
lab_inputmdl.jsybh ,
lab_inputmdl.yblx
FROM lab_inputmdl
WHERE ( lab_inputmdl.yq = #{yq} )
</select>
<select id="getclinicref" resultType="String">
select clinicref from xm_info where yq = #{yq} and xmdh =#{xmdh}
</select>
</mapper>