|
@@ -1,26 +1,31 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!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(`infoId`, `productTypeId`, `snCode`, name, image, certificateImageType,
|
|
insert into cm_brand_auth_product(`infoId`, `productTypeId`, `snCode`, name, image, certificateImageType,
|
|
`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,authImageLogo,authDates)
|
|
|
|
|
|
+ createSource, authImageLogo, authDates)
|
|
values (#{infoId}, #{productTypeId}, #{snCode}, #{name}, #{image}, #{certificateImageType},
|
|
values (#{infoId}, #{productTypeId}, #{snCode}, #{name}, #{image}, #{certificateImageType},
|
|
#{certificateImage}, #{pcCertificateImage},
|
|
#{certificateImage}, #{pcCertificateImage},
|
|
#{appletsCertificateImage},
|
|
#{appletsCertificateImage},
|
|
#{purchaseWay}, #{invoiceImage}, #{status}, #{auditBy}, #{auditTime},
|
|
#{purchaseWay}, #{invoiceImage}, #{status}, #{auditBy}, #{auditTime},
|
|
- #{auditStatus}, #{shopAuditStatus}, #{checkFlag}, #{createTime}, #{createBy}, #{createSource},#{authImageLogo},#{authDate})
|
|
|
|
|
|
+ #{auditStatus}, #{shopAuditStatus}, #{checkFlag}, #{createTime}, #{createBy}, #{createSource},
|
|
|
|
+ #{authImageLogo}, #{authDate})
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertProductParam">
|
|
<insert id="insertProductParam">
|
|
insert into cm_brand_product_param (`productId`, `name`, `content`)
|
|
insert into cm_brand_product_param (`productId`, `name`, `content`)
|
|
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 into cm_brand_product_type (authUserId, infoId, name, image, pcImage, appletsImage, status, auditStatus, auditBy, auditTime, createBy, createSource, createTime, checkFlag, delFlag)
|
|
|
|
- values (#{authUserId}, #{infoId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus}, #{auditBy}, #{auditTime}, #{createBy}, #{createSource}, #{createTime}, #{checkFlag}, 0)
|
|
|
|
|
|
+ <insert id="insertProductType" keyColumn="id" keyProperty="productTypeId" useGeneratedKeys="true"
|
|
|
|
+ parameterType="com.caimei.model.po.ProductTypePo">
|
|
|
|
+ insert into cm_brand_product_type (authUserId, infoId, name, image, pcImage, appletsImage, status, auditStatus,
|
|
|
|
+ auditBy, auditTime, createBy, createSource, createTime, checkFlag, delFlag)
|
|
|
|
+ values (#{authUserId}, #{infoId}, #{name}, #{image}, #{pcImage}, #{appletsImage}, #{status}, #{auditStatus},
|
|
|
|
+ #{auditBy}, #{auditTime}, #{createBy}, #{createSource}, #{createTime}, #{checkFlag}, 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)
|
|
@@ -44,18 +49,18 @@
|
|
<update id="updateProductByProductId">
|
|
<update id="updateProductByProductId">
|
|
update cm_brand_auth_product
|
|
update cm_brand_auth_product
|
|
set
|
|
set
|
|
- `infoId` = #{infoId},
|
|
|
|
- `productTypeId` = #{productTypeId},
|
|
|
|
- `snCode` = #{snCode},
|
|
|
|
|
|
+ `infoId` = #{infoId},
|
|
|
|
+ `productTypeId` = #{productTypeId},
|
|
|
|
+ `snCode` = #{snCode},
|
|
`certificateImageType` = #{certificateImageType},
|
|
`certificateImageType` = #{certificateImageType},
|
|
`certificateImage` = #{certificateImage},
|
|
`certificateImage` = #{certificateImage},
|
|
authImageLogo=#{authImageLogo},
|
|
authImageLogo=#{authImageLogo},
|
|
authDates=#{authDate},
|
|
authDates=#{authDate},
|
|
<if test="pcCertificateImage != null and pcCertificateImage != ''">
|
|
<if test="pcCertificateImage != null and pcCertificateImage != ''">
|
|
- `pcCertificateImage` = #{pcCertificateImage},
|
|
|
|
|
|
+ `pcCertificateImage` = #{pcCertificateImage},
|
|
</if>
|
|
</if>
|
|
<if test="appletsCertificateImage != null and appletsCertificateImage != ''">
|
|
<if test="appletsCertificateImage != null and appletsCertificateImage != ''">
|
|
- `appletsCertificateImage` = #{appletsCertificateImage},
|
|
|
|
|
|
+ `appletsCertificateImage` = #{appletsCertificateImage},
|
|
</if>
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
name = #{name},
|
|
name = #{name},
|
|
@@ -66,12 +71,12 @@
|
|
name = null,
|
|
name = null,
|
|
image = null,
|
|
image = null,
|
|
</if>
|
|
</if>
|
|
- purchaseWay = #{purchaseWay},
|
|
|
|
- invoiceImage = #{invoiceImage},
|
|
|
|
- `status` = #{status},
|
|
|
|
- `auditStatus` = #{auditStatus},
|
|
|
|
- `shopAuditStatus` = #{shopAuditStatus},
|
|
|
|
- checkFlag = #{checkFlag}
|
|
|
|
|
|
+ purchaseWay = #{purchaseWay},
|
|
|
|
+ invoiceImage = #{invoiceImage},
|
|
|
|
+ `status` = #{status},
|
|
|
|
+ `auditStatus` = #{auditStatus},
|
|
|
|
+ `shopAuditStatus` = #{shopAuditStatus},
|
|
|
|
+ checkFlag = #{checkFlag}
|
|
where id = #{productId};
|
|
where id = #{productId};
|
|
</update>
|
|
</update>
|
|
<update id="updateImageByProductId">
|
|
<update id="updateImageByProductId">
|
|
@@ -98,15 +103,14 @@
|
|
</update>
|
|
</update>
|
|
<update id="updateCertificateImage">
|
|
<update id="updateCertificateImage">
|
|
update cm_brand_auth_product
|
|
update cm_brand_auth_product
|
|
- set certificateImage = #{certificateImage},
|
|
|
|
- pcCertificateImage = #{pcCertificateImage},
|
|
|
|
|
|
+ set certificateImage = #{certificateImage},
|
|
|
|
+ pcCertificateImage = #{pcCertificateImage},
|
|
appletsCertificateImage = #{appletsCertificateImage}
|
|
appletsCertificateImage = #{appletsCertificateImage}
|
|
where id = #{productId}
|
|
where id = #{productId}
|
|
</update>
|
|
</update>
|
|
<update id="updateAuthImageLogo">
|
|
<update id="updateAuthImageLogo">
|
|
update cm_brand_auth_product
|
|
update cm_brand_auth_product
|
|
- set
|
|
|
|
- authImageLogo=#{authImageLogo}
|
|
|
|
|
|
+ set authImageLogo=#{authImageLogo}
|
|
where id = #{productId}
|
|
where id = #{productId}
|
|
</update>
|
|
</update>
|
|
<update id="updateProductType">
|
|
<update id="updateProductType">
|
|
@@ -140,16 +144,24 @@
|
|
where id = #{productTypeId}
|
|
where id = #{productTypeId}
|
|
</update>
|
|
</update>
|
|
<delete id="deleteProductByProductId">
|
|
<delete id="deleteProductByProductId">
|
|
- delete from cm_brand_auth_product where id = #{productId}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from cm_brand_auth_product
|
|
|
|
+ where id = #{productId}
|
|
</delete>
|
|
</delete>
|
|
<delete id="deleteParamsByProductId">
|
|
<delete id="deleteParamsByProductId">
|
|
- delete from cm_brand_product_param where productId = #{productId}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from cm_brand_product_param
|
|
|
|
+ where productId = #{productId}
|
|
</delete>
|
|
</delete>
|
|
<delete id="deleteParamsByProductTypeId">
|
|
<delete id="deleteParamsByProductTypeId">
|
|
- delete from cm_brand_product_type_param where productTypeId = #{productTypeId}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from cm_brand_product_type_param
|
|
|
|
+ where productTypeId = #{productTypeId}
|
|
</delete>
|
|
</delete>
|
|
<update id="deleteProductType">
|
|
<update id="deleteProductType">
|
|
- update cm_brand_product_type set delFlag = 1 where id = #{productTypeId}
|
|
|
|
|
|
+ update cm_brand_product_type
|
|
|
|
+ set delFlag = 1
|
|
|
|
+ where id = #{productTypeId}
|
|
</update>
|
|
</update>
|
|
<update id="updateProductShopAuditStatus">
|
|
<update id="updateProductShopAuditStatus">
|
|
update cm_brand_auth_product
|
|
update cm_brand_auth_product
|
|
@@ -167,7 +179,9 @@
|
|
where id = #{productId}
|
|
where id = #{productId}
|
|
</update>
|
|
</update>
|
|
<update id="checkAuthProduct">
|
|
<update id="checkAuthProduct">
|
|
- update cm_brand_auth_product set checkFlag = 1 where id = #{productId}
|
|
|
|
|
|
+ update cm_brand_auth_product
|
|
|
|
+ set checkFlag = 1
|
|
|
|
+ where id = #{productId}
|
|
</update>
|
|
</update>
|
|
<update id="updateProductRelation">
|
|
<update id="updateProductRelation">
|
|
update cm_brand_product_relation
|
|
update cm_brand_product_relation
|
|
@@ -177,7 +191,9 @@
|
|
where id = #{relationId}
|
|
where id = #{relationId}
|
|
</update>
|
|
</update>
|
|
<update id="checkProductType">
|
|
<update id="checkProductType">
|
|
- update cm_brand_product_type set checkFlag = 1 where id = #{productTypeId}
|
|
|
|
|
|
+ update cm_brand_product_type
|
|
|
|
+ set checkFlag = 1
|
|
|
|
+ where id = #{productTypeId}
|
|
</update>
|
|
</update>
|
|
<select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
|
|
<select id="getProductList" resultType="com.caimei.model.vo.ProductListVo">
|
|
select r.id as relationId,p.id as productId,a.authUserId, if(p.productTypeId is null,p.name,t.name) as
|
|
select r.id as relationId,p.id as productId,a.authUserId, if(p.productTypeId is null,p.name,t.name) as
|
|
@@ -232,7 +248,11 @@
|
|
</choose>
|
|
</choose>
|
|
</select>
|
|
</select>
|
|
<select id="getProductIdBySnCode" resultType="java.lang.Integer">
|
|
<select id="getProductIdBySnCode" resultType="java.lang.Integer">
|
|
- select id from cm_brand_auth_product where snCode = #{snCode} limit 1
|
|
|
|
|
|
+ select id
|
|
|
|
+ from cm_brand_auth_product
|
|
|
|
+ where snCode = #{snCode}
|
|
|
|
+ and productTypeId = #{productTypeId}
|
|
|
|
+ limit 1
|
|
</select>
|
|
</select>
|
|
<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,
|
|
@@ -388,11 +408,12 @@
|
|
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
|
|
|
|
|
|
+ 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
|
|
- 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
|
|
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">
|
|
@@ -443,7 +464,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, infoId, i.brandName, t.name, image, pcImage, appletsImage, t.authUserId, t.auditStatus, createBy
|
|
|
|
|
|
+ select t.id as productTypeId, infoId, i.brandName, t.name, image, pcImage, appletsImage, t.authUserId,
|
|
|
|
+ t.auditStatus, createBy
|
|
from cm_brand_product_type t left join cm_brand_auth_shop_info i on t.infoId = i.id
|
|
from cm_brand_product_type t left join cm_brand_auth_shop_info i on t.infoId = i.id
|
|
<where>
|
|
<where>
|
|
t.delFlag = 0
|
|
t.delFlag = 0
|
|
@@ -460,7 +482,9 @@
|
|
limit 1
|
|
limit 1
|
|
</select>
|
|
</select>
|
|
<select id="getProductCountByTypeId" resultType="java.lang.Integer">
|
|
<select id="getProductCountByTypeId" resultType="java.lang.Integer">
|
|
- 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, infoId, productTypeId, name, image, createBy
|
|
select id as productId, infoId, productTypeId, name, image, createBy
|
|
@@ -472,8 +496,9 @@
|
|
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 r.authId = a.id
|
|
left join cm_brand_auth a on r.authId = a.id
|
|
- where p.id = #{productId} and a.delFlag = 0
|
|
|
|
- limit 1
|
|
|
|
|
|
+ where p.id = #{productId}
|
|
|
|
+ and a.delFlag = 0
|
|
|
|
+ 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
|
|
@@ -513,7 +538,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getSnCodeList" resultType="com.caimei.model.vo.ProductListVo">
|
|
<select id="getSnCodeList" resultType="com.caimei.model.vo.ProductListVo">
|
|
- select p.id as productId,p.productTypeId as productTypeId,t.name as productName,snCode,a.authParty as
|
|
|
|
|
|
+ select p.id as productId,p.productTypeId as productTypeId,t.name as productName,snCode,a.authParty as
|
|
authParty
|
|
authParty
|
|
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
|
|
@@ -538,7 +563,7 @@
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
<if test="relationIdList != null and relationIdList.length>0">
|
|
<if test="relationIdList != null and relationIdList.length>0">
|
|
- and a.id in
|
|
|
|
|
|
+ and a.id in
|
|
<foreach collection="relationIdList" open="(" separator="," close=")" item="reId">
|
|
<foreach collection="relationIdList" open="(" separator="," close=")" item="reId">
|
|
#{reId,jdbcType=VARCHAR}
|
|
#{reId,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</foreach>
|
|
@@ -549,24 +574,25 @@
|
|
select a.id as authId, a.authParty, a.logo
|
|
select a.id as authId, a.authParty, a.logo
|
|
from cm_brand_auth a
|
|
from cm_brand_auth a
|
|
left join cm_brand_product_relation r on a.id = r.authId
|
|
left join cm_brand_product_relation r on a.id = r.authId
|
|
- where r.productId = #{productId} and a.delFlag = 0
|
|
|
|
|
|
+ where r.productId = #{productId}
|
|
|
|
+ and a.delFlag = 0
|
|
</select>
|
|
</select>
|
|
<select id="getRelationId" resultType="java.lang.String">
|
|
<select id="getRelationId" resultType="java.lang.String">
|
|
select a.relationId
|
|
select a.relationId
|
|
from cm_brand_auth a
|
|
from cm_brand_auth a
|
|
- where a.id=#{authId}
|
|
|
|
|
|
+ where a.id = #{authId}
|
|
</select>
|
|
</select>
|
|
<select id="getSnList" resultType="com.caimei.model.po.ProductPo">
|
|
<select id="getSnList" resultType="com.caimei.model.po.ProductPo">
|
|
select a.id as productId
|
|
select a.id as productId
|
|
from cm_brand_auth_product a
|
|
from cm_brand_auth_product a
|
|
- where a.snCode=#{sn}
|
|
|
|
|
|
+ where a.snCode = #{sn}
|
|
</select>
|
|
</select>
|
|
- <select id="getAllSn" resultType="java.lang.Integer">
|
|
|
|
|
|
+ <select id="getAllSn" resultType="java.lang.Integer">
|
|
select a.productId
|
|
select a.productId
|
|
from cm_brand_product_relation a
|
|
from cm_brand_product_relation a
|
|
- where a.authId=#{authId}
|
|
|
|
|
|
+ where a.authId = #{authId}
|
|
</select>
|
|
</select>
|
|
- <select id="getAllSnlist" resultType="java.lang.String">
|
|
|
|
|
|
+ <select id="getAllSnlist" resultType="java.lang.String">
|
|
select a.snCode
|
|
select a.snCode
|
|
from cm_brand_auth_product a where a.id in
|
|
from cm_brand_auth_product a where a.id in
|
|
<foreach collection="productIdList" open="(" separator="," close=")" item="reId">
|
|
<foreach collection="productIdList" open="(" separator="," close=")" item="reId">
|
|
@@ -574,13 +600,27 @@
|
|
</foreach>
|
|
</foreach>
|
|
</select>
|
|
</select>
|
|
<select id="getPronductInfo" resultType="com.caimei.model.vo.ProductListVo">
|
|
<select id="getPronductInfo" resultType="com.caimei.model.vo.ProductListVo">
|
|
- select r.id as relationId,p.id as productId,a.authUserId, if(p.productTypeId is null,p.name,t.name) as
|
|
|
|
- productName,t.image,
|
|
|
|
- snCode,p.status,p.auditStatus,p.shopAuditStatus, p.createTime,
|
|
|
|
- if(p.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu.mobile) as createBy,
|
|
|
|
- ifnull(au.loginAccount,au.name) as
|
|
|
|
- auditBy,p.auditTime,p.invalidReason,ifnull(p.shopInvalidReason,p.invalidReason) as shopInvalidReason,
|
|
|
|
- ifnull(au1.loginAccount,au1.name) as shopAuditBy, p.shopAuditTime, p.checkFlag, p.scanCount
|
|
|
|
|
|
+ select r.id as relationId,
|
|
|
|
+ p.id as productId,
|
|
|
|
+ a.authUserId,
|
|
|
|
+ if(p.productTypeId is null, p.name, t.name) as
|
|
|
|
+ productName,
|
|
|
|
+ t.image,
|
|
|
|
+ snCode,
|
|
|
|
+ p.status,
|
|
|
|
+ p.auditStatus,
|
|
|
|
+ p.shopAuditStatus,
|
|
|
|
+ p.createTime,
|
|
|
|
+ if(p.createSource = 1, ifnull(cu.loginAccount, cu.name), cbcu.mobile) as createBy,
|
|
|
|
+ ifnull(au.loginAccount, au.name) as
|
|
|
|
+ auditBy,
|
|
|
|
+ p.auditTime,
|
|
|
|
+ p.invalidReason,
|
|
|
|
+ ifnull(p.shopInvalidReason, p.invalidReason) as shopInvalidReason,
|
|
|
|
+ ifnull(au1.loginAccount, au1.name) as shopAuditBy,
|
|
|
|
+ p.shopAuditTime,
|
|
|
|
+ p.checkFlag,
|
|
|
|
+ p.scanCount
|
|
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 r.authId = a.id and a.delFlag = 0
|
|
left join cm_brand_auth a on r.authId = a.id and a.delFlag = 0
|
|
@@ -589,16 +629,21 @@
|
|
left join cm_brand_auth_user au on p.auditBy = au.authUserId
|
|
left join cm_brand_auth_user au on p.auditBy = au.authUserId
|
|
left join cm_brand_auth_user au1 on p.shopAuditBy = au1.authUserId
|
|
left join cm_brand_auth_user au1 on p.shopAuditBy = au1.authUserId
|
|
left join cm_brand_club_user cbcu on p.createBy = cbcu.id and cbcu.delFlag = 0
|
|
left join cm_brand_club_user cbcu on p.createBy = cbcu.id and cbcu.delFlag = 0
|
|
- where a.id = #{authId} and a.authUserId=#{authUserId} and p.shopAuditStatus=1
|
|
|
|
|
|
+ where a.id = #{authId}
|
|
|
|
+ and a.authUserId = #{authUserId}
|
|
|
|
+ and p.shopAuditStatus = 1
|
|
</select>
|
|
</select>
|
|
<select id="getNewestRelationId" resultType="java.lang.Integer">
|
|
<select id="getNewestRelationId" resultType="java.lang.Integer">
|
|
- select id from cm_brand_product_relation order by id desc limit 1
|
|
|
|
|
|
+ select id
|
|
|
|
+ from cm_brand_product_relation
|
|
|
|
+ order by id desc
|
|
|
|
+ limit 1
|
|
</select>
|
|
</select>
|
|
<select id="findProductByQr" resultType="java.lang.Integer">
|
|
<select id="findProductByQr" resultType="java.lang.Integer">
|
|
SELECT cap.id
|
|
SELECT cap.id
|
|
FROM cm_brand_auth_product cap
|
|
FROM cm_brand_auth_product cap
|
|
- LEFT JOIN cm_brand_product_relation cbr ON cap.id = cbr.productId
|
|
|
|
- LEFT JOIN cm_brand_auth_qrcode cbq ON cbq.authId = cbr.authId
|
|
|
|
|
|
+ LEFT JOIN cm_brand_product_relation cbr ON cap.id = cbr.productId
|
|
|
|
+ LEFT JOIN cm_brand_auth_qrcode cbq ON cbq.authId = cbr.authId
|
|
WHERE cbq.id = #{substring}
|
|
WHERE cbq.id = #{substring}
|
|
LIMIT 1
|
|
LIMIT 1
|
|
</select>
|
|
</select>
|