|
@@ -2,13 +2,13 @@
|
|
<!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.cmMapper.AuthProductMapper">
|
|
<mapper namespace="com.caimei.mapper.cmMapper.AuthProductMapper">
|
|
<insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
|
|
<insert id="insertProduct" keyColumn="id" keyProperty="productId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductPo">
|
|
- insert into cm_brand_auth_product(`brandId`, `productTypeId`, `snCode`, name, image,
|
|
|
|
|
|
+ insert into cm_brand_auth_product(`infoId`, `productTypeId`, `snCode`, name, image,
|
|
`certificateImage`, `pcCertificateImage`,
|
|
`certificateImage`, `pcCertificateImage`,
|
|
`appletsCertificateImage`,
|
|
`appletsCertificateImage`,
|
|
purchaseWay, invoiceImage, `status`, auditBy, auditTime,
|
|
purchaseWay, invoiceImage, `status`, auditBy, auditTime,
|
|
`auditStatus`, shopAuditStatus, checkFlag, `createTime`, `createBy`,
|
|
`auditStatus`, shopAuditStatus, checkFlag, `createTime`, `createBy`,
|
|
createSource)
|
|
createSource)
|
|
- values (#{brandId}, #{productTypeId}, #{snCode}, #{name}, #{image},
|
|
|
|
|
|
+ values (#{infoId}, #{productTypeId}, #{snCode}, #{name}, #{image},
|
|
#{certificateImage}, #{pcCertificateImage},
|
|
#{certificateImage}, #{pcCertificateImage},
|
|
#{appletsCertificateImage},
|
|
#{appletsCertificateImage},
|
|
#{purchaseWay}, #{invoiceImage}, #{status}, #{auditBy}, #{auditTime},
|
|
#{purchaseWay}, #{invoiceImage}, #{status}, #{auditBy}, #{auditTime},
|
|
@@ -19,8 +19,8 @@
|
|
values (#{productId}, #{paramName}, #{paramContent})
|
|
values (#{productId}, #{paramName}, #{paramContent})
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertProductType" keyColumn="id" keyProperty="productTypeId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductTypePo">
|
|
<insert id="insertProductType" keyColumn="id" keyProperty="productTypeId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductTypePo">
|
|
- insert into cm_brand_product_type (authUserId, brandId, name, image, pcImage, appletsImage, status, auditStatus, auditBy, auditTime, createBy, createSource, createTime, delFlag)
|
|
|
|
- values (#{authUserId}, #{brandId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{auditBy}, #{auditTime}, #{createBy}, #{createSource}, #{createTime}, 0)
|
|
|
|
|
|
+ insert into cm_brand_product_type (authUserId, infoId, name, image, pcImage, appletsImage, status, auditStatus, auditBy, auditTime, createBy, createSource, createTime, delFlag)
|
|
|
|
+ values (#{authUserId}, #{infoId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{auditBy}, #{auditTime}, #{createBy}, #{createSource}, #{createTime}, 0)
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertProductTypeParam">
|
|
<insert id="insertProductTypeParam">
|
|
insert into cm_brand_product_type_param (productTypeId, name, content)
|
|
insert into cm_brand_product_type_param (productTypeId, name, content)
|
|
@@ -39,7 +39,7 @@
|
|
<update id="updateProductByProductId">
|
|
<update id="updateProductByProductId">
|
|
update cm_brand_auth_product
|
|
update cm_brand_auth_product
|
|
set
|
|
set
|
|
- `brandId` = #{brandId},
|
|
|
|
|
|
+ `infoId` = #{infoId},
|
|
`productTypeId` = #{productTypeId},
|
|
`productTypeId` = #{productTypeId},
|
|
`snCode` = #{snCode},
|
|
`snCode` = #{snCode},
|
|
`certificateImage` = #{certificateImage},
|
|
`certificateImage` = #{certificateImage},
|
|
@@ -97,17 +97,17 @@
|
|
</update>
|
|
</update>
|
|
<update id="updateProductType">
|
|
<update id="updateProductType">
|
|
update cm_brand_product_type
|
|
update cm_brand_product_type
|
|
- set name = #{name},
|
|
|
|
- brandId = #{brandId},
|
|
|
|
- <if test="pcImage != null and pcImage != ''">
|
|
|
|
- pcImage = #{pcImage},
|
|
|
|
- </if>
|
|
|
|
- <if test="appletsImage != null and appletsImage != ''">
|
|
|
|
- appletsImage = #{appletsImage},
|
|
|
|
- </if>
|
|
|
|
- image = #{image},
|
|
|
|
- status = #{status},
|
|
|
|
- auditStatus = #{auditStatus}
|
|
|
|
|
|
+ set name = #{name},
|
|
|
|
+ infoId = #{infoId},
|
|
|
|
+ <if test="pcImage != null and pcImage != ''">
|
|
|
|
+ pcImage = #{pcImage},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="appletsImage != null and appletsImage != ''">
|
|
|
|
+ appletsImage = #{appletsImage},
|
|
|
|
+ </if>
|
|
|
|
+ image = #{image},
|
|
|
|
+ status = #{status},
|
|
|
|
+ auditStatus = #{auditStatus}
|
|
where id = #{productTypeId}
|
|
where id = #{productTypeId}
|
|
</update>
|
|
</update>
|
|
<update id="updateProductTypeStatus">
|
|
<update id="updateProductTypeStatus">
|
|
@@ -216,7 +216,7 @@
|
|
<select id="getProductFormData" resultType="com.caimei.model.vo.ProductFormVo">
|
|
<select id="getProductFormData" resultType="com.caimei.model.vo.ProductFormVo">
|
|
select p.`id` as productId,
|
|
select p.`id` as productId,
|
|
r.authId,
|
|
r.authId,
|
|
- if(p.productTypeId is null, cb1.name, cb2.name) as brandName,
|
|
|
|
|
|
+ if(p.productTypeId is null, i1.brandName, i2.brandName) as brandName,
|
|
p.productTypeId,
|
|
p.productTypeId,
|
|
if(p.productTypeId is null, p.name, t.name) as productName,
|
|
if(p.productTypeId is null, p.name, t.name) as productName,
|
|
`snCode`,
|
|
`snCode`,
|
|
@@ -229,13 +229,13 @@
|
|
p.auditStatus,
|
|
p.auditStatus,
|
|
p.createTime,
|
|
p.createTime,
|
|
if(shopAuditStatus = 0, shopInvalidReason, p.invalidReason) as invalidReason,
|
|
if(shopAuditStatus = 0, shopInvalidReason, p.invalidReason) as invalidReason,
|
|
- r.id as relationId,
|
|
|
|
|
|
+ r.id as relationId,
|
|
r.authType
|
|
r.authType
|
|
from cm_brand_auth_product p
|
|
from cm_brand_auth_product p
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
- left join cm_brand cb1 on p.brandId = cb1.id
|
|
|
|
- left join cm_brand cb2 on t.brandId = cb2.id
|
|
|
|
|
|
+ left join cm_brand_auth_shop_info i1 on p.infoId = i1.id
|
|
|
|
+ left join cm_brand_auth_shop_info i2 on t.infoId = i2.id
|
|
where r.id = #{relationId}
|
|
where r.id = #{relationId}
|
|
</select>
|
|
</select>
|
|
<select id="getParamsByProductId" resultType="com.caimei.model.po.ProductParamPo">
|
|
<select id="getParamsByProductId" resultType="com.caimei.model.po.ProductParamPo">
|
|
@@ -295,21 +295,19 @@
|
|
</where>
|
|
</where>
|
|
order by p.createTime desc
|
|
order by p.createTime desc
|
|
</select>
|
|
</select>
|
|
- <select id="getBrandIdByBrandName" resultType="java.lang.Integer">
|
|
|
|
- select id from cm_brand where name = #{brand}
|
|
|
|
- </select>
|
|
|
|
<select id="getAuthProductList" resultType="com.caimei.model.vo.ProductFormVo">
|
|
<select id="getAuthProductList" resultType="com.caimei.model.vo.ProductFormVo">
|
|
- select p.id as productId,
|
|
|
|
|
|
+ select p.id as productId,
|
|
p.purchaseWay,
|
|
p.purchaseWay,
|
|
- if(p.productTypeId is null, p.name, t.name) as productName,
|
|
|
|
|
|
+ if(p.productTypeId is null, p.name, t.name) as productName,
|
|
snCode,
|
|
snCode,
|
|
- cb.name as brandName,
|
|
|
|
- if(p.productTypeId is null, p.image, t.image) as productImage,
|
|
|
|
|
|
+ if(p.productTypeId is null, i1.brandName, i2.brandName) as brandName,
|
|
|
|
+ if(p.productTypeId is null, p.image, t.image) as productImage,
|
|
certificateImage
|
|
certificateImage
|
|
from cm_brand_auth_product p
|
|
from cm_brand_auth_product p
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
- left join cm_brand cb on p.brandId = cb.id
|
|
|
|
|
|
+ left join cm_brand_auth_shop_info i1 on p.infoId = i1.id
|
|
|
|
+ left join cm_brand_auth_shop_info i2 on t.infoId = i2.id
|
|
where r.authId = #{authId}
|
|
where r.authId = #{authId}
|
|
order by p.createTime desc
|
|
order by p.createTime desc
|
|
</select>
|
|
</select>
|
|
@@ -320,24 +318,24 @@
|
|
t.image as appletsImage,
|
|
t.image as appletsImage,
|
|
p.certificateImage as pcCertificateImage,
|
|
p.certificateImage as pcCertificateImage,
|
|
p.certificateImage as appletsCertificateImage,
|
|
p.certificateImage as appletsCertificateImage,
|
|
- p.brandId,
|
|
|
|
- i.brandLogo as authLogo,
|
|
|
|
|
|
+ i.id as infoId,
|
|
|
|
+ i.brandLogo as brandLogo,
|
|
i.brandName as brandName,
|
|
i.brandName as brandName,
|
|
- i.producePlace as productionPlace,
|
|
|
|
|
|
+ i.producePlace as producePlace,
|
|
|
|
+ i.manufacturer as manufacturer,
|
|
a.id as authId,
|
|
a.id as authId,
|
|
a.authParty,
|
|
a.authParty,
|
|
a.logo as clubLogo,
|
|
a.logo as clubLogo,
|
|
u.authUserId as authUserId,
|
|
u.authUserId as authUserId,
|
|
u.name as shopName,
|
|
u.name as shopName,
|
|
u.shopType,
|
|
u.shopType,
|
|
- u.qrCodeImage,
|
|
|
|
- i.manufacturer
|
|
|
|
|
|
+ u.qrCodeImage
|
|
from cm_brand_auth_product p
|
|
from cm_brand_auth_product p
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
left join cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
left join cm_brand_auth a on r.authId = a.id
|
|
left join cm_brand_auth a on r.authId = a.id
|
|
left join cm_brand_auth_user u on a.authUserId = u.authUserId
|
|
left join cm_brand_auth_user u on a.authUserId = u.authUserId
|
|
- left join cm_brand_auth_shop_info i on p.brandId = i.id
|
|
|
|
|
|
+ left join cm_brand_auth_shop_info i on t.infoId = i.id
|
|
where p.id = #{productId}
|
|
where p.id = #{productId}
|
|
and u.status = 1
|
|
and u.status = 1
|
|
and a.status = 1
|
|
and a.status = 1
|
|
@@ -347,13 +345,6 @@
|
|
and t.status = 1
|
|
and t.status = 1
|
|
and t.auditStatus = 1
|
|
and t.auditStatus = 1
|
|
</select>
|
|
</select>
|
|
- <select id="getStatementFile" resultType="com.caimei.model.vo.StatementFileVo">
|
|
|
|
- select name,ossName,md5Hex,uploadTime
|
|
|
|
- from cm_brand_auth_file
|
|
|
|
- where authUserId = #{authUserId}
|
|
|
|
- and brandId = #{brandId}
|
|
|
|
- limit 1
|
|
|
|
- </select>
|
|
|
|
<select id="getAuthProductParams" resultType="com.caimei.model.po.ProductParamPo">
|
|
<select id="getAuthProductParams" resultType="com.caimei.model.po.ProductParamPo">
|
|
select p.name as paramName, p.content as paramContent
|
|
select p.name as paramName, p.content as paramContent
|
|
from cm_brand_product_type_param p left join cm_brand_auth_product ap on p.productTypeId = ap.productTypeId
|
|
from cm_brand_product_type_param p left join cm_brand_auth_product ap on p.productTypeId = ap.productTypeId
|
|
@@ -407,8 +398,8 @@
|
|
order by t.id desc
|
|
order by t.id desc
|
|
</select>
|
|
</select>
|
|
<select id="getProductType" resultType="com.caimei.model.po.ProductTypePo">
|
|
<select id="getProductType" resultType="com.caimei.model.po.ProductTypePo">
|
|
- select t.id as productTypeId, brandId, b.name as brandName, t.name, image, pcImage, appletsImage, authUserId, createBy
|
|
|
|
- from cm_brand_product_type t left join cm_brand b on t.brandId = b.id
|
|
|
|
|
|
+ select t.id as productTypeId, infoId, i.brandName, t.name, image, pcImage, appletsImage, t.authUserId, createBy
|
|
|
|
+ from cm_brand_product_type t left join cm_brand_auth_shop_info i on t.infoId = i.id
|
|
<where>
|
|
<where>
|
|
<if test="productTypeId != null">
|
|
<if test="productTypeId != null">
|
|
and t.id = #{productTypeId}
|
|
and t.id = #{productTypeId}
|
|
@@ -417,7 +408,7 @@
|
|
and t.name = #{productName}
|
|
and t.name = #{productName}
|
|
</if>
|
|
</if>
|
|
<if test="authUserId != null">
|
|
<if test="authUserId != null">
|
|
- and authUserId = #{authUserId}
|
|
|
|
|
|
+ and t.authUserId = #{authUserId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
limit 1
|
|
limit 1
|
|
@@ -426,7 +417,7 @@
|
|
select count(*) from cm_brand_auth_product where productTypeId = #{productTypeId}
|
|
select count(*) from cm_brand_auth_product where productTypeId = #{productTypeId}
|
|
</select>
|
|
</select>
|
|
<select id="getProductPo" resultType="com.caimei.model.po.ProductPo">
|
|
<select id="getProductPo" resultType="com.caimei.model.po.ProductPo">
|
|
- select id as productId, brandId, productTypeId, name, image, createBy
|
|
|
|
|
|
+ select id as productId, infoId, productTypeId, name, image, createBy
|
|
from cm_brand_auth_product
|
|
from cm_brand_auth_product
|
|
where id = #{productId}
|
|
where id = #{productId}
|
|
</select>
|
|
</select>
|