zjh
2024-12-06 c42f62b32bac302a7ac9fcde7489f7c5fc6e11aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?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.TjStandardMapper">
 
    <resultMap type="TjStandard" id="TjStandardResult">
        <result property="stanId" column="stan_id"/>
        <result property="proId" column="pro_id"/>
        <result property="tjSex" column="tj_sex"/>
        <result property="tjType" column="tj_type"/>
        <result property="tjStandardGtValue" column="tj_standard_gt_value"/>
        <result property="tjStandardLtValue" column="tj_standard_lt_value"/>
        <result property="company" column="company"/>
        <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"/>
    </resultMap>
 
    <sql id="selectTjStandardVo">
        select stan_id,
               pro_id,
               tj_sex,
               tj_type,
               tj_standard_gt_value,
               tj_standard_lt_value,
               company,
               create_by,
               create_time,
               update_by,
               update_time,
               deleted
        from tj_standard
    </sql>
 
    <select id="selectTjStandardList" parameterType="TjStandard" resultMap="TjStandardResult">
        <include refid="selectTjStandardVo"/>
        <where>
            <if test="proId != null ">and pro_id = #{proId}</if>
            <if test="tjSex != null ">and tj_sex = #{tjSex}</if>
            <if test="tjType != null ">and tj_type = #{tjType}</if>
        </where>
    </select>
 
    <select id="selectTjStandardById" parameterType="String" resultMap="TjStandardResult">
        <include refid="selectTjStandardVo"/>
        where stan_id = #{stan_id}
    </select>
 
    <insert id="insertTjStandard" parameterType="TjStandard">
        insert into tj_standard
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="stanId != null">stan_id,</if>
            <if test="proId != null">pro_id,</if>
            <if test="tjSex != null">tj_sex,</if>
            <if test="tjType != null">tj_type,</if>
            <if test="tjStandardGtValue != null">tj_standard_gt_value,</if>
            <if test="tjStandardLtValue != null">tj_standard_lt_value,</if>
            <if test="company != null">company,</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>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="stan_id != null">#{stanId},</if>
            <if test="proId != null">#{proId},</if>
            <if test="tjSex != null">#{tjSex},</if>
            <if test="tjType != null">#{tjType},</if>
            <if test="tjStandardGtValue != null">#{tjStandardGtValue},</if>
            <if test="tjStandardLtValue != null">#{tjStandardLtValue},</if>
            <if test="company != null">#{company},</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>
        </trim>
    </insert>
 
    <update id="updateTjStandard" parameterType="TjStandard">
        update tj_standard
        <trim prefix="SET" suffixOverrides=",">
            <if test="proId != null">pro_id = #{proId},</if>
            <if test="tjSex != null">tj_sex = #{tjSex},</if>
            <if test="tjType != null">tj_type = #{tjType},</if>
            <if test="tjStandardGtValue != null">tj_standard_gt_value = #{tjStandardGtValue},</if>
            <if test="tjStandardLtValue != null">tj_standard_lt_value = #{tjStandardLtValue},</if>
            <if test="company != null">company = #{company},</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>
        </trim>
        where stan_id = #{stanId}
    </update>
 
    <delete id="deleteTjStandardById" parameterType="String">
        delete
        from tj_standard
        where id = #{id}
    </delete>
 
    <delete id="deleteTjStandardByIds" parameterType="String">
        delete from tj_standard where stan_id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{stanId}
        </foreach>
    </delete>
</mapper>