|
@@ -1,17 +1,22 @@
|
|
|
<?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">
|
|
|
<mapper namespace="com.caimei.mapper.cmMapper.AuthMapper">
|
|
|
- <insert id="insertAuth" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandAuthPo">
|
|
|
+ <insert id="insertAuth" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
|
|
|
+ parameterType="com.caimei.model.po.CmBrandAuthPo">
|
|
|
insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lng, lat,
|
|
|
- mobile, userMobile, linkMan, linkMobile, firstClubType, secondClubType, medicalLicenseImage, empNum,
|
|
|
+ mobile, userMobile, linkMan, linkMobile, firstClubType, secondClubType,
|
|
|
+ medicalLicenseImage, empNum,
|
|
|
logo, customFlag, remarks, authCode, authDate, authImageLogo, authImage,
|
|
|
authImageType, status, createTime, createBy, createSource, auditBy,
|
|
|
- auditTime, auditStatus, shopAuditBy, shopAuditTime, shopAuditStatus, checkFlag, delFlag)
|
|
|
+ auditTime, auditStatus, shopAuditBy, shopAuditTime, shopAuditStatus, checkFlag,
|
|
|
+ delFlag)
|
|
|
values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
|
|
|
- #{mobile}, #{userMobile}, #{linkMan}, #{linkMobile}, #{firstClubType}, #{secondClubType}, #{medicalLicenseImage}, #{empNum},
|
|
|
+ #{mobile}, #{userMobile}, #{linkMan}, #{linkMobile}, #{firstClubType}, #{secondClubType},
|
|
|
+ #{medicalLicenseImage}, #{empNum},
|
|
|
#{logo}, #{customFlag}, #{remarks}, #{authCode}, #{authDate}, #{authImageLogo}, #{authImage},
|
|
|
#{authImageType}, #{status}, NOW(), #{createBy}, #{createSource}, #{auditBy},
|
|
|
- #{auditTime}, #{auditStatus}, #{shopAuditBy}, #{shopAuditTime}, #{shopAuditStatus}, #{checkFlag}, #{delFlag})
|
|
|
+ #{auditTime}, #{auditStatus}, #{shopAuditBy}, #{shopAuditTime}, #{shopAuditStatus}, #{checkFlag},
|
|
|
+ #{delFlag})
|
|
|
</insert>
|
|
|
<insert id="insertBanner">
|
|
|
insert into cm_brand_auth_banner (authId, banner)
|
|
@@ -50,7 +55,9 @@
|
|
|
status = #{status},
|
|
|
auditStatus = #{auditStatus},
|
|
|
shopAuditStatus = #{shopAuditStatus},
|
|
|
- checkFlag = #{checkFlag}
|
|
|
+ checkFlag = #{checkFlag},
|
|
|
+ relationId = #{relationId},
|
|
|
+ relationName = #{relationName}
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
<update id="updateAuthAuditStatus">
|
|
@@ -63,15 +70,19 @@
|
|
|
where id = #{authId}
|
|
|
</update>
|
|
|
<update id="deleteAuthByAuthId">
|
|
|
- update cm_brand_auth set delFlag = 1 where id = #{authId}
|
|
|
+ update cm_brand_auth
|
|
|
+ set delFlag = 1
|
|
|
+ where id = #{authId}
|
|
|
</update>
|
|
|
<update id="updateLdmLatestClubId">
|
|
|
- update ldm_latest_club_id set ldmClubId = #{ldmLatestClubId} where id = 1;
|
|
|
+ update ldm_latest_club_id
|
|
|
+ set ldmClubId = #{ldmLatestClubId}
|
|
|
+ where id = 1;
|
|
|
</update>
|
|
|
<update id="updateRemarks">
|
|
|
update cm_brand_auth
|
|
|
set customFlag = 1,
|
|
|
- remarks = #{remarks}
|
|
|
+ remarks = #{remarks}
|
|
|
where id = #{authId}
|
|
|
</update>
|
|
|
<update id="updateAuthShopAuditStatus">
|
|
@@ -103,19 +114,26 @@
|
|
|
</update>
|
|
|
<update id="starAuth">
|
|
|
update cm_brand_auth
|
|
|
- set starFlag = #{starFlag}
|
|
|
+ set starFlag = #{starFlag},
|
|
|
+ starNum=#{starNum}
|
|
|
where id = #{authId}
|
|
|
</update>
|
|
|
<update id="addScanCount">
|
|
|
- update cm_brand_auth set scanCount = scanCount + 1 where id = #{authId}
|
|
|
+ update cm_brand_auth
|
|
|
+ set scanCount = scanCount + 1
|
|
|
+ where id = #{authId}
|
|
|
</update>
|
|
|
<delete id="deleteBanner">
|
|
|
- delete from cm_brand_auth_banner where authId = #{authId}
|
|
|
+ delete
|
|
|
+ from cm_brand_auth_banner
|
|
|
+ where authId = #{authId}
|
|
|
</delete>
|
|
|
<select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
|
|
|
- select a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus, a.createTime,
|
|
|
- if(a.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu1.mobile) as createBy,ifnull(au.loginAccount,au.name) as auditBy,a.auditTime,a.invalidReason,
|
|
|
- ifnull(a.shopInvalidReason, a.invalidReason) as shopInvalidReason,
|
|
|
+ select a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
|
|
|
+ a.createTime,
|
|
|
+ if(a.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu1.mobile) as createBy,ifnull(au.loginAccount,au.name)
|
|
|
+ as auditBy,a.auditTime,a.invalidReason,
|
|
|
+ ifnull(a.shopInvalidReason, a.invalidReason) as shopInvalidReason,
|
|
|
a.sendStatus, ifnull(au1.loginAccount,au1.name) as shopAuditBy,a.shopAuditTime,
|
|
|
ifnull(ap.waitAuditNum,0) as waitAuditNum,
|
|
|
ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
|
|
@@ -128,14 +146,14 @@
|
|
|
left join cm_brand_auth_user au1 on a.shopAuditBy = au1.authUserId
|
|
|
left join cm_brand_club_user cbcu2 on a.id = cbcu2.authId and cbcu2.delFlag = 0
|
|
|
left join (select r.authId,count(*) as waitAuditNum from cm_brand_auth_product p
|
|
|
- left join cm_brand_product_relation r on p.id = r.productId
|
|
|
- where auditStatus = 2 and shopAuditStatus = 1 group by r.authId) ap on a.id = ap.authId
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId
|
|
|
+ where auditStatus = 2 and shopAuditStatus = 1 group by r.authId) ap on a.id = ap.authId
|
|
|
left join (select r.authId,count(*) as waitAuditNum from cm_brand_auth_product p
|
|
|
- left join cm_brand_product_relation r on p.id = r.productId
|
|
|
- where shopAuditStatus = 2 group by r.authId) bp on a.id = bp.authId
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId
|
|
|
+ where shopAuditStatus = 2 group by r.authId) bp on a.id = bp.authId
|
|
|
left join (select r.authId,count(*) as productNum from cm_brand_auth_product p
|
|
|
- left join cm_brand_product_relation r on p.id = r.productId and p.shopAuditStatus = 1 group by r.authId) cp
|
|
|
- on a.id = cp.authId
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId and p.shopAuditStatus = 1 group by r.authId) cp
|
|
|
+ on a.id = cp.authId
|
|
|
where a.authUserId = #{authUserId} and a.delFlag = 0
|
|
|
<if test="authParty != null and authParty != ''">
|
|
|
and a.authParty like CONCAT('%',#{authParty},'%')
|
|
@@ -184,19 +202,133 @@
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="listType == 2">
|
|
|
- order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc, a.createTime desc
|
|
|
+ order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc,
|
|
|
+ a.createTime desc
|
|
|
</when>
|
|
|
<when test="listType == 3">
|
|
|
- order by (case a.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc,shopWaitAuditNum desc, a.createTime desc
|
|
|
+ order by (case a.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc,shopWaitAuditNum desc,
|
|
|
+ a.createTime desc
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
order by a.createTime desc, a.id desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getAuthListAll" resultType="com.caimei.model.vo.AuthVo">
|
|
|
+ select DISTINCT a.id as authId, a.authUserId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus,
|
|
|
+ a.createTime,
|
|
|
+ if(a.createSource = 1,ifnull(cu.loginAccount, cu.name),cbcu1.mobile) as createBy,ifnull(au.loginAccount,au.name)
|
|
|
+ as auditBy,a.auditTime,a.invalidReason,
|
|
|
+ ifnull(a.shopInvalidReason, a.invalidReason) as shopInvalidReason,
|
|
|
+ a.sendStatus, ifnull(au1.loginAccount,au1.name) as shopAuditBy,a.shopAuditTime,
|
|
|
+ ifnull(ap.waitAuditNum,0) as waitAuditNum,
|
|
|
+ ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
|
|
|
+ if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus,
|
|
|
+ a.checkFlag,a.starFlag,a.scanCount,ifnull(cp.productNum,0) as productNum,
|
|
|
+ a.starNum,a.relationId,a.relationName
|
|
|
+ from cm_brand_auth a
|
|
|
+ left join cm_brand_auth_user cu on a.createBy = cu.authUserId
|
|
|
+ left join cm_brand_club_user cbcu1 on a.createBy = cbcu1.id and cbcu1.delFlag = 0
|
|
|
+ left join cm_brand_auth_user au on a.auditBy = au.authUserId
|
|
|
+ left join cm_brand_auth_user au1 on a.shopAuditBy = au1.authUserId
|
|
|
+ left join cm_brand_club_user cbcu2 on a.id = cbcu2.authId and cbcu2.delFlag = 0
|
|
|
+
|
|
|
+
|
|
|
+ left join (select r.authId,p.name,p.snCode,count(*) as waitAuditNum from cm_brand_auth_product p
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId
|
|
|
+ where auditStatus = 2 and shopAuditStatus = 1 group by r.authId) ap on a.id = ap.authId
|
|
|
+ left join (select r.authId,count(*) as waitAuditNum from cm_brand_auth_product p
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId
|
|
|
+ where shopAuditStatus = 2 group by r.authId) bp on a.id = bp.authId
|
|
|
+ left join (select r.authId,count(*) as productNum from cm_brand_auth_product p
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId and p.shopAuditStatus = 1 group by r.authId) cp
|
|
|
+ on a.id = cp.authId
|
|
|
+ LEFT JOIN (SELECT
|
|
|
+ r.authId,
|
|
|
+ if(p.name IS NULL,t.name,p.name) as productName,
|
|
|
+ p.snCode
|
|
|
+ FROM
|
|
|
+ cm_brand_auth_product p
|
|
|
+ LEFT JOIN cm_brand_product_relation r ON p.id = r.productId
|
|
|
+ LEFT JOIN cm_brand_auth aw on aw.id=r.authId
|
|
|
+ LEFT JOIN cm_brand_product_type t on p.productTypeId = t.id and t.delFlag = 0
|
|
|
+ where p.shopAuditStatus=1
|
|
|
+ ) dp on a.id = dp.authId
|
|
|
+ where a.authUserId = #{authUserId} and a.delFlag = 0
|
|
|
+ <if test="authParty != null and authParty != ''">
|
|
|
+ and a.authParty like CONCAT('%',#{authParty},'%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="starFlag != null">
|
|
|
+ and a.starFlag = #{starFlag}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus != null">
|
|
|
+ and a.auditStatus = #{auditStatus}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and dp.productName = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="snCode != null and snCode != ''">
|
|
|
+ and dp.snCode = #{snCode}
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+ <if test="1 == listType or 2 == listType">
|
|
|
+ and a.shopAuditStatus = 1
|
|
|
+ </if>
|
|
|
+ <if test="mobile != null and mobile != ''">
|
|
|
+ and cbcu2.mobile like concat('%', #{mobile},'%')
|
|
|
+ </if>
|
|
|
+ <if test="4 == listType">
|
|
|
+ and a.auditStatus = 1
|
|
|
+ </if>
|
|
|
+ <if test="shopAuditStatus != null">
|
|
|
+ <if test="0 == shopAuditStatus">
|
|
|
+ and (a.shopAuditStatus = 2 or (a.shopAuditStatus = 1 and ifnull(bp.waitAuditNum,0) > 0))
|
|
|
+ </if>
|
|
|
+ <if test="1 == shopAuditStatus">
|
|
|
+ and (a.shopAuditStatus = 0 or (a.shopAuditStatus = 1 and ifnull(bp.waitAuditNum,0) = 0))
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="sendStatus != null">
|
|
|
+ <if test="0 == sendStatus">
|
|
|
+ and a.sendStatus != 1
|
|
|
+ </if>
|
|
|
+ <if test="1 == sendStatus">
|
|
|
+ and a.sendStatus = 1
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="lowerAuditStatus != null">
|
|
|
+ <if test="0 == lowerAuditStatus">
|
|
|
+ and ifnull(ap.waitAuditNum,0) > 0
|
|
|
+ </if>
|
|
|
+ <if test="1 == lowerAuditStatus">
|
|
|
+ and ifnull(ap.waitAuditNum,0) = 0
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <choose>
|
|
|
+ <when test="listType == 2">
|
|
|
+ order by (case a.auditStatus when 2 then 2 when 0 then 1 else 0 end) desc,waitAuditNum desc,
|
|
|
+ a.createTime desc
|
|
|
+ </when>
|
|
|
+ <when test="listType == 3">
|
|
|
+ order by (case a.shopAuditStatus when 2 then 2 when 0 then 1 else 0 end) desc,shopWaitAuditNum desc,
|
|
|
+ a.createTime desc
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ order by a.createTime desc, a.id desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getProductWaitAuditNum" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
|
- from cm_brand_auth_product p left join cm_brand_product_relation r on p.id = r.productId
|
|
|
+ from cm_brand_auth_product p
|
|
|
+ left join cm_brand_product_relation r on p.id = r.productId
|
|
|
where r.authId = #{authId}
|
|
|
and p.auditStatus = 2
|
|
|
</select>
|
|
@@ -226,59 +358,89 @@
|
|
|
left join province p on a.provinceId = p.provinceID
|
|
|
left join city c on a.cityId = c.cityID
|
|
|
left join town t on a.townId = t.townID
|
|
|
- where a.delFlag = 0 and find_in_set(a.id, #{authIds})
|
|
|
+ where a.delFlag = 0
|
|
|
+ and find_in_set(a.id, #{authIds})
|
|
|
order by createTime desc
|
|
|
</select>
|
|
|
<select id="getBannerList" resultType="java.lang.String">
|
|
|
- select banner from cm_brand_auth_banner where authId = #{authId}
|
|
|
+ select banner
|
|
|
+ from cm_brand_auth_banner
|
|
|
+ where authId = #{authId}
|
|
|
</select>
|
|
|
<select id="getLdmData" resultType="com.caimei.model.po.LdmDataPo">
|
|
|
- select name as authParty,if(status = 1,1,0) as status,if(status = 1,1,0) as auditStatus,
|
|
|
- tel as mobile,addr as address,pic1,pic2,pic3,pic4,pic5,du as lngAndLat,
|
|
|
- if(deleted_at is null,0,1) as delFlag,regId1,regId2,regId3
|
|
|
+ select name as authParty,
|
|
|
+ if(status = 1, 1, 0) as status,
|
|
|
+ if(status = 1, 1, 0) as auditStatus,
|
|
|
+ tel as mobile,
|
|
|
+ addr as address,
|
|
|
+ pic1,
|
|
|
+ pic2,
|
|
|
+ pic3,
|
|
|
+ pic4,
|
|
|
+ pic5,
|
|
|
+ du as lngAndLat,
|
|
|
+ if(deleted_at is null, 0, 1) as delFlag,
|
|
|
+ regId1,
|
|
|
+ regId2,
|
|
|
+ regId3
|
|
|
from nissan_ht_alcohol;
|
|
|
</select>
|
|
|
<select id="getProvinceId" resultType="java.lang.Integer">
|
|
|
select provinceID
|
|
|
from province
|
|
|
where name like
|
|
|
- concat(#{provinceName},'%') limit 1;
|
|
|
+ concat(#{provinceName}, '%') limit 1;
|
|
|
</select>
|
|
|
<select id="getCityId" resultType="java.lang.Integer">
|
|
|
select cityID
|
|
|
from city
|
|
|
where name like
|
|
|
- concat(#{cityName},'%') limit 1;
|
|
|
+ concat(#{cityName}, '%') limit 1;
|
|
|
</select>
|
|
|
<select id="getTownId" resultType="java.lang.Integer">
|
|
|
select townID
|
|
|
from town
|
|
|
where name like
|
|
|
- concat(#{townName},'%') limit 1;
|
|
|
+ concat(#{townName}, '%') limit 1;
|
|
|
</select>
|
|
|
<select id="getLdmLatestClubId" resultType="java.lang.Integer">
|
|
|
- select ldmClubId from ldm_latest_club_id where id = 1;
|
|
|
+ select ldmClubId
|
|
|
+ from ldm_latest_club_id
|
|
|
+ where id = 1;
|
|
|
</select>
|
|
|
<select id="getCityIdByTownId" resultType="java.lang.Integer">
|
|
|
- select cityID from town where townID = #{townId}
|
|
|
+ select cityID
|
|
|
+ from town
|
|
|
+ where townID = #{townId}
|
|
|
</select>
|
|
|
<select id="getProvinceName" resultType="java.lang.String">
|
|
|
- select name from nissan_base_region1 where code = #{regId1} and level = 0 limit 1
|
|
|
+ select name
|
|
|
+ from nissan_base_region1
|
|
|
+ where code = #{regId1}
|
|
|
+ and level = 0 limit 1
|
|
|
</select>
|
|
|
<select id="getCityName" resultType="java.lang.String">
|
|
|
- select name from nissan_base_region1 where code = #{regId1} and level = 1 limit 1
|
|
|
+ select name
|
|
|
+ from nissan_base_region1
|
|
|
+ where code = #{regId1}
|
|
|
+ and level = 1 limit 1
|
|
|
</select>
|
|
|
<select id="getTownName" resultType="java.lang.String">
|
|
|
- select name from nissan_base_region1 where code = #{regId1} and level = 2 limit 1
|
|
|
+ select name
|
|
|
+ from nissan_base_region1
|
|
|
+ where code = #{regId1}
|
|
|
+ and level = 2 limit 1
|
|
|
</select>
|
|
|
<select id="getTownList" resultType="com.caimei.model.po.TownPo">
|
|
|
select townID as townId, cityID as cityId
|
|
|
from town
|
|
|
where name like
|
|
|
- concat(#{townName},'%');
|
|
|
+ concat(#{townName}, '%');
|
|
|
</select>
|
|
|
<select id="getProvinceIdByCityId" resultType="java.lang.Integer">
|
|
|
- select provinceID from city where cityID = #{cityId}
|
|
|
+ select provinceID
|
|
|
+ from city
|
|
|
+ where cityID = #{cityId}
|
|
|
</select>
|
|
|
<select id="getAuthBaseInfo" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
select a.id as authId, authParty, auditStatus, shopAuditStatus,if(u.id is null,0,1) as bindStatus
|
|
@@ -295,14 +457,14 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="getAuthById" resultType="com.caimei.model.vo.AuthVo">
|
|
|
- select id as authId,
|
|
|
+ select id as authId,
|
|
|
a.authUserId,
|
|
|
authParty,
|
|
|
a.status,
|
|
|
a.auditStatus,
|
|
|
a.createTime,
|
|
|
- cu.name as createBy,
|
|
|
- ifnull(au.loginAccount,au.name) as auditBy,
|
|
|
+ cu.name as createBy,
|
|
|
+ ifnull(au.loginAccount, au.name) as auditBy,
|
|
|
a.auditTime,
|
|
|
a.invalidReason
|
|
|
from cm_brand_auth a
|
|
@@ -340,23 +502,28 @@
|
|
|
authImageType,
|
|
|
status,
|
|
|
auditStatus,
|
|
|
+ relationId,
|
|
|
+ relationName,
|
|
|
if(shopAuditStatus = 0, shopInvalidReason, invalidReason) as invalidReason
|
|
|
from cm_brand_auth a
|
|
|
left join province p on a.provinceId = p.provinceID
|
|
|
left join city c on a.cityId = c.cityID
|
|
|
left join town t on a.townId = t.townID
|
|
|
- where id = #{authId} and a.delFlag = 0
|
|
|
+ where id = #{authId}
|
|
|
+ and a.delFlag = 0
|
|
|
</select>
|
|
|
<select id="getTownNames" resultType="java.lang.String">
|
|
|
- select name from town
|
|
|
+ select name
|
|
|
+ from town
|
|
|
</select>
|
|
|
<select id="getProvinceNames" resultType="java.lang.String">
|
|
|
- SELECT NAME FROM province
|
|
|
+ SELECT NAME
|
|
|
+ FROM province
|
|
|
</select>
|
|
|
<select id="getCityNames" resultType="java.lang.String">
|
|
|
select name from city
|
|
|
<if test="ProvinceId !=null">
|
|
|
- where provinceID = #{ProvinceId}
|
|
|
+ where provinceID = #{ProvinceId}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getCityIdByProvinceId" resultType="java.lang.Integer">
|
|
@@ -368,32 +535,36 @@
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getProvinceNameById" resultType="java.lang.String">
|
|
|
- select name from province
|
|
|
+ select name
|
|
|
+ from province
|
|
|
where provinceID = #{provinceId}
|
|
|
</select>
|
|
|
<select id="getCityNameByCityId" resultType="java.lang.String">
|
|
|
- select name from city
|
|
|
+ select name
|
|
|
+ from city
|
|
|
where cityID = #{cityId}
|
|
|
</select>
|
|
|
<select id="getTownNameById" resultType="java.lang.String">
|
|
|
- select name from town
|
|
|
+ select name
|
|
|
+ from town
|
|
|
where townID = #{townId}
|
|
|
</select>
|
|
|
<select id="getAuthByNameAndAddress" resultType="com.caimei.model.vo.AuthVo">
|
|
|
- select id as authId from cm_brand_auth
|
|
|
- where authParty like concat('%',#{authParty},'%') and address like concat('%',#{address},'%')
|
|
|
- and delFlag = 0
|
|
|
+ select id as authId
|
|
|
+ from cm_brand_auth
|
|
|
+ where authParty like concat('%', #{authParty}, '%')
|
|
|
+ and address like concat('%', #{address}, '%')
|
|
|
+ and delFlag = 0
|
|
|
</select>
|
|
|
<select id="getAdminUserId" resultType="java.lang.Integer">
|
|
|
select authUserId
|
|
|
from cm_brand_auth_user
|
|
|
- where userIdentity = 1
|
|
|
- limit 1
|
|
|
+ where userIdentity = 1 limit 1
|
|
|
</select>
|
|
|
<select id="getAuthTemplate" resultType="com.caimei.model.vo.TemplateVo">
|
|
|
select at.id as templateId, templateImage, qrPosition, qrSize
|
|
|
from cm_brand_auth_template at
|
|
|
- left join cm_brand_auth a on at.authUserId = a.authUserId and a.delFlag = 0
|
|
|
+ left join cm_brand_auth a on at.authUserId = a.authUserId and a.delFlag = 0
|
|
|
where at.status = 1
|
|
|
<if test="templateType == 1">
|
|
|
and at.authFlag = 1
|
|
@@ -415,4 +586,41 @@
|
|
|
where authUserId = #{authUserId}
|
|
|
and delFlag = 0
|
|
|
</select>
|
|
|
+ <select id="getAuthIdList" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
+ select id as authId,authParty from cm_brand_auth where
|
|
|
+ id in
|
|
|
+ <foreach collection="relationIdList" open="(" separator="," close=")" item="reId">
|
|
|
+ #{reId,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+ <select id="getRelationgInfo" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
+ select relationId, relationName
|
|
|
+ from cm_brand_auth
|
|
|
+ where authUserId = #{authUserId}
|
|
|
+ and id = #{authId}
|
|
|
+ and delFlag = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getClubBindAuth" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
+ select au.id as authId,au.authParty
|
|
|
+ from cm_brand_auth au
|
|
|
+ where au.id not in (
|
|
|
+ select cu.authId
|
|
|
+
|
|
|
+ from cm_brand_auth a
|
|
|
+ left join cm_brand_club_user cu on cu.authId = a.id
|
|
|
+ where cu.authUserId = #{authUserId}
|
|
|
+ and cu.delFlag = 0
|
|
|
+ and (a.id is null || a.delFlag = 0))
|
|
|
+ and au.delFlag = 0 and au.authUserId = #{authUserId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getRelationgList" resultType="com.caimei.model.vo.ProductFormVo">
|
|
|
+ select DISTINCT r.authId as relationId
|
|
|
+ from cm_brand_product_relation r
|
|
|
+ LEFT JOIN cm_brand_auth_product a on r.productId = a.id
|
|
|
+ where snCode =#{snCode}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|