陈昶聿
昨天 fcb98e4558897945a316d04555923355b8e60605
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
<?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.ServiceOutPathMapper">
 
    <resultMap type="com.smartor.domain.ServiceOutPath" id="ServiceOutPathResult">
        <result property="id" column="id"/>
        <result property="param1" column="param1"/>
        <result property="param2" column="param2"/>
        <result property="param3" column="param3"/>
        <result property="param5" column="param5"/>
        <result property="param6" column="param6"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
        <result property="radix" column="radix"/>
        <result property="guid" column="guid"/>
        <result property="orgid" column="orgid"/>
        <result property="url" column="url"/>
        <result property="wardCode" column="ward_code"/>
        <result property="wardName" column="ward_name"/>
        <result property="deptCode" column="dept_code"/>
        <result property="deptName" column="dept_name"/>
    </resultMap>
 
    <sql id="selectServiceOutPathVo">
        select id,
               param1,
               param2,
               param3,
               param5,
               param6,
               create_time,
               update_time,
               radix,
               guid,
               orgid,
               url,
               ward_code,
               ward_name,
               dept_code,
               dept_name,
               del_flag
        from service_out_path
    </sql>
 
    <select id="selectServiceOutPathList" parameterType="com.smartor.domain.ServiceOutPath"
            resultMap="ServiceOutPathResult">
        <include refid="selectServiceOutPathVo"/>
        where 1=1
        and del_flag = 0
        <if test="param1 != null ">
            and param1 = #{param1}
        </if>
        <if test="param2 != null ">
            and param2 = #{param2}
        </if>
        <if test="param3 != null  and param3 != ''">
            and param3 = #{param3}
        </if>
        <if test="param5 != null  and param5 != ''">
            and param5 = #{param5}
        </if>
        <if test="param6 != null  and param6 != ''">
            and param6 = #{param6}
        </if>
        <if test="createTime != null">
            and create_time = #{createTime}
        </if>
        <if test="radix != null  and radix != ''">
            and radix=#{radix}
        </if>
        <if test="url != null  and url != ''">
            and url=#{url}
        </if>
        <if test="wardCode != null  and wardCode != ''">
            and ward_code=#{wardCode}
        </if>
 
        <if test="wardName != null  and wardName != ''">
            and ward_name=#{wardName}
        </if>
        <if test="deptCode != null  and deptCode != ''">
            and dept_code=#{deptCode}
        </if>
        <if test="deptName != null  and deptName != ''">
            and dept_name=#{deptName}
        </if>
    </select>
 
    <select id="selectServiceOutPathById" parameterType="Long"
            resultMap="ServiceOutPathResult">
        <include refid="selectServiceOutPathVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertServiceOutPath" parameterType="com.smartor.domain.ServiceOutPath" useGeneratedKeys="true"
            keyProperty="id">
        insert into service_out_path
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="param1 != null">param1,
            </if>
            <if test="param2 != null">param2,
            </if>
            <if test="param3 != null">param3,
            </if>
            <if test="param5 != null">param5,
            </if>
            <if test="param6 != null">param6,
            </if>
            <if test="radix != null">radix,
            </if>
            <if test="orgid != null">orgid,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="url != null">url,
            </if>
            <if test="wardCode != null">ward_code,
            </if>
            <if test="wardName != null">ward_name,
            </if>
            <if test="deptCode != null">dept_code,
            </if>
            <if test="deptName != null">dept_name,
            </if>
 
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="param1 != null">#{param1},
            </if>
            <if test="param2 != null">#{param2},
            </if>
            <if test="param3 != null">#{param3},
            </if>
            <if test="param5 != null">#{param5},
            </if>
            <if test="param6 != null">#{param6},
            </if>
            <if test="radix != null">#{radix},
            </if>
            <if test="orgid != null">#{orgid},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="url != null">#{url},
            </if>
            <if test="wardCode != null">#{wardCode},
            </if>
            <if test="wardName != null">#{wardName},
            </if>
            <if test="deptCode != null">#{deptCode},
            </if>
            <if test="deptName != null">#{deptName},
            </if>
        </trim>
    </insert>
 
    <update id="updateServiceOutPath" parameterType="com.smartor.domain.ServiceOutPath">
        update service_out_path
        <trim prefix="SET" suffixOverrides=",">
            <if test="param1 != null">param1 =
                #{param1},
            </if>
            <if test="param2 != null">param2 =
                #{param2},
            </if>
            <if test="param3 != null">param3 =
                #{param3},
            </if>
            <if test="param5 != null">param5 =
                #{param5},
            </if>
            <if test="param6 != null">param6 =
                #{param6},
            </if>
            <if test="radix != null">radix =
                #{radix},
            </if>
            <if test="guid != null">guid =
                #{guid},
            </if>
            <if test="orgid != null">orgid =
                #{orgid},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
            <if test="url != null">url =
                #{url},
            </if>
            <if test="wardCode != null">ward_code =
                #{wardCode},
            </if>
            <if test="wardName != null">ward_name =
                #{wardName},
            </if>
            <if test="deptCode != null">dept_code =
                #{deptCode},
            </if>
            <if test="deptName != null">dept_name =
                #{deptName},
            </if>
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteServiceOutPathById" parameterType="Long">
        update service_out_path
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteServiceOutPathByIds" parameterType="String">
        update service_out_path
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
    <select id="selectAutoId" resultType="Integer">
        SELECT AUTO_INCREMENT
        FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_NAME = 'service_out_path'
          AND table_schema = DATABASE()
--           and onorgid
    </select>
 
</mapper>