<?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.ltkj.hosp.mapper.TjSamplingMapper">
|
|
<resultMap type="TjSampling" id="TjSamplingResult">
|
<result property="id" column="id"/>
|
<result property="tjNum" column="tj_num"/>
|
<result property="samplingNumber" column="sampling_number"/>
|
<result property="cusId" column="cus_id"/>
|
<result property="applicationTime" column="application_time"/>
|
<result property="isSignFor" column="is_sign_for"/>
|
<result property="tjTime" column="tj_time"/>
|
<result property="specimenType" column="specimen_type"/>
|
<result property="proId" column="pro_id"/>
|
<result property="proName" column="pro_name"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="deleted" column="deleted"/>
|
<result property="parentId" column="parent_id"/>
|
<result property="jyxh" column="jyxh"/>
|
<result property="specimenTypeCode" column="specimen_type_code"/>
|
<result property="isMerge" column="is_merge"/>
|
<result property="jyxmdm" column="jyxmdm"/>
|
<result property="jxbz" column="jxbz"/>
|
<result property="createId" column="create_id"/>
|
<result property="updateId" column="update_id"/>
|
<result property="isPay" column="is_pay"/>
|
<result property="isApply" column="is_apply"/>
|
</resultMap>
|
|
<sql id="selectTjSamplingVo">
|
select id,
|
tj_num,
|
sampling_number,
|
cus_id,
|
application_time,
|
is_sign_for,
|
tj_time,
|
specimen_type,
|
pro_id,
|
pro_name,
|
create_by,
|
create_time,
|
update_by,
|
update_time,
|
deleted,
|
parent_id,
|
jyxh,
|
specimen_type_code,
|
is_merge,
|
jyxmdm,
|
jxbz,
|
create_id,
|
update_id
|
from tj_sampling
|
</sql>
|
|
<select id="selectTjSamplingList" parameterType="TjSampling" resultMap="TjSamplingResult">
|
<include refid="selectTjSamplingVo"/>
|
<where>
|
<if test="samplingNumber != null and samplingNumber != ''">
|
and sampling_number = #{samplingNumber}
|
</if>
|
<if test="tjNum != null and tjNum != ''">
|
and tj_num = #{tjNum}
|
</if>
|
<if test="cusId != null and cusId != ''">
|
and cus_id = #{cusId}
|
</if>
|
<if test="applicationTime != null ">
|
and application_time = #{applicationTime}
|
</if>
|
<if test="isSignFor != null ">
|
and is_sign_for = #{isSignFor}
|
</if>
|
<if test="tjTime != null ">
|
and tj_time = #{tjTime}
|
</if>
|
<if test="specimenType != null and specimenType != ''">
|
and specimen_type = #{specimenType}
|
</if>
|
<if test="proId != null and proId != ''">
|
and pro_id = #{proId}
|
</if>
|
<if test="proName != null and proName != ''">
|
and pro_name like concat('%', #{proName}, '%')
|
</if>
|
</where>
|
</select>
|
|
<select id="selectTjSamplingById" parameterType="String"
|
resultMap="TjSamplingResult">
|
<include refid="selectTjSamplingVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTjSampling" parameterType="TjSampling">
|
insert into tj_sampling
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,
|
</if>
|
<if test="tjNum != null">tj_num,
|
</if>
|
<if test="samplingNumber != null">sampling_number,
|
</if>
|
<if test="cusId != null">cus_id,
|
</if>
|
<if test="applicationTime != null">application_time,
|
</if>
|
<if test="isSignFor != null">is_sign_for,
|
</if>
|
<if test="tjTime != null">tj_time,
|
</if>
|
<if test="specimenType != null">specimen_type,
|
</if>
|
<if test="proId != null">pro_id,
|
</if>
|
<if test="proName != null">pro_name,
|
</if>
|
<if test="createBy != null">create_by,
|
</if>
|
<if test="createTime != null">create_time,
|
</if>
|
<if test="updateBy != null">update_by,
|
</if>
|
<if test="updateTime != null">update_time,
|
</if>
|
<if test="deleted != null">deleted,
|
</if>
|
<if test="parentId != null">parent_id,
|
</if>
|
<if test="jyxh != null">jyxh,
|
</if>
|
<if test="specimenTypeCode != null">specimen_type_code,
|
</if>
|
<if test="isMerge != null">is_merge,
|
</if>
|
<if test="jyxmdm != null">jyxmdm,
|
</if>
|
<if test="jxbz != null">jxbz,
|
</if>
|
<if test="createId != null">create_id,
|
</if>
|
<if test="updateId != null">update_id,
|
</if>
|
<if test="isPay != null">is_pay,
|
</if>
|
<if test="isApply != null">is_apply,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},
|
</if>
|
<if test="tjNum != null">tj_num,
|
</if>
|
<if test="samplingNumber != null">#{samplingNumber},
|
</if>
|
<if test="cusId != null">#{cusId},
|
</if>
|
<if test="applicationTime != null">#{applicationTime},
|
</if>
|
<if test="isSignFor != null">#{isSignFor},
|
</if>
|
<if test="tjTime != null">#{tjTime},
|
</if>
|
<if test="specimenType != null">#{specimenType},
|
</if>
|
<if test="proId != null">#{proId},
|
</if>
|
<if test="proName != null">#{proName},
|
</if>
|
<if test="createBy != null">#{createBy},
|
</if>
|
<if test="createTime != null">#{createTime},
|
</if>
|
<if test="updateBy != null">#{updateBy},
|
</if>
|
<if test="updateTime != null">#{updateTime},
|
</if>
|
<if test="deleted != null">#{deleted},
|
</if>
|
<if test="parentId != null">#{parentId},
|
</if>
|
<if test="jyxh != null">#{jyxh},
|
</if>
|
<if test="specimenTypeCode != null">#{specimenTypeCode},
|
</if>
|
<if test="isMerge != null">#{isMerge},
|
</if>
|
<if test="jyxmdm != null">#{jyxmdm},
|
</if>
|
<if test="jxbz != null">#{jxbz},
|
</if>
|
<if test="createId != null">#{createId},
|
</if>
|
<if test="updateId != null">#{updateId},
|
</if>
|
<if test="isPay != null">#{isPay},
|
</if>
|
<if test="isApply != null">#{isApply},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateTjSampling" parameterType="TjSampling">
|
update tj_sampling
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="samplingNumber != null">sampling_number =
|
#{samplingNumber},
|
</if>
|
<if test="tjNum != null">tj_num=#{tjNum},
|
</if>
|
<if test="cusId != null">cus_id =
|
#{cusId},
|
</if>
|
<if test="applicationTime != null">application_time =
|
#{applicationTime},
|
</if>
|
<if test="isSignFor != null">is_sign_for =
|
#{isSignFor},
|
</if>
|
<if test="tjTime != null">tj_time =
|
#{tjTime},
|
</if>
|
<if test="specimenType != null">specimen_type =
|
#{specimenType},
|
</if>
|
<if test="proId != null">pro_id =
|
#{proId},
|
</if>
|
<if test="proName != null">pro_name =
|
#{proName},
|
</if>
|
<if test="createBy != null">create_by =
|
#{createBy},
|
</if>
|
<if test="createTime != null">create_time =
|
#{createTime},
|
</if>
|
<if test="updateBy != null">update_by =
|
#{updateBy},
|
</if>
|
<if test="updateTime != null">update_time =
|
#{updateTime},
|
</if>
|
<if test="deleted != null">deleted =
|
#{deleted},
|
</if>
|
<if test="parentId != null">parent_id =
|
#{parentId},
|
</if>
|
<if test="jyxh != null">jyxh =
|
#{jyxh},
|
</if>
|
<if test="specimenTypeCode != null">specimen_type_code =
|
#{specimenTypeCode},
|
</if>
|
<if test="isMerge != null">is_merge =
|
#{isMerge},
|
</if>
|
<if test="isMerge != null">jyxmdm =
|
#{jyxmdm},
|
</if>
|
<if test="jxbz != null">jxbz =
|
#{jxbz},
|
</if>
|
<if test="createId != null">create_id = #{createId},
|
</if>
|
<if test="updateId != null">update_id = #{updateId},
|
</if>
|
<if test="isPay != null">is_pay = #{isPay},
|
</if>
|
<if test="isApply != null">is_apply = #{isApply},
|
</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTjSamplingById" parameterType="String">
|
delete
|
from tj_sampling
|
where id = #{id}
|
</delete>
|
|
<delete id="deleteTjSamplingByIds" parameterType="String">
|
delete from tj_sampling where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
|
<update id="updateHeBingXm" parameterType="java.util.Map">
|
UPDATE tj_sampling a SET a.parent_id=#{parentId} WHERE a.id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
|
<update id="updateHeBingXms" parameterType="java.util.Map">
|
UPDATE tj_sampling a SET a.parent_id=null WHERE a.parent_id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
|
</mapper>
|