zhs
6 天以前 cfbd93a77796c4b4eb7f476addc6fe888908bd22
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<?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.PatMedInspectionMapper">
 
    <resultMap type="com.smartor.domain.PatMedInspection" id="PatMedInspectionResult">
        <result property="id" column="id"/>
        <result property="projecttype" column="projecttype"/>
        <result property="inhospno" column="inhospno"/>
        <result property="patidHis" column="patid_his"/>
        <result property="idcardno" column="idcardno"/>
        <result property="patname" column="patname"/>
        <result property="telcode" column="telcode"/>
        <result property="adviceId" column="adviceId"/>
        <result property="appliyid" column="appliyid"/>
        <result property="priority" column="priority"/>
        <result property="orgid" column="orgid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="drcode" column="drcode"/>
        <result property="drname" column="drname"/>
        <result property="deptcode" column="deptcode"/>
        <result property="deptname" column="deptname"/>
        <result property="opendate" column="opendate"/>
        <result property="operatorId" column="operator_id"/>
        <result property="operatorName" column="operator_name"/>
        <result property="operatorDate" column="operator_date"/>
        <result property="money" column="money"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateDate" column="update_date"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="startTime" column="start_time"/>
        <result property="projectId" column="project_id"/>
        <result property="projectName" column="project_name"/>
        <result property="diagid" column="diagid"/>
        <result property="diagname" column="diagname"/>
        <result property="partId" column="part_id"/>
        <result property="partName" column="part_name"/>
        <result property="typeId" column="type_id"/>
        <result property="typeName" column="type_name"/>
        <result property="filmFlag" column="film_flag"/>
        <result property="bedFlag" column="bed_flag"/>
        <result property="pushFlag" column="push_flag"/>
        <result property="urgentFlag" column="urgent_flag"/>
        <result property="nostartFlag" column="nostart_flag"/>
        <result property="pguid" column="pguid"/>
        <result property="guid" column="guid"/>
        <result property="pid" column="pid"/>
    </resultMap>
 
    <sql id="selectPatMedInspectionVo">
        select id,
               projecttype,
               inhospno,
               patid_his,
               idcardno,
               patname,
               telcode,
               adviceId,
               appliyid,
               priority,
               orgid,
               del_flag,
               drcode,
               drname,
               deptcode,
               deptname,
               opendate,
               operator_id,
               operator_name,
               operator_date,
               money,
               update_by,
               update_date,
               create_by,
               create_time,
               start_time,
               project_id,
               project_name,
               diagid,
               diagname,
               part_id,
               part_name,
               type_id,
               type_name,
               film_flag,
               bed_flag,
               push_flag,
               urgent_flag,
               nostart_flag,
               pguid,
               guid,
               pid
        from pat_med_inspection
    </sql>
 
    <select id="selectPatMedInspectionList" parameterType="com.smartor.domain.PatMedInspection"
            resultMap="PatMedInspectionResult">
        <include refid="selectPatMedInspectionVo"/>
        <where>
            <if test="projecttype != null">and projecttype = #{projecttype}</if>
            <if test="inhospno != null">and inhospno = #{inhospno}</if>
            <if test="patidHis != null">and patid_his = #{patidHis}</if>
            <if test="idcardno != null">and idcardno = #{idcardno}</if>
            <if test="patname != null">and patname = #{patname}</if>
            <if test="telcode != null ">and telcode = #{telcode}</if>
            <if test="adviceId != null">and adviceId = #{adviceId}</if>
            <if test="appliyid != null">and appliyid = #{appliyid}</if>
            <if test="priority != null">and priority = #{priority}</if>
            <if test="orgid != null">and orgid = #{orgid}</if>
            <if test="delFlag != null">and del_flag = #{delFlag}</if>
            <if test="drcode != null">and drcode = #{drcode}</if>
            <if test="drname != null">and drname = #{drname}</if>
            <if test="deptcode != null">and deptcode = #{deptcode}</if>
            <if test="deptname != null">and deptname = #{deptname}</if>
            <if test="opendate != null">and opendate = #{opendate}</if>
            <if test="operatorId != null">and operator_id = #{operatorId}</if>
            <if test="operatorName != null">and operator_name = #{operatorName}</if>
            <if test="operatorDate != null">and operator_date = #{operatorDate}</if>
            <if test="money != null">and money = #{money}</if>
            <if test="updateBy != null">and update_by = #{updateBy}</if>
            <if test="updateDate != null">and update_date = #{updateDate}</if>
            <if test="createBy != null">and create_by = #{createBy}</if>
            <if test="createTime != null">and create_time = #{createTime}</if>
            <if test="startTime != null">and start_time = #{startTime}</if>
            <if test="projectId != null">and project_id = #{projectId}</if>
            <if test="projectName != null">and project_name = #{projectName}</if>
            <if test="diagid != null">and diagid = #{diagid}</if>
            <if test="diagname != null">and diagname = #{diagname}</if>
            <if test="partId != null">and part_id = #{partId}</if>
            <if test="partName != null">and part_name = #{partName}</if>
            <if test="typeId != null">and type_id = #{typeId}</if>
            <if test="typeName != null">and type_name = #{type}</if>
            <if test="filmFlag != null">and film_flag = #{filmFlag}</if>
            <if test="bedFlag != null">and bed_flag = #{bedFlag}</if>
            <if test="pushFlag != null">and push_flag = #{pushFlag}</if>
            <if test="urgentFlag != null">and urgent_flag = #{urgentFlag}</if>
            <if test="nostartFlag != null">and nostart_flag = #{nostartFlag}</if>
            <if test="pguid != null">and pguid = #{pguid}</if>
            <if test="guid != null">and guid = #{guid}</if>
            <if test="pid != null">and pid = #{pid}</if>
        </where>
--         order by update_time desc
    </select>
 
    <select id="selectPatMedInspectionById" parameterType="Long" resultMap="PatMedInspectionResult">
        <include refid="selectPatMedInspectionVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertPatMedInspection" parameterType="com.smartor.domain.PatMedInspection" useGeneratedKeys="true"
            keyProperty="id">
        insert into pat_med_inspection
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="projecttype != null">projecttype,</if>
            <if test="inhospno != null">inhospno,</if>
            <if test="patidHis != null">patid_his,</if>
            <if test="idcardno != null">idcardno,</if>
            <if test="patname != null">patname,</if>
            <if test="telcode != null">telcode,</if>
            <if test="adviceId != null">adviceId,</if>
            <if test="appliyid != null">appliyid,</if>
            <if test="priority != null">priority,</if>
            <if test="orgid != null">orgid,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="drcode != null">drcode,</if>
            <if test="drname != null">drname,</if>
            <if test="deptcode != null">deptcode,</if>
            <if test="deptname != null">deptname,</if>
            <if test="opendate != null">opendate,</if>
            <if test="operatorId != null">operator_id,</if>
            <if test="operatorName != null">operator_name,</if>
            <if test="operatorDate != null">operator_date,</if>
            <if test="money != null">money,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateDate != null">update_date,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="startTime != null">start_time,</if>
            <if test="projectId != null">project_id,</if>
            <if test="projectName != null">project_name,</if>
            <if test="diagid != null">diagid,</if>
            <if test="diagname != null">diagname,</if>
            <if test="partId != null">part_id,</if>
            <if test="partName != null">part_name,</if>
            <if test="typeId != null">type_id,</if>
            <if test="typeName != null">type_name,</if>
            <if test="filmFlag != null">film_flag,</if>
            <if test="bedFlag != null">bed_flag,</if>
            <if test="pushFlag != null">push_flag,</if>
            <if test="urgentFlag != null">urgent_flag,</if>
            <if test="nostartFlag != null">nostart_flag,</if>
            <if test="pguid != null">pguid,</if>
            <if test="guid != null">guid,</if>
            <if test="pid != null">pid,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="projecttype != null">#{projecttype},</if>
            <if test="inhospno != null">#{inhospno},</if>
            <if test="patidHis != null">#{patidHis},</if>
            <if test="idcardno != null">#{idcardno},</if>
            <if test="patname != null">#{patname},</if>
            <if test="telcode != null">#{telcode},</if>
            <if test="adviceId != null">#{adviceId},</if>
            <if test="appliyid != null">#{appliyid},</if>
            <if test="priority != null">#{priority},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="drcode != null">#{drcode},</if>
            <if test="drname != null">#{drname},</if>
            <if test="deptcode != null">#{deptcode},</if>
            <if test="deptname != null">#{deptname},</if>
            <if test="opendate != null">#{opendate},</if>
            <if test="operatorId != null">#{operatorId},</if>
            <if test="operatorName != null">#{operatorName},</if>
            <if test="operatorDate != null">#{operatorDate},</if>
            <if test="money != null">#{money},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateDate != null">#{updateDate},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="startTime != null">#{startTime},</if>
            <if test="projectId != null">#{projectId},</if>
            <if test="projectName != null">#{projectName},</if>
            <if test="diagid != null">#{diagid},</if>
            <if test="diagname != null">#{diagname},</if>
            <if test="partId != null">#{partId},</if>
            <if test="partName != null">#{partName},</if>
            <if test="typeId != null">#{typeId},</if>
            <if test="typeName != null">#{typeName},</if>
            <if test="filmFlag != null">#{filmFlag},</if>
            <if test="bedFlag != null">#{bedFlag},</if>
            <if test="pushFlag != null">#{pushFlag},</if>
            <if test="urgentFlag != null">#{urgentFlag},</if>
            <if test="nostartFlag != null">#{nostartFlag},</if>
            <if test="pguid != null">#{pguid},</if>
            <if test="guid != null">#{guid},</if>
            <if test="pid != null">#{pid},</if>
        </trim>
    </insert>
 
    <update id="updatePatMedInspection" parameterType="com.smartor.domain.PatMedInspection">
        update pat_med_inspection
        <trim prefix="SET" suffixOverrides=",">
            <if test="projecttype != null">projecttype = #{projecttype},</if>
            <if test="inhospno != null">inhospno = #{inhospno},</if>
            <if test="patidHis != null">patid_his = #{patidHis},</if>
            <if test="idcardno != null">idcardno = #{idcardno},</if>
            <if test="patname != null">patname = #{patname},</if>
            <if test="telcode != null">telcode = #{telcode},</if>
            <if test="adviceId != null">adviceId = #{adviceId},</if>
            <if test="appliyid != null">appliyid = #{appliyid},</if>
            <if test="priority != null">priority = #{priority},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="drcode != null">drcode = #{drcode},</if>
            <if test="drname != null">drname = #{drname},</if>
            <if test="deptcode != null">deptcode = #{deptcode},</if>
            <if test="deptname != null">deptname = #{deptname},</if>
            <if test="opendate != null">opendate = #{opendate},</if>
            <if test="operatorId != null">operator_id = #{operatorId},</if>
            <if test="operatorName != null">operator_name = #{operatorName},</if>
            <if test="operatorDate != null">operator_date = #{operatorDate},</if>
            <if test="money != null">money = #{money},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateDate != null">update_date = #{updateDate},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="startTime != null">start_time = #{startTime},</if>
            <if test="projectId != null">project_id = #{projectId},</if>
            <if test="projectName != null">project_name = #{projectName},</if>
            <if test="diagid != null">diagid = #{diagid},</if>
            <if test="diagname != null">diagname = #{diagname},</if>
            <if test="partId != null">part_id = #{partId},</if>
            <if test="partName != null">part_name = #{partName},</if>
            <if test="typeId != null">type_id = #{typeId},</if>
            <if test="typeName != null">type_name = #{typeName},</if>
            <if test="filmFlag != null">film_flag = #{filmFlag},</if>
            <if test="bedFlag != null">bed_flag = #{bedFlag},</if>
            <if test="pushFlag != null">push_flag = #{pushFlag},</if>
            <if test="urgentFlag != null">urgent_flag = #{urgentFlag},</if>
            <if test="nostartFlag != null">nostart_flag = #{nostartFlag},</if>
        </trim>
        where projecttype = #{projecttype}
        and inhospno = #{inhospno}
        and patid_his = #{patidHis}
        and idcardno = #{idcardno}
    </update>
 
    <delete id="deletePatMedInspectionById" parameterType="Long">
        delete
        from pat_med_inspection
        where id = #{id}
    </delete>
 
    <delete id="deletePatMedInspectionByIds" parameterType="String">
        delete from pat_med_inspection where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>