liusheng
2024-04-15 fdf1b9c1e4489a0c2615fa596268b2f71fad7b4c
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
<?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.smartor.mapper.Icd10AssociationMapper">
    
    <resultMap type="com.smartor.domain.Icd10Association" id="Icd10AssociationResult">
        <result property="icd10code"    column="icd10code"    />
        <result property="icd10name"    column="icd10name"    />
        <result property="svyid"    column="svyid"    />
        <result property="updatetime"    column="updatetime"    />
    </resultMap>
 
    <sql id="selectIcd10AssociationVo">
        select icd10code, icd10name, svyid, updatetime from icd10_association
    </sql>
 
    <select id="selectIcd10AssociationList" parameterType="com.smartor.domain.Icd10Association" resultMap="Icd10AssociationResult">
        <include refid="selectIcd10AssociationVo"/>
        <where>  
            <if test="icd10code != null  and icd10code != ''"> and icd10code = #{icd10code}</if>
            <if test="icd10name != null  and icd10name != ''"> and icd10name like concat('%', #{icd10name}, '%')</if>
            <if test="svyid != null "> and svyid = #{svyid}</if>
            <if test="updatetime != null "> and updatetime = #{updatetime}</if>
        </where>
    </select>
    
    <select id="selectIcd10AssociationByIcd10code" parameterType="String" resultMap="Icd10AssociationResult">
        <include refid="selectIcd10AssociationVo"/>
        where icd10code = #{icd10code}
    </select>
        
    <insert id="insertIcd10Association" parameterType="com.smartor.domain.Icd10Association">
        insert into icd10_association
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="icd10code != null and icd10code != ''">icd10code,</if>
            <if test="icd10name != null">icd10name,</if>
            <if test="svyid != null">svyid,</if>
            <if test="updatetime != null">updatetime,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="icd10code != null and icd10code != ''">#{icd10code},</if>
            <if test="icd10name != null">#{icd10name},</if>
            <if test="svyid != null">#{svyid},</if>
            <if test="updatetime != null">#{updatetime},</if>
         </trim>
    </insert>
 
    <update id="updateIcd10Association" parameterType="Icd10Association">
        update icd10_association
        <trim prefix="SET" suffixOverrides=",">
            <if test="icd10name != null">icd10name = #{icd10name},</if>
            <if test="svyid != null">svyid = #{svyid},</if>
            <if test="updatetime != null">updatetime = #{updatetime},</if>
        </trim>
        where icd10code = #{icd10code}
    </update>
 
    <delete id="deleteIcd10AssociationByIcd10code" parameterType="String">
        delete from icd10_association where icd10code = #{icd10code}
    </delete>
 
    <delete id="deleteIcd10AssociationByIcd10codes" parameterType="String">
        delete from icd10_association where icd10code in 
        <foreach item="icd10code" collection="array" open="(" separator="," close=")">
            #{icd10code}
        </foreach>
    </delete>
</mapper>