|
@@ -1,7 +1,7 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei.mapper.AuthProductMapper">
|
|
<mapper namespace="com.caimei.mapper.AuthProductMapper">
|
|
- <insert id="insertProduct">
|
|
|
|
|
|
+ <insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
|
|
insert into cm_brand_auth_product(`authId`, `name`, `snCode`, `image`, `certificateImage`, `status`,
|
|
insert into cm_brand_auth_product(`authId`, `name`, `snCode`, `image`, `certificateImage`, `status`,
|
|
`createTime`, `createBy`)
|
|
`createTime`, `createBy`)
|
|
values (#{authId}, #{productName}, #{snCode}, #{productImage}, #{certificateImage}, #{status}, #{createTime},
|
|
values (#{authId}, #{productName}, #{snCode}, #{productImage}, #{certificateImage}, #{status}, #{createTime},
|
|
@@ -22,7 +22,8 @@
|
|
set `name` = #{productName},
|
|
set `name` = #{productName},
|
|
`snCode` = #{snCode},
|
|
`snCode` = #{snCode},
|
|
`image` = #{productImage},
|
|
`image` = #{productImage},
|
|
- `certificateImage` = #{certificateImage}
|
|
|
|
|
|
+ `certificateImage` = #{certificateImage},
|
|
|
|
+ `status` = #{status}
|
|
where id = #{productId};
|
|
where id = #{productId};
|
|
</update>
|
|
</update>
|
|
<delete id="deleteProductByProductId">
|
|
<delete id="deleteProductByProductId">
|
|
@@ -32,11 +33,12 @@
|
|
delete from cm_brand_product_param where productId = #{productId}
|
|
delete from cm_brand_product_param where productId = #{productId}
|
|
</delete>
|
|
</delete>
|
|
<select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
|
|
<select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
|
|
- select id as productId,name as productName,snCode,status,createTime,createBy
|
|
|
|
- from cm_brand_auth_product
|
|
|
|
|
|
+ select id as productId,p.name as productName,snCode,p.status,p.createTime,u.name as createBy
|
|
|
|
+ from cm_brand_auth_product p
|
|
|
|
+ left join cm_brand_auth_user u on p.createBy = u.authUserId
|
|
where authId = #{authId}
|
|
where authId = #{authId}
|
|
<if test="productName != null and productName != ''">
|
|
<if test="productName != null and productName != ''">
|
|
- and name like CONCAT('%',#{productName},'%')
|
|
|
|
|
|
+ and p.name like CONCAT('%',#{productName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="snCode != null and snCode != ''">
|
|
<if test="snCode != null and snCode != ''">
|
|
and snCode like CONCAT('%',#{snCode},'%')
|
|
and snCode like CONCAT('%',#{snCode},'%')
|
|
@@ -45,4 +47,23 @@
|
|
<select id="getProductIdBySnCode" resultType="java.lang.Integer">
|
|
<select id="getProductIdBySnCode" resultType="java.lang.Integer">
|
|
select id from cm_brand_auth_product where snCode = #{snCode} limit 1
|
|
select id from cm_brand_auth_product where snCode = #{snCode} limit 1
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getProductFormByProductId" resultType="com.caimei.model.vo.ProductFormVo">
|
|
|
|
+ select `id` as productId,
|
|
|
|
+ `authId`,
|
|
|
|
+ `name` as productName,
|
|
|
|
+ `snCode`,
|
|
|
|
+ `image` as productImage,
|
|
|
|
+ `certificateImage`,
|
|
|
|
+ `status`
|
|
|
|
+ from cm_brand_auth_product
|
|
|
|
+ where id = #{productId}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getParamsByProductId" resultType="com.caimei.model.po.ProductParamPo">
|
|
|
|
+ select `name` as paramName, `content` as paramContent
|
|
|
|
+ from cm_brand_product_param
|
|
|
|
+ where productId = #{productId}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getProductIdsByAuthId" resultType="java.lang.Integer">
|
|
|
|
+ select id from cm_brand_auth_product where authId = #{authId}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|