|
@@ -6,20 +6,20 @@
|
|
|
`originalCertificateImage`, `certificateImage`, `pcCertificateImage`,
|
|
|
`appletsCertificateImage`, `addQrCodeFlag`, `addTemplateType`,
|
|
|
purchaseWay, invoiceImage, `status`,
|
|
|
- `auditStatus`, shopAuditStatus, `createTime`, `createBy`)
|
|
|
+ `auditStatus`, shopAuditStatus, `createTime`, `createBy`, createSource)
|
|
|
values (#{authId}, #{brandId}, #{productTypeId}, #{snCode}, #{name}, #{image},
|
|
|
#{originalCertificateImage}, #{certificateImage}, #{pcCertificateImage},
|
|
|
#{appletsCertificateImage}, #{addQrCodeFlag}, #{addTemplateType},
|
|
|
#{purchaseWay}, #{invoiceImage}, #{status},
|
|
|
- #{auditStatus}, #{shopAuditStatus}, #{createTime}, #{createBy})
|
|
|
+ #{auditStatus}, #{shopAuditStatus}, #{createTime}, #{createBy}, #{createSource})
|
|
|
</insert>
|
|
|
<insert id="insertProductParam">
|
|
|
insert into cm_brand_product_param (`productId`, `name`, `content`)
|
|
|
values (#{productId}, #{paramName}, #{paramContent})
|
|
|
</insert>
|
|
|
<insert id="insertProductType" keyColumn="id" keyProperty="productTypeId" useGeneratedKeys="true" parameterType="com.caimei.model.po.ProductTypePo">
|
|
|
- insert into cm_brand_product_type (authUserId, name, image, pcImage, appletsImage, status, auditStatus, createBy, createTime, delFlag)
|
|
|
- values (#{authUserId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{createBy}, #{createTime}, 0)
|
|
|
+ insert into cm_brand_product_type (authUserId, name, image, pcImage, appletsImage, status, auditStatus, createBy, createSource, createTime, delFlag)
|
|
|
+ values (#{authUserId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{createBy}, #{createSource}, #{createTime}, 0)
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateProductStatusByProductId">
|
|
@@ -67,11 +67,16 @@
|
|
|
</update>
|
|
|
<update id="updateProductAuditStatus">
|
|
|
update cm_brand_auth_product
|
|
|
- set status = #{status},
|
|
|
- auditStatus = #{auditStatus},
|
|
|
- invalidReason = #{invalidReason},
|
|
|
- auditBy = #{auditBy},
|
|
|
- auditTime = #{auditTime}
|
|
|
+ set status = #{status},
|
|
|
+ auditStatus = #{auditStatus},
|
|
|
+ invalidReason = #{invalidReason},
|
|
|
+ auditBy = #{auditBy},
|
|
|
+ <if test="productTypeId != null">
|
|
|
+ productTypeId = #{productTypeId},
|
|
|
+ name = null,
|
|
|
+ image = null,
|
|
|
+ </if>
|
|
|
+ auditTime = #{auditTime}
|
|
|
where id = #{productId}
|
|
|
</update>
|
|
|
<update id="updateCertificateImage">
|
|
@@ -125,11 +130,6 @@
|
|
|
auditStatus = #{shopAuditStatus},
|
|
|
</if>
|
|
|
shopInvalidReason = #{shopInvalidReason},
|
|
|
- <if test="productTypeId != null">
|
|
|
- productTypeId = #{productTypeId},
|
|
|
- name = null,
|
|
|
- image = null,
|
|
|
- </if>
|
|
|
shopAuditBy = #{shopAuditBy},
|
|
|
shopAuditTime = #{shopAuditTime}
|
|
|
where id = #{productId}
|
|
@@ -276,12 +276,14 @@
|
|
|
select id from cm_brand where name = #{brand}
|
|
|
</select>
|
|
|
<select id="getAuthProductList" resultType="com.caimei.model.vo.ProductFormVo">
|
|
|
- select p.id as productId,t.name as productName,snCode,cb.name as brandName,t.image as productImage,certificateImage
|
|
|
+ select p.id as productId,
|
|
|
+ if(p.productTypeId is null,p.name,t.name) as productName,snCode,cb.name as brandName,
|
|
|
+ if(p.productTypeId is null,p.image,t.image) as productImage,certificateImage
|
|
|
from cm_brand_auth_product p
|
|
|
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
|
|
|
where authId = #{authId}
|
|
|
- order by createTime desc
|
|
|
+ order by p.createTime desc
|
|
|
</select>
|
|
|
<select id="getAuthProductByProductId" resultType="com.caimei.module.base.entity.vo.AuthProductVo">
|
|
|
select t.name as productName,
|
|
@@ -343,11 +345,13 @@
|
|
|
order by p.createTime desc
|
|
|
</select>
|
|
|
<select id="getProductTypeList" resultType="com.caimei.model.vo.ProductTypeListVo">
|
|
|
- select id as productTypeId,t.name,t.image,t.status,t.auditStatus,t.createTime,cu.name as createBy,
|
|
|
+ select t.id as productTypeId,t.name,t.image,t.status,t.auditStatus,t.createTime,
|
|
|
+ if(t.createSource = 1,cu.name,cbcu.mobile) as createBy,
|
|
|
au.name as auditBy,t.auditTime,t.invalidReason
|
|
|
from cm_brand_product_type t
|
|
|
left join cm_brand_auth_user cu on t.createBy = cu.authUserId
|
|
|
left join cm_brand_auth_user au on t.auditBy = au.authUserId
|
|
|
+ left join cm_brand_club_user cbcu on t.createBy = cbcu.id
|
|
|
where t.authUserId = #{authUserId} and t.delFlag = 0
|
|
|
<if test="name != null and name != ''">
|
|
|
and t.name like CONCAT('%',#{name},'%')
|
|
@@ -397,7 +401,7 @@
|
|
|
select count(*) from cm_brand_auth_product where productTypeId = #{productTypeId}
|
|
|
</select>
|
|
|
<select id="getProductPo" resultType="com.caimei.model.po.ProductPo">
|
|
|
- select id as productId, productTypeId, name, image
|
|
|
+ select id as productId, productTypeId, name, image, createBy
|
|
|
from cm_brand_auth_product
|
|
|
where id = #{productId}
|
|
|
</select>
|