diff options
author | 2017-07-31 11:06:26 +0530 | |
---|---|---|
committer | 2017-07-31 11:06:26 +0530 | |
commit | d0e21365a8bf7da9dd87915c52acb0a907dfe59b (patch) | |
tree | 06b4f5314b92ca2695bd3dbd9d545df6df242dd3 /vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis | |
parent | 6bf0d8e793ef1f55808bb54112f4839a18ee582a (diff) |
Market place initial code
Resolved:VNFSDK-53
VNF SDK market place
Change-Id: Ic9ac5491b4a43d03bce105abb295e10c476e1560
Signed-off-by: Murali-P <murali.p@huawei.com>
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis')
2 files changed, 92 insertions, 0 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis/configuration/configuration.xml b/vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis/configuration/configuration.xml new file mode 100644 index 00000000..76da57c8 --- /dev/null +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis/configuration/configuration.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 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 configuration +PUBLIC "//mybatis.org//DTD Config 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-config.dtd"> +<configuration> + <environments default="development"> + <environment id="development"> + <transactionManager type="JDBC" /> + <dataSource type="POOLED"> + <property name="driver" value="com.mysql.jdbc.Driver" /> + <property name="url" value="jdbc:mysql://127.0.0.1:3306/marketplaceDB" /> + <property name="username" value="root" /> + <property name="password" value="Changeme_123" /> + </dataSource> + </environment> + </environments> + <mappers> + <mapper resource="mybatis/sql/MarketplaceMapper.xml" /> + </mappers> +</configuration>
\ No newline at end of file diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis/sql/MarketplaceMapper.xml b/vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis/sql/MarketplaceMapper.xml new file mode 100644 index 00000000..27801ae5 --- /dev/null +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/resources/mybatis/sql/MarketplaceMapper.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 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.vnfsdk.marketplace.db.mapper.IMarketplaceMapper"> + + <select id="getAllPackageData" resultType="org.openo.vnfsdk.marketplace.db.entity.PackageData"> + SELECT + * + FROM + CSAR_PACKAGE_TABLE + </select> + + <select id="getPackageData" resultType="org.openo.vnfsdk.marketplace.db.entity.PackageData"> + SELECT + * + FROM + CSAR_PACKAGE_TABLE + WHERE + CSARID=#{csarId} + </select> + + <insert id="savePackageData" parameterType="org.openo.vnfsdk.marketplace.db.entity.PackageData"> + INSERT INTO + CSAR_PACKAGE_TABLE + (CSARID, DOWNLOADURI, REPORT, SIZE, FORMAT, CREATETIME, DELETIONPENDING, MODIFYTIME, SHORTDESC, NAME, VERSION, PROVIDER, TYPE, DETAILS, REMARKS,DOWNLOADCOUNT) + VALUES + (#{csarId}, #{downloadUri}, #{report}, #{size}, #{format},#{createTime}, #{deletionPending}, #{modifyTime}, #{shortDesc}, #{name}, #{version}, #{provider},#{type}, #{details}, #{remarks}, #{downloadCount}) + </insert> + + <delete id="deletePackageData" parameterType="String"> + DELETE FROM + CSAR_PACKAGE_TABLE + WHERE + CSARID=#{csarId} + </delete> + + <delete id="updatePackageData" parameterType="org.openo.vnfsdk.marketplace.db.entity.PackageData"> + UPDATE CSAR_PACKAGE_TABLE SET DOWNLOADCOUNT=#{downloadCount} + WHERE + CSARID=#{csarId} + </delete> + +</mapper>
\ No newline at end of file |