|
@@ -202,13 +202,13 @@
|
|
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="getProductFormByProductId" resultType="com.caimei.model.vo.ProductFormVo">
|
|
- select p.`id` as productId,
|
|
|
|
|
|
+ select p.`id` as productId,
|
|
`authId`,
|
|
`authId`,
|
|
- cb.name as brandName,
|
|
|
|
|
|
+ if(p.productTypeId is null, cb1.name, cb2.name) 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`,
|
|
- if(p.productTypeId is null, p.image, t.image) as productImage,
|
|
|
|
|
|
+ if(p.productTypeId is null, p.image, t.image) as productImage,
|
|
`certificateImage`,
|
|
`certificateImage`,
|
|
`originalCertificateImage`,
|
|
`originalCertificateImage`,
|
|
addQrCodeFlag,
|
|
addQrCodeFlag,
|
|
@@ -217,10 +217,11 @@
|
|
invoiceImage,
|
|
invoiceImage,
|
|
p.`status`,
|
|
p.`status`,
|
|
p.auditStatus,
|
|
p.auditStatus,
|
|
- if(shopAuditStatus = 0,shopInvalidReason,p.invalidReason) as invalidReason
|
|
|
|
|
|
+ if(shopAuditStatus = 0, shopInvalidReason, p.invalidReason) as invalidReason
|
|
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
|
|
- left join cm_brand cb on p.brandId = cb.id
|
|
|
|
|
|
+ left join cm_brand cb1 on p.brandId = cb1.id
|
|
|
|
+ left join cm_brand cb2 on t.brandId = cb2.id
|
|
where p.id = #{productId}
|
|
where p.id = #{productId}
|
|
</select>
|
|
</select>
|
|
<select id="getParamsByProductId" resultType="com.caimei.model.po.ProductParamPo">
|
|
<select id="getParamsByProductId" resultType="com.caimei.model.po.ProductParamPo">
|
|
@@ -403,14 +404,14 @@
|
|
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 id as productTypeId, brandId, name, image, pcImage, appletsImage, authUserId, createBy
|
|
|
|
- from cm_brand_product_type
|
|
|
|
|
|
+ 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
|
|
<where>
|
|
<where>
|
|
<if test="productTypeId != null">
|
|
<if test="productTypeId != null">
|
|
- and id = #{productTypeId}
|
|
|
|
|
|
+ and t.id = #{productTypeId}
|
|
</if>
|
|
</if>
|
|
<if test="productName != null and productName != ''">
|
|
<if test="productName != null and productName != ''">
|
|
- and name = #{productName}
|
|
|
|
|
|
+ and t.name = #{productName}
|
|
</if>
|
|
</if>
|
|
<if test="authUserId != null">
|
|
<if test="authUserId != null">
|
|
and authUserId = #{authUserId}
|
|
and authUserId = #{authUserId}
|
|
@@ -422,7 +423,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, productTypeId, name, image, createBy
|
|
|
|
|
|
+ select id as productId, brandId, productTypeId, name, image, createBy
|
|
from cm_brand_auth_product
|
|
from cm_brand_auth_product
|
|
where id = #{productId}
|
|
where id = #{productId}
|
|
</select>
|
|
</select>
|