liusheng
2024-09-18 907641e56c2085aaa81f267946dc3e3e9fca73e7
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?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.PatArchiveImportMapper">
 
    <resultMap type="com.smartor.domain.PatArchiveImport" id="PatArchiveImportResult">
            <result property="id" column="id"/>
            <result property="patientno" column="patientno"/>
            <result property="pattype" column="pattype"/>
            <result property="name" column="name"/>
            <result property="sex" column="sex"/>
            <result property="idcardno" column="idcardno"/>
            <result property="age" column="age"/>
            <result property="telcode" column="telcode"/>
            <result property="openid" column="openid"/>
            <result property="delFlag" column="del_flag"/>
            <result property="updateBy" column="update_by"/>
            <result property="updateTime" column="update_time"/>
            <result property="createBy" column="create_by"/>
            <result property="createTime" column="create_time"/>
            <result property="batchName" column="batch_name"/>
            <result property="batchNo" column="batch_no"/>
    </resultMap>
 
    <sql id="selectPatArchiveImportVo">
        select id, patientno, pattype, name, sex, idcardno, age, telcode, openid, del_flag, update_by, update_time, create_by, create_time, batch_name, batch_no
        from pat_archive_import
    </sql>
 
    <select id="selectPatArchiveImportList" parameterType="com.smartor.domain.PatArchiveImport"
            resultMap="PatArchiveImportResult">
        <include refid="selectPatArchiveImportVo"/>
        <where>
                        <if test="patientno != null  and patientno != ''">
                            and patientno = #{patientno}
                        </if>
                        <if test="pattype != null  and pattype != ''">
                            and pattype = #{pattype}
                        </if>
                        <if test="name != null  and name != ''">
                            and name like concat('%', #{name}, '%')
                        </if>
                        <if test="sex != null ">
                            and sex = #{sex}
                        </if>
                        <if test="idcardno != null  and idcardno != ''">
                            and idcardno = #{idcardno}
                        </if>
                        <if test="age != null ">
                            and age = #{age}
                        </if>
                        <if test="telcode != null  and telcode != ''">
                            and telcode = #{telcode}
                        </if>
                        <if test="openid != null  and openid != ''">
                            and openid = #{openid}
                        </if>
                        <if test="batchName != null  and batchName != ''">
                            and batch_name like concat('%', #{batchName}, '%')
                        </if>
                        <if test="batchNo != null  and batchNo != ''">
                            and batch_no = #{batchNo}
                        </if>
        </where>
    </select>
 
    <select id="selectPatArchiveImportById" parameterType="Long"
            resultMap="PatArchiveImportResult">
            <include refid="selectPatArchiveImportVo"/>
            where id = #{id}
    </select>
 
    <insert id="insertPatArchiveImport" parameterType="com.smartor.domain.PatArchiveImport"            useGeneratedKeys="true" keyProperty="id">
        insert into pat_archive_import
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test="patientno != null">patientno,
                    </if>
                    <if test="pattype != null">pattype,
                    </if>
                    <if test="name != null">name,
                    </if>
                    <if test="sex != null">sex,
                    </if>
                    <if test="idcardno != null">idcardno,
                    </if>
                    <if test="age != null">age,
                    </if>
                    <if test="telcode != null">telcode,
                    </if>
                    <if test="openid != null">openid,
                    </if>
                    <if test="delFlag != null">del_flag,
                    </if>
                    <if test="updateBy != null">update_by,
                    </if>
                    <if test="updateTime != null">update_time,
                    </if>
                    <if test="createBy != null">create_by,
                    </if>
                    <if test="createTime != null">create_time,
                    </if>
                    <if test="batchName != null">batch_name,
                    </if>
                    <if test="batchNo != null">batch_no,
                    </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test="patientno != null">#{patientno},
                    </if>
                    <if test="pattype != null">#{pattype},
                    </if>
                    <if test="name != null">#{name},
                    </if>
                    <if test="sex != null">#{sex},
                    </if>
                    <if test="idcardno != null">#{idcardno},
                    </if>
                    <if test="age != null">#{age},
                    </if>
                    <if test="telcode != null">#{telcode},
                    </if>
                    <if test="openid != null">#{openid},
                    </if>
                    <if test="delFlag != null">#{delFlag},
                    </if>
                    <if test="updateBy != null">#{updateBy},
                    </if>
                    <if test="updateTime != null">#{updateTime},
                    </if>
                    <if test="createBy != null">#{createBy},
                    </if>
                    <if test="createTime != null">#{createTime},
                    </if>
                    <if test="batchName != null">#{batchName},
                    </if>
                    <if test="batchNo != null">#{batchNo},
                    </if>
        </trim>
    </insert>
 
    <update id="updatePatArchiveImport" parameterType="com.smartor.domain.PatArchiveImport">
        update pat_archive_import
        <trim prefix="SET" suffixOverrides=",">
                    <if test="patientno != null">patientno =
                        #{patientno},
                    </if>
                    <if test="pattype != null">pattype =
                        #{pattype},
                    </if>
                    <if test="name != null">name =
                        #{name},
                    </if>
                    <if test="sex != null">sex =
                        #{sex},
                    </if>
                    <if test="idcardno != null">idcardno =
                        #{idcardno},
                    </if>
                    <if test="age != null">age =
                        #{age},
                    </if>
                    <if test="telcode != null">telcode =
                        #{telcode},
                    </if>
                    <if test="openid != null">openid =
                        #{openid},
                    </if>
                    <if test="delFlag != null">del_flag =
                        #{delFlag},
                    </if>
                    <if test="updateBy != null">update_by =
                        #{updateBy},
                    </if>
                    <if test="updateTime != null">update_time =
                        #{updateTime},
                    </if>
                    <if test="createBy != null">create_by =
                        #{createBy},
                    </if>
                    <if test="createTime != null">create_time =
                        #{createTime},
                    </if>
                    <if test="batchName != null">batch_name =
                        #{batchName},
                    </if>
                    <if test="batchNo != null">batch_no =
                        #{batchNo},
                    </if>
        </trim>
        where id = #{id}
    </update>
 
                <update id="deletePatArchiveImportById" parameterType="Long">
        update pat_archive_import
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where  id = #{id}
    </update>
 
                            <update id="deletePatArchiveImportByIds" parameterType="String">
        update  pat_archive_import
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
 
 
 
 
</mapper>