liusheng
昨天 e4e220916dd2a4aa649a9b0162e5b5ed0dc9d7e5
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
<?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.ServiceTaskdiagMapper">
 
    <resultMap type="com.smartor.domain.ServiceTaskdiag" id="ServiceTaskdiagResult">
        <result property="id" column="id"/>
        <result property="taskId" column="task_id"/>
        <result property="longtask" column="longtask"/>
        <result property="taskName" column="task_name"/>
        <result property="serviceType" column="service_type"/>
        <result property="icd10id" column="icd10id"/>
        <result property="icd10code" column="icd10code"/>
        <result property="icd10name" column="icd10name"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="orgid" column="orgid"/>
        <result property="guid" column="guid"/>
        <result property="pguid" column="pguid"/>
        <result property="pid" column="pid"/>
    </resultMap>
 
    <sql id="selectServiceTaskdiagVo">
        select id,
               task_id,
               longtask,
               task_name,
               service_type,
               icd10id,
               icd10code,
               icd10name,
               del_flag,
               create_time,
               update_time,
               orgid,
               guid,
               pguid,
               pid
        from service_taskdiag
    </sql>
 
    <select id="selectServiceTaskdiagList" parameterType="com.smartor.domain.ServiceTaskdiag"
            resultMap="ServiceTaskdiagResult">
        <include refid="selectServiceTaskdiagVo"/>
        <where>
            del_flag=0
            <if test="taskId != null ">
                and task_id = #{taskId}
            </if>
            <if test="longtask != null ">
                and longtask = #{longtask}
            </if>
            <if test="taskName != null  and taskName != ''">
                and task_name like concat('%', #{taskName}, '%')
            </if>
            <if test="serviceType != null  and serviceType != ''">
                and service_type = #{serviceType}
            </if>
            <if test="icd10id != null ">
                and icd10id = #{icd10id}
            </if>
            <if test="icd10code != null  and icd10code != ''">
                and icd10code = #{icd10code}
            </if>
            <if test="icd10name != null  and icd10name != ''">
                and icd10name like concat('%', #{icd10name}, '%')
            </if>
            <if test="orgid != null  and orgid != ''">
                and orgid = #{orgid}
            </if>
            <if test="guid != null  and guid != ''">
                and guid = #{guid}
            </if>
            <if test="pguid != null  and pguid != ''">
                and pguid = #{pguid}
            </if>
            <if test="pid != null ">
                and pid = #{pid}
            </if>
        </where>
    </select>
 
    <select id="selectServiceTaskdiagById" parameterType="Long"
            resultMap="ServiceTaskdiagResult">
        <include refid="selectServiceTaskdiagVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertServiceTaskdiag" parameterType="com.smartor.domain.ServiceTaskdiag" useGeneratedKeys="true"
            keyProperty="id">
        insert into service_taskdiag
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskId != null">task_id,
            </if>
            <if test="longtask != null">longtask,
            </if>
            <if test="taskName != null">task_name,
            </if>
            <if test="serviceType != null">service_type,
            </if>
            <if test="icd10id != null">icd10id,
            </if>
            <if test="icd10code != null">icd10code,
            </if>
            <if test="icd10name != null">icd10name,
            </if>
            <if test="delFlag != null">del_flag,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="updateTime != null">update_time,
            </if>
            <if test="orgid != null">orgid,
            </if>
            <if test="guid != null">guid,
            </if>
            <if test="pguid != null">pguid,
            </if>
            <if test="pid != null">pid,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskId != null">#{taskId},
            </if>
            <if test="longtask != null">#{longtask},
            </if>
            <if test="taskName != null">#{taskName},
            </if>
            <if test="serviceType != null">#{serviceType},
            </if>
            <if test="icd10id != null">#{icd10id},
            </if>
            <if test="icd10code != null">#{icd10code},
            </if>
            <if test="icd10name != null">#{icd10name},
            </if>
            <if test="delFlag != null">#{delFlag},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="updateTime != null">#{updateTime},
            </if>
            <if test="orgid != null">#{orgid},
            </if>
            <if test="guid != null">#{guid},
            </if>
            <if test="pguid != null">#{pguid},
            </if>
            <if test="pid != null">#{pid},
            </if>
        </trim>
    </insert>
 
    <update id="updateServiceTaskdiag" parameterType="com.smartor.domain.ServiceTaskdiag">
        update service_taskdiag
        <trim prefix="SET" suffixOverrides=",">
            <if test="taskId != null">task_id =
                #{taskId},
            </if>
            <if test="longtask != null">longtask =
                #{longtask},
            </if>
            <if test="taskName != null">task_name =
                #{taskName},
            </if>
            <if test="serviceType != null">service_type =
                #{serviceType},
            </if>
            <if test="icd10id != null">icd10id =
                #{icd10id},
            </if>
            <if test="icd10code != null">icd10code =
                #{icd10code},
            </if>
            <if test="icd10name != null">icd10name =
                #{icd10name},
            </if>
            <if test="delFlag != null">del_flag =
                #{delFlag},
            </if>
            <if test="createTime != null">create_time =
                #{createTime},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
            <if test="orgid != null">orgid =
                #{orgid},
            </if>
            <if test="guid != null">guid =
                #{guid},
            </if>
            <if test="pguid != null">pguid =
                #{pguid},
            </if>
            <if test="pid != null">pid =
                #{pid},
            </if>
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteServiceTaskdiagById" parameterType="Long">
        update service_taskdiag
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteServiceTaskdiagByIds" parameterType="String">
        update service_taskdiag
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
 
 
</mapper>