lis8.0/liswork/src/main/resources/mapper/XmMedmainMapper.xml
2025-10-13 17:44:53 +08:00

64 lines
2.6 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.xtwh.XmMedmainMapper">
<select id="queryInstr" resultType="com.czlis.common.core.domain.entity.lis.LabInstr">
SELECT lab_instr.yq , lab_instr.yqmc FROM lab_instr WHERE ( lab_instr.yqdl = '细菌仪' )
</select>
<select id="queryGerm" resultType="com.czlis.common.core.domain.entity.lis.XmInfo">
SELECT xm_info.xmdh , xm_info.xmmc , xm_info.dyxh FROM xm_info WHERE ( xm_info.yq = #{yq} )
</select>
<select id="queryMed" resultType="com.czlis.common.core.domain.entity.lis.XmMedMain">
select * from xm_medmain where yq = #{yq} and xmdh = #{xmdh}
<if test="ywzmc != null and ywzmc != ''"> and ywzmc = #{ywzmc}</if>
</select>
<select id="queryMedDetail" resultType="com.czlis.common.core.domain.entity.lis.XmMedDetail">
select * from xm_meddetail where yq = #{yq} and xmdh = #{xmdh} and ywzmc = #{ywzmc}
</select>
<insert id="addMedMain">
insert into xm_medmain(
<if test="mrz != null and mrz != ''">mrz,</if>
<if test="bz != null and bz != ''">bz,</if>
yq, xmdh, ywzmc
)values(
<if test="mrz != null and mrz != ''">#{mrz},</if>
<if test="bz != null and bz != ''">#{bz},</if>
#{yq},#{xmdh},#{ywzmc},
)
</insert>
<update id="updateMedMain">
update xm_medmain set
<if test="mrz != null and mrz != ''">mrz,</if>
<if test="bz != null and bz != ''">bz,</if>
ywzmc = #{ywzmc}
where yq = #{yq} and xmdh = #{xmdh} and ywzmc = #{oldYwzmc}
</update>
<insert id="addMedDetail">
insert into xm_meddetail(
<if test="mic1 != null">mic1,</if>
<if test="mic2 != null">mic2,</if>
<if test="rad1 != null">rad1,</if>
<if test="rad2 != null">rad2,</if>
<if test="mrz != null and mrz != ''">mrz,</if>
<if test="xh != null">xh,</if>
<if test="bz != null and bz != ''">bz,</if>
yq, xmdh, ywzmc, ywdh
)values(
<if test="mic1 != null">#{mic1},</if>
<if test="mic2 != null">#{mic2},</if>
<if test="rad1 != null">#{rad1},</if>
<if test="rad2 != null">#{rad2},</if>
<if test="mrz != null and mrz != ''">#{mrz},</if>
<if test="xh != null">#{xh},</if>
<if test="bz != null and bz != ''">#{bz},</if>
#{yq}, #{xmdh}, #{ywzmc}, #{ywdh}
)
</insert>
</mapper>