87 lines
3.3 KiB
XML
Raw Normal View History

2025-10-23 20:34:07 +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.LabInputmdlMapper">
<select id="query" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
select * from lab_inputmdl
<where>
<if test="yq != null and yq !=''"> and yq = #{yq}</if>
<if test="mbmc != null and mbmc !=''"> and mbmc = #{mbmc}</if>
</where>
</select>
<select id="queryDetail" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdlDetail">
select * from lab_inputmdldetail
<where>
<if test="yq != null and yq !=''"> and yq = #{yq}</if>
<if test="mbmc != null and mbmc !=''"> and mbmc = #{mbmc}</if>
<if test="xh != null "> and xh = #{xh}</if>
</where>
</select>
<insert id="add">
insert into lab_inputmdl(
yq,mbmc,srbh,zdsr,qsybh,jsybh,yblx
)values(
#{yq},#{mbmc},#{srbh},#{zdsr},#{qsybh},#{jsybh},#{yblx}
)
</insert>
<insert id="addDetail">
insert into lab_inputmdldetail(
yq,mbmc,xh,xmdh,mrz
)values(
#{yq},#{mbmc},#{xh},#{xmdh},#{mrz}
)
</insert>
<update id="update">
update lab_inputmdl
<set>
<if test="mbmc != null and mbmc != ''"> mbmc = #{mbmc},</if>
<if test="srbh != null"> srbh = #{srbh},</if>
<if test="zdsr != null and zdsr != ''"> zdsr = #{zdsr},</if>
<if test="qsybh != null "> qsybh = #{qsybh},</if>
<if test="jsybh != null "> jsybh = #{jsybh},</if>
<if test="yblx != null and yblx != ''"> yblx = #{yblx},</if>
yq = #{yq},mbmc = #{mbmc}
</set>
where yq = #{yq},mbmc = #{mbmc}
</update>
<update id="updateDetail">
update lab_inputmdldetail
<set>
<if test="xmdh != null and xmdh != ''">xmdh = #{xmdh},</if>
<if test="mrz != null and mrz != ''">mrz = #{mrz},</if>
yq = #{yq},mbmc = #{mbmc},xh=#{xh}
</set>
where yq = #{yq},mbmc = #{mbmc},xh=#{xh}
</update>
<delete id="delete">
delete from lab_inputmdl where yq = #{yq} and mbmc = #{mbmc}
</delete>
<delete id="deleteDetail">
delete from lab_inputmdldetail where yq = #{yq} and mbmc = #{mbmc} and xh = #{xh}
</delete>
2025-10-23 20:34:07 +08:00
<select id="getLabInputmdl" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
SELECT * FROM lab_inputmdl where yq = #{yq}
</select>
<select id="getLabInputmdlmbmc" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
SELECT * FROM lab_inputmdl where yq = #{yq} and mbmc=#{mbmc}
</select>
<select id="getLabInputmdlzdsrybh" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y'
AND right(space(20)+#{ybh},20) >= right(space(20)+qsybh,20) AND right(space(20)+jsybh,20) >= right(space(20)+#{ybh},20)
2025-10-23 20:34:07 +08:00
</select>
<select id="getLabInputmdlzdsr" resultType="com.czlis.common.core.domain.entity.lis.LabInputmdl">
SELECT * FROM lab_inputmdl where yq = #{yq} AND zdsr = 'Y'
</select>
</mapper>