|
@@ -26,15 +26,15 @@
|
|
|
insert into cm_brand_product_type_param (productTypeId, name, content)
|
|
|
values (#{productTypeId}, #{paramName}, #{paramContent})
|
|
|
</insert>
|
|
|
+ <insert id="insertProductRelation" useGeneratedKeys="true" keyColumn="id">
|
|
|
+ insert into cm_brand_product_relation (authId, productId, authType)
|
|
|
+ values (#{authId}, #{productId}, #{authType})
|
|
|
+ </insert>
|
|
|
<insert id="addScanCount">
|
|
|
update cm_brand_auth_product
|
|
|
set scanCount = scanCount + 1
|
|
|
where id = #{productId}
|
|
|
</insert>
|
|
|
- <insert id="insertProductRelation" useGeneratedKeys="true" parameterType="com.caimei.model.vo.ProductRelationVo" keyProperty="relationId" keyColumn="id">
|
|
|
- insert into cm_brand_product_relation (authId, productId, authType)
|
|
|
- values (#{authId}, #{productId}, #{authType})
|
|
|
- </insert>
|
|
|
|
|
|
<update id="updateProductStatusByProductId">
|
|
|
update cm_brand_auth_product
|
|
@@ -44,32 +44,32 @@
|
|
|
<update id="updateProductByProductId">
|
|
|
update cm_brand_auth_product
|
|
|
set
|
|
|
- `infoId` = #{infoId},
|
|
|
- `productTypeId` = #{productTypeId},
|
|
|
- `snCode` = #{snCode},
|
|
|
- `certificateImageType` = #{certificateImageType},
|
|
|
- `certificateImage` = #{certificateImage},
|
|
|
- <if test="pcCertificateImage != null and pcCertificateImage != ''">
|
|
|
- `pcCertificateImage` = #{pcCertificateImage},
|
|
|
- </if>
|
|
|
- <if test="appletsCertificateImage != null and appletsCertificateImage != ''">
|
|
|
- `appletsCertificateImage` = #{appletsCertificateImage},
|
|
|
- </if>
|
|
|
- <if test="name != null and name != ''">
|
|
|
- name = #{name},
|
|
|
- image = #{image},
|
|
|
- </if>
|
|
|
- <if test="productTypeId != null">
|
|
|
- productTypeId = #{productTypeId},
|
|
|
- name = null,
|
|
|
- image = null,
|
|
|
- </if>
|
|
|
- purchaseWay = #{purchaseWay},
|
|
|
- invoiceImage = #{invoiceImage},
|
|
|
- `status` = #{status},
|
|
|
- `auditStatus` = #{auditStatus},
|
|
|
- `shopAuditStatus` = #{shopAuditStatus},
|
|
|
- checkFlag = #{checkFlag}
|
|
|
+ `infoId` = #{infoId},
|
|
|
+ `productTypeId` = #{productTypeId},
|
|
|
+ `snCode` = #{snCode},
|
|
|
+ `certificateImageType` = #{certificateImageType},
|
|
|
+ `certificateImage` = #{certificateImage},
|
|
|
+ <if test="pcCertificateImage != null and pcCertificateImage != ''">
|
|
|
+ `pcCertificateImage` = #{pcCertificateImage},
|
|
|
+ </if>
|
|
|
+ <if test="appletsCertificateImage != null and appletsCertificateImage != ''">
|
|
|
+ `appletsCertificateImage` = #{appletsCertificateImage},
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ name = #{name},
|
|
|
+ image = #{image},
|
|
|
+ </if>
|
|
|
+ <if test="productTypeId != null">
|
|
|
+ productTypeId = #{productTypeId},
|
|
|
+ name = null,
|
|
|
+ image = null,
|
|
|
+ </if>
|
|
|
+ purchaseWay = #{purchaseWay},
|
|
|
+ invoiceImage = #{invoiceImage},
|
|
|
+ `status` = #{status},
|
|
|
+ `auditStatus` = #{auditStatus},
|
|
|
+ `shopAuditStatus` = #{shopAuditStatus},
|
|
|
+ checkFlag = #{checkFlag}
|
|
|
where id = #{productId};
|
|
|
</update>
|
|
|
<update id="updateImageByProductId">
|
|
@@ -364,7 +364,7 @@
|
|
|
and p.auditStatus = 1
|
|
|
and t.status = 1
|
|
|
and t.auditStatus = 1
|
|
|
- limit 1
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
<select id="getAuthProductParams" resultType="com.caimei.model.po.ProductParamPo">
|
|
|
select p.name as paramName, p.content as paramContent
|
|
@@ -411,7 +411,7 @@
|
|
|
<select id="getWxProductTypeList" resultType="com.caimei.model.vo.WxProductTypeListVo">
|
|
|
select t.id as productTypeId,t.name,t.image
|
|
|
from cm_brand_product_type t
|
|
|
- left join cm_brand_auth_user u on t.authUserId = u.authUserId
|
|
|
+ left join cm_brand_auth_user u on t.authUserId = u.authUserId
|
|
|
where u.authUserId = #{authUserId} and t.delFlag = 0 and t.status = 1 and auditStatus = 1
|
|
|
<if test="name != null and name != ''">
|
|
|
and t.name like concat('%',#{name},'%')
|
|
@@ -449,7 +449,7 @@
|
|
|
left join cm_brand_product_relation r on p.id = r.productId
|
|
|
left join cm_brand_auth a on r.authId = a.id
|
|
|
where p.id = #{productId} and a.delFlag = 0
|
|
|
- limit 1
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
<select id="getProductTypeParamList" resultType="com.caimei.model.po.ProductParamPo">
|
|
|
select name as paramName, content as paramContent
|
|
@@ -490,8 +490,8 @@
|
|
|
<select id="getSnCodeList" resultType="java.lang.String">
|
|
|
select DISTINCT snCode
|
|
|
from cm_brand_auth_product p
|
|
|
- left join cm_brand_product_relation r on p.id = r.productId
|
|
|
- left join cm_brand_auth a on a.id = r.authId
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId
|
|
|
+ left join cm_brand_auth a on a.id = r.authId
|
|
|
where a.authUserId = #{authUserId} and a.delFlag = 0 and (r.authType = 2 or (r.authType = 1 and a.id != #{authId}) ) and p.auditStatus = 1
|
|
|
<if test="snCodeList != null and snCodeList.size>0">
|
|
|
and p.snCode not in
|