Fix javabean name for vfc-jujudriver
[vfc/nfvo/driver/vnfm/gvnfm.git] / juju / juju-vnfmadapter / Juju-vnfmadapterService / service / src / main / resources / mybatis / mysql / JujuVnfmInfoMapper.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3     Copyright 2016-2017 Huawei Technologies Co., Ltd.
4    
5     Licensed under the Apache License, Version 2.0 (the "License");
6     you may not use this file except in compliance with the License.
7     You may obtain a copy of the License at
8    
9         http://www.apache.org/licenses/LICENSE-2.0
10    
11     Unless required by applicable law or agreed to in writing, software
12     distributed under the License is distributed on an "AS IS" BASIS,
13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14     See the License for the specific language governing permissions and
15     limitations under the License.
16  -->
17
18 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
19 <mapper
20     namespace="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.mapper.JujuVnfmInfoMapper">
21     <resultMap id="BaseResultMap"
22         type="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo">
23         <id column="ID" property="id" jdbcType="VARCHAR" />
24         <result column="VNFM_ID" property="vnfmId" jdbcType="VARCHAR" />
25         <result column="VNF_ID" property="vnfId" jdbcType="VARCHAR" />
26         <result column="APP_NAME" property="appName" jdbcType="VARCHAR" />
27         <result column="JOB_ID" property="jobId" jdbcType="VARCHAR" />
28         <result column="STATUS" property="status" jdbcType="INTEGER" />
29         <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
30         <result column="MODIFY_TIME" property="modifyTime" jdbcType="TIMESTAMP" />
31         <result column="DELETE_TIME" property="deleteTime" jdbcType="TIMESTAMP" />
32     </resultMap>
33     <resultMap id="ResultMapWithBLOBs"
34         type="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo"
35         extends="BaseResultMap">
36         <result column="EXTEND" property="extend" jdbcType="LONGVARCHAR" />
37     </resultMap>
38     <sql id="Example_Where_Clause">
39         <where>
40             <foreach collection="oredCriteria" item="criteria" separator="or">
41                 <if test="criteria.valid">
42                     <trim prefix="(" suffix=")" prefixOverrides="and">
43                         <foreach collection="criteria.criteria" item="criterion">
44                             <choose>
45                                 <when test="criterion.noValue">
46                                     and ${criterion.condition}
47                                 </when>
48                                 <when test="criterion.singleValue">
49                                     and ${criterion.condition} #{criterion.value}
50                                 </when>
51                                 <when test="criterion.betweenValue">
52                                     and ${criterion.condition} #{criterion.value} and
53                                     #{criterion.secondValue}
54                                 </when>
55                                 <when test="criterion.listValue">
56                                     and ${criterion.condition}
57                                     <foreach collection="criterion.value" item="listItem"
58                                         open="(" close=")" separator=",">
59                                         #{listItem}
60                                     </foreach>
61                                 </when>
62                             </choose>
63                         </foreach>
64                     </trim>
65                 </if>
66             </foreach>
67         </where>
68     </sql>
69     <sql id="Update_By_Example_Where_Clause">
70         <where>
71             <foreach collection="example.oredCriteria" item="criteria"
72                 separator="or">
73                 <if test="criteria.valid">
74                     <trim prefix="(" suffix=")" prefixOverrides="and">
75                         <foreach collection="criteria.criteria" item="criterion">
76                             <choose>
77                                 <when test="criterion.noValue">
78                                     and ${criterion.condition}
79                                 </when>
80                                 <when test="criterion.singleValue">
81                                     and ${criterion.condition} #{criterion.value}
82                                 </when>
83                                 <when test="criterion.betweenValue">
84                                     and ${criterion.condition} #{criterion.value} and
85                                     #{criterion.secondValue}
86                                 </when>
87                                 <when test="criterion.listValue">
88                                     and ${criterion.condition}
89                                     <foreach collection="criterion.value" item="listItem"
90                                         open="(" close=")" separator=",">
91                                         #{listItem}
92                                     </foreach>
93                                 </when>
94                             </choose>
95                         </foreach>
96                     </trim>
97                 </if>
98             </foreach>
99         </where>
100     </sql>
101     <sql id="Base_Column_List">
102         ID, VNFM_ID, VNF_ID, APP_NAME, JOB_ID, STATUS, CREATE_TIME, MODIFY_TIME,
103         DELETE_TIME
104     </sql>
105     <sql id="Blob_Column_List">
106         EXTEND
107     </sql>
108     <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs"
109         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfoExample">
110         select
111         <if test="distinct">
112             distinct
113         </if>
114         <include refid="Base_Column_List" />
115         ,
116         <include refid="Blob_Column_List" />
117         from jujuvnfm
118         <if test="_parameter != null">
119             <include refid="Example_Where_Clause" />
120         </if>
121         <if test="orderByClause != null">
122             order by ${orderByClause}
123         </if>
124     </select>
125     <select id="selectByExample" resultMap="BaseResultMap"
126         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfoExample">
127         select
128         <if test="distinct">
129             distinct
130         </if>
131         <include refid="Base_Column_List" />
132         from jujuvnfm
133         <if test="_parameter != null">
134             <include refid="Example_Where_Clause" />
135         </if>
136         <if test="orderByClause != null">
137             order by ${orderByClause}
138         </if>
139         <if test="limitStart >= 0">
140             limit ${limitStart} , ${limitEnd}
141         </if>
142     </select>
143     <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs"
144         parameterType="java.lang.String">
145         select
146         <include refid="Base_Column_List" />
147         ,
148         <include refid="Blob_Column_List" />
149         from jujuvnfm
150         where ID = #{id,jdbcType=VARCHAR}
151     </select>
152     <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
153         delete from jujuvnfm
154         where ID = #{id,jdbcType=VARCHAR}
155     </delete>
156     <delete id="deleteByExample"
157         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfoExample">
158         delete from jujuvnfm
159         <if test="_parameter != null">
160             <include refid="Example_Where_Clause" />
161         </if>
162     </delete>
163     <insert id="insert"
164         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo">
165         insert into jujuvnfm (ID, VNFM_ID, VNF_ID,
166         APP_NAME, JOB_ID, STATUS,
167         CREATE_TIME, MODIFY_TIME, DELETE_TIME,
168         EXTEND)
169         values (#{id,jdbcType=VARCHAR}, #{vnfmId,jdbcType=VARCHAR},
170         #{vnfId,jdbcType=VARCHAR},
171         #{appName,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
172         #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP},
173         #{deleteTime,jdbcType=TIMESTAMP},
174         #{extend,jdbcType=LONGVARCHAR})
175     </insert>
176     <insert id="insertSelective"
177         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo">
178         insert into jujuvnfm
179         <trim prefix="(" suffix=")" suffixOverrides=",">
180             <if test="id != null">
181                 ID,
182             </if>
183             <if test="vnfmId != null">
184                 VNFM_ID,
185             </if>
186             <if test="vnfId != null">
187                 VNF_ID,
188             </if>
189             <if test="appName != null">
190                 APP_NAME,
191             </if>
192             <if test="jobId != null">
193                 JOB_ID,
194             </if>
195             <if test="status != null">
196                 STATUS,
197             </if>
198             <if test="createTime != null">
199                 CREATE_TIME,
200             </if>
201             <if test="modifyTime != null">
202                 MODIFY_TIME,
203             </if>
204             <if test="deleteTime != null">
205                 DELETE_TIME,
206             </if>
207             <if test="extend != null">
208                 EXTEND,
209             </if>
210         </trim>
211         <trim prefix="values (" suffix=")" suffixOverrides=",">
212             <if test="id != null">
213                 #{id,jdbcType=VARCHAR},
214             </if>
215             <if test="vnfmId != null">
216                 #{vnfmId,jdbcType=VARCHAR},
217             </if>
218             <if test="vnfId != null">
219                 #{vnfId,jdbcType=VARCHAR},
220             </if>
221             <if test="appName != null">
222                 #{appName,jdbcType=VARCHAR},
223             </if>
224             <if test="jobId != null">
225                 #{jobId,jdbcType=VARCHAR},
226             </if>
227             <if test="status != null">
228                 #{status,jdbcType=INTEGER},
229             </if>
230             <if test="createTime != null">
231                 #{createTime,jdbcType=TIMESTAMP},
232             </if>
233             <if test="modifyTime != null">
234                 #{modifyTime,jdbcType=TIMESTAMP},
235             </if>
236             <if test="deleteTime != null">
237                 #{deleteTime,jdbcType=TIMESTAMP},
238             </if>
239             <if test="extend != null">
240                 #{extend,jdbcType=LONGVARCHAR},
241             </if>
242         </trim>
243     </insert>
244     <select id="countByExample"
245         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfoExample"
246         resultType="java.lang.Integer">
247         select count(*) from jujuvnfm
248         <if test="_parameter != null">
249             <include refid="Example_Where_Clause" />
250         </if>
251     </select>
252     <update id="updateByExampleSelective" parameterType="map">
253         update jujuvnfm
254         <set>
255             <if test="record.id != null">
256                 ID = #{record.id,jdbcType=VARCHAR},
257             </if>
258             <if test="record.vnfmId != null">
259                 VNFM_ID = #{record.vnfmId,jdbcType=VARCHAR},
260             </if>
261             <if test="record.vnfId != null">
262                 VNF_ID = #{record.vnfId,jdbcType=VARCHAR},
263             </if>
264             <if test="record.appName != null">
265                 APP_NAME = #{record.appName,jdbcType=VARCHAR},
266             </if>
267             <if test="record.jobId != null">
268                 JOB_ID = #{record.jobId,jdbcType=VARCHAR},
269             </if>
270             <if test="record.status != null">
271                 STATUS = #{record.status,jdbcType=INTEGER},
272             </if>
273             <if test="record.createTime != null">
274                 CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
275             </if>
276             <if test="record.modifyTime != null">
277                 MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
278             </if>
279             <if test="record.deleteTime != null">
280                 DELETE_TIME = #{record.deleteTime,jdbcType=TIMESTAMP},
281             </if>
282             <if test="record.extend != null">
283                 EXTEND = #{record.extend,jdbcType=LONGVARCHAR},
284             </if>
285         </set>
286         <if test="_parameter != null">
287             <include refid="Update_By_Example_Where_Clause" />
288         </if>
289     </update>
290     <update id="updateByExampleWithBLOBs" parameterType="map">
291         update jujuvnfm
292         set ID = #{record.id,jdbcType=VARCHAR},
293         VNFM_ID = #{record.vnfmId,jdbcType=VARCHAR},
294         VNF_ID = #{record.vnfId,jdbcType=VARCHAR},
295         APP_NAME = #{record.appName,jdbcType=VARCHAR},
296         JOB_ID = #{record.jobId,jdbcType=VARCHAR},
297         STATUS = #{record.status,jdbcType=INTEGER},
298         CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
299         MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
300         DELETE_TIME = #{record.deleteTime,jdbcType=TIMESTAMP},
301         EXTEND = #{record.extend,jdbcType=LONGVARCHAR}
302         <if test="_parameter != null">
303             <include refid="Update_By_Example_Where_Clause" />
304         </if>
305     </update>
306     <update id="updateByExample" parameterType="map">
307         update jujuvnfm
308         set ID = #{record.id,jdbcType=VARCHAR},
309         VNFM_ID = #{record.vnfmId,jdbcType=VARCHAR},
310         VNF_ID = #{record.vnfId,jdbcType=VARCHAR},
311         APP_NAME = #{record.appName,jdbcType=VARCHAR},
312         JOB_ID = #{record.jobId,jdbcType=VARCHAR},
313         STATUS = #{record.status,jdbcType=INTEGER},
314         CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
315         MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
316         DELETE_TIME = #{record.deleteTime,jdbcType=TIMESTAMP}
317         <if test="_parameter != null">
318             <include refid="Update_By_Example_Where_Clause" />
319         </if>
320     </update>
321     <update id="updateByPrimaryKeySelective"
322         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo">
323         update jujuvnfm
324         <set>
325             <if test="vnfmId != null">
326                 VNFM_ID = #{vnfmId,jdbcType=VARCHAR},
327             </if>
328             <if test="vnfId != null">
329                 VNF_ID = #{vnfId,jdbcType=VARCHAR},
330             </if>
331             <if test="appName != null">
332                 APP_NAME = #{appName,jdbcType=VARCHAR},
333             </if>
334             <if test="jobId != null">
335                 JOB_ID = #{jobId,jdbcType=VARCHAR},
336             </if>
337             <if test="status != null">
338                 STATUS = #{status,jdbcType=INTEGER},
339             </if>
340             <if test="createTime != null">
341                 CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
342             </if>
343             <if test="modifyTime != null">
344                 MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
345             </if>
346             <if test="deleteTime != null">
347                 DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
348             </if>
349             <if test="extend != null">
350                 EXTEND = #{extend,jdbcType=LONGVARCHAR},
351             </if>
352         </set>
353         where ID = #{id,jdbcType=VARCHAR}
354     </update>
355     <update id="updateByPrimaryKeyWithBLOBs"
356         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo">
357         update jujuvnfm
358         set VNFM_ID = #{vnfmId,jdbcType=VARCHAR},
359         VNF_ID = #{vnfId,jdbcType=VARCHAR},
360         APP_NAME = #{appName,jdbcType=VARCHAR},
361         JOB_ID = #{jobId,jdbcType=VARCHAR},
362         STATUS = #{status,jdbcType=INTEGER},
363         CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
364         MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
365         DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
366         EXTEND = #{extend,jdbcType=LONGVARCHAR}
367         where ID = #{id,jdbcType=VARCHAR}
368     </update>
369     <update id="updateByPrimaryKey"
370         parameterType="org.onap.vfc.nfvo.vnfm.gvnfm.jujuvnfmadapter.service.entity.JujuVnfmInfo">
371         update jujuvnfm
372         set VNFM_ID = #{vnfmId,jdbcType=VARCHAR},
373         VNF_ID = #{vnfId,jdbcType=VARCHAR},
374         APP_NAME = #{appName,jdbcType=VARCHAR},
375         JOB_ID = #{jobId,jdbcType=VARCHAR},
376         STATUS = #{status,jdbcType=INTEGER},
377         CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
378         MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
379         DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP}
380         where ID = #{id,jdbcType=VARCHAR}
381     </update>
382 </mapper>