diff options
author | luxin <luxin7@huawei.com> | 2017-07-03 10:19:19 +0800 |
---|---|---|
committer | luxin <luxin7@huawei.com> | 2017-07-03 10:19:19 +0800 |
commit | 056dcab91efc64b5f9fc39825f9242e7fa0b9d05 (patch) | |
tree | d1af18cb6bfa6d3d61f0f77ff958d5a3ce7d6d06 /ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml | |
parent | d0ad118ba98d809ddc8eece49cf1fe1dfc83fc74 (diff) |
Upload nfvo resmanagement code
Change-Id: Ibe023d4b09e1105b84eb43153b4d4037cae691db
Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml')
-rw-r--r-- | ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml new file mode 100644 index 0000000..135ccc1 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016-2017, Huawei Technologies Co., Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="org.openo.nfvo.resmanagement.service.mapper.VnfInfoMapper" > + <resultMap id="BaseResultMap" type="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + <id column="vnf_instance_id" property="vnfInstanceId" jdbcType="VARCHAR" /> + <result column="ns_id" property="nsId" jdbcType="VARCHAR" /> + <result column="vnfm_id" property="vnfmId" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + vnf_instance_id, ns_id, vnfm_id + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from vnfinfo + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </select> + <select id="getVnfInfos" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vnf + <where> + <if test="vnfInstanceId != null"> + AND vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from vnfinfo + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </delete> + <insert id="insert" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + insert into vnfinfo (vnf_instance_id, ns_id, vnfm_id + ) + values (#{vnfInstanceId,jdbcType=VARCHAR}, #{nsId,jdbcType=VARCHAR}, #{vnfmId,jdbcType=VARCHAR} + ) + </insert> + <insert id="insertSelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + insert into vnfinfo + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="vnfInstanceId != null" > + vnf_instance_id, + </if> + <if test="nsId != null" > + ns_id, + </if> + <if test="vnfmId != null" > + vnfm_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="vnfInstanceId != null" > + #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + #{nsId,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + #{vnfmId,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + update vnfinfo + <set > + <if test="nsId != null" > + ns_id = #{nsId,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + vnfm_id = #{vnfmId,jdbcType=VARCHAR}, + </if> + </set> + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + update vnfinfo + set ns_id = #{nsId,jdbcType=VARCHAR}, + vnfm_id = #{vnfmId,jdbcType=VARCHAR} + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file |