|
@@ -244,7 +244,7 @@
|
|
where productId = #{productId}
|
|
where productId = #{productId}
|
|
</select>
|
|
</select>
|
|
<select id="getProductIdsByAuthId" resultType="java.lang.Integer">
|
|
<select id="getProductIdsByAuthId" resultType="java.lang.Integer">
|
|
- select p.id
|
|
|
|
|
|
+ select DISTINCT p.id
|
|
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
|
|
where r.authId = #{authId};
|
|
where r.authId = #{authId};
|
|
@@ -260,12 +260,10 @@
|
|
from cm_brand_auth_product
|
|
from cm_brand_auth_product
|
|
</select>
|
|
</select>
|
|
<select id="getWxProductList" resultType="com.caimei.model.vo.WxProductListVo">
|
|
<select id="getWxProductList" resultType="com.caimei.model.vo.WxProductListVo">
|
|
- select p.id as productId,
|
|
|
|
- r.authId,
|
|
|
|
|
|
+ select DISTINCT p.id as productId,
|
|
if(p.productTypeId is null,p.name,t.name) as productName,
|
|
if(p.productTypeId is null,p.name,t.name) as productName,
|
|
p.snCode,
|
|
p.snCode,
|
|
if(p.productTypeId is null,p.image,t.image) as productImage,
|
|
if(p.productTypeId is null,p.image,t.image) as productImage,
|
|
- a.authParty as clubName,
|
|
|
|
p.auditStatus
|
|
p.auditStatus
|
|
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
|
|
@@ -282,15 +280,24 @@
|
|
and p.auditStatus = 1
|
|
and p.auditStatus = 1
|
|
and t.status = 1
|
|
and t.status = 1
|
|
and t.auditStatus = 1
|
|
and t.auditStatus = 1
|
|
|
|
+ <if test="snCode != null and snCode != ''">
|
|
|
|
+ and p.snCode like concat('%',#{snCode},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="authId != null">
|
|
|
|
+ and r.authId = #{authId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="authParty != null and authParty != ''">
|
|
|
|
+ and a.authParty like concat('%',#{authParty},'%')
|
|
|
|
+ </if>
|
|
</if>
|
|
</if>
|
|
- <if test="snCode != null and snCode != ''">
|
|
|
|
- and p.snCode like concat('%',#{snCode},'%')
|
|
|
|
- </if>
|
|
|
|
- <if test="authId != null">
|
|
|
|
- and r.authId = #{authId}
|
|
|
|
- </if>
|
|
|
|
- <if test="authParty != null and authParty != ''">
|
|
|
|
- and a.authParty like concat('%',#{authParty},'%')
|
|
|
|
|
|
+ <if test="listType == 2">
|
|
|
|
+ and p.productTypeId = #{productTypeId}
|
|
|
|
+ <if test="snCode != null and snCode != ''">
|
|
|
|
+ and p.snCode = #{snCode}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="authParty != null and authParty != ''">
|
|
|
|
+ and a.authParty = #{authParty}
|
|
|
|
+ </if>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
order by p.createTime desc
|
|
order by p.createTime desc
|
|
@@ -323,9 +330,6 @@
|
|
i.brandName as brandName,
|
|
i.brandName as brandName,
|
|
i.producePlace as producePlace,
|
|
i.producePlace as producePlace,
|
|
i.manufacturer as manufacturer,
|
|
i.manufacturer as manufacturer,
|
|
- a.id as authId,
|
|
|
|
- a.authParty,
|
|
|
|
- a.logo as clubLogo,
|
|
|
|
u.authUserId as authUserId,
|
|
u.authUserId as authUserId,
|
|
u.name as shopName,
|
|
u.name as shopName,
|
|
u.shopType,
|
|
u.shopType,
|
|
@@ -344,6 +348,7 @@
|
|
and p.auditStatus = 1
|
|
and p.auditStatus = 1
|
|
and t.status = 1
|
|
and t.status = 1
|
|
and t.auditStatus = 1
|
|
and t.auditStatus = 1
|
|
|
|
+ limit 1
|
|
</select>
|
|
</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
|
|
@@ -351,7 +356,7 @@
|
|
where ap.id = #{productId}
|
|
where ap.id = #{productId}
|
|
</select>
|
|
</select>
|
|
<select id="getClubProductList" resultType="com.caimei.model.vo.WxProductListVo">
|
|
<select id="getClubProductList" resultType="com.caimei.model.vo.WxProductListVo">
|
|
- select p.id as productId, t.name as productName, p.snCode
|
|
|
|
|
|
+ select p.id as productId, t.image as productImage, t.name as productName, p.snCode
|
|
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
|
|
@@ -427,6 +432,7 @@
|
|
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_auth a on r.authId = a.id
|
|
left join cm_brand_auth a on r.authId = a.id
|
|
where p.id = #{productId}
|
|
where p.id = #{productId}
|
|
|
|
+ limit 1
|
|
</select>
|
|
</select>
|
|
<select id="getProductTypeParamList" resultType="com.caimei.model.po.ProductParamPo">
|
|
<select id="getProductTypeParamList" resultType="com.caimei.model.po.ProductParamPo">
|
|
select name as paramName, content as paramContent
|
|
select name as paramName, content as paramContent
|
|
@@ -436,16 +442,22 @@
|
|
<select id="getProductRelation" resultType="com.caimei.model.vo.ProductRelationVo">
|
|
<select id="getProductRelation" resultType="com.caimei.model.vo.ProductRelationVo">
|
|
select id as relationId, authId, productId, authType
|
|
select id as relationId, authId, productId, authType
|
|
from cm_brand_product_relation
|
|
from cm_brand_product_relation
|
|
- where id = #{relationId}
|
|
|
|
|
|
+ where
|
|
|
|
+ <if test="relationId != null">
|
|
|
|
+ id = #{relationId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="productId != null and authId != null">
|
|
|
|
+ productId = #{productId} and authId = #{authId}
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
<select id="getProductRelationCount" resultType="java.lang.Integer">
|
|
<select id="getProductRelationCount" resultType="java.lang.Integer">
|
|
select count(*)
|
|
select count(*)
|
|
from cm_brand_product_relation
|
|
from cm_brand_product_relation
|
|
where productId = #{productId}
|
|
where productId = #{productId}
|
|
</select>
|
|
</select>
|
|
- <select id="getProductDetails" resultType="com.caimei.model.vo.ProductFormVo">
|
|
|
|
|
|
+ <select id="getProductInfo" resultType="com.caimei.model.vo.ProductFormVo">
|
|
select p.id as productId,if(p.productTypeId is null,p.name,t.name) as productName,
|
|
select p.id as productId,if(p.productTypeId is null,p.name,t.name) as productName,
|
|
- certificateImageType,certificateImage,purchaseWay,invoiceImage
|
|
|
|
|
|
+ certificateImageType,certificateImage,purchaseWay,invoiceImage,p.auditStatus
|
|
from cm_brand_auth_product p
|
|
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_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
<where>
|
|
<where>
|
|
@@ -458,10 +470,16 @@
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
<select id="getSnCodeList" resultType="java.lang.String">
|
|
<select id="getSnCodeList" resultType="java.lang.String">
|
|
- select snCode
|
|
|
|
|
|
+ select DISTINCT snCode
|
|
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_auth a on a.id = r.authId and a.delFlag = 0
|
|
left join cm_brand_auth a on a.id = r.authId and a.delFlag = 0
|
|
- where a.authUserId = #{authUserId}
|
|
|
|
|
|
+ where a.authUserId = #{authUserId} and p.auditStatus = 1
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getProductClubList" resultType="com.caimei.model.vo.WxClubListVo">
|
|
|
|
+ select a.id as authId, a.authParty, a.logo
|
|
|
|
+ from cm_brand_auth a
|
|
|
|
+ left join cm_brand_product_relation r on a.id = r.authId
|
|
|
|
+ where r.productId = #{productId}
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|