|
@@ -4,10 +4,12 @@
|
|
<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,
|
|
insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lng, lat,
|
|
mobile, userMobile, firstClubType, secondClubType, medicalLicenseImage, empNum,
|
|
mobile, userMobile, firstClubType, secondClubType, medicalLicenseImage, empNum,
|
|
- logo, customFlag, remarks, status, createTime, createBy, auditStatus, shopAuditStatus, delFlag)
|
|
|
|
|
|
+ logo, customFlag, remarks, status, createTime, createBy, createSource, auditBy,
|
|
|
|
+ auditTime, auditStatus, shopAuditBy, shopAuditTime, shopAuditStatus, delFlag)
|
|
values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
|
|
values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
|
|
#{mobile}, #{userMobile}, #{firstClubType}, #{secondClubType}, #{medicalLicenseImage}, #{empNum},
|
|
#{mobile}, #{userMobile}, #{firstClubType}, #{secondClubType}, #{medicalLicenseImage}, #{empNum},
|
|
- #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{shopAuditStatus}, #{delFlag})
|
|
|
|
|
|
+ #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{createSource}, #{auditBy},
|
|
|
|
+ #{auditTime}, #{auditStatus}, #{shopAuditBy}, #{shopAuditTime}, #{shopAuditStatus}, #{delFlag});
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertBanner">
|
|
<insert id="insertBanner">
|
|
insert into cm_brand_auth_banner (authId, banner)
|
|
insert into cm_brand_auth_banner (authId, banner)
|
|
@@ -63,6 +65,7 @@
|
|
auditStatus = #{shopAuditStatus},
|
|
auditStatus = #{shopAuditStatus},
|
|
</if>
|
|
</if>
|
|
shopInvalidReason = #{shopInvalidReason},
|
|
shopInvalidReason = #{shopInvalidReason},
|
|
|
|
+ shopAuditBy = #{shopAuditBy},
|
|
shopAuditTime = #{shopAuditTime}
|
|
shopAuditTime = #{shopAuditTime}
|
|
where id = #{authId}
|
|
where id = #{authId}
|
|
</update>
|
|
</update>
|
|
@@ -75,19 +78,23 @@
|
|
delete from cm_brand_auth_banner where authId = #{authId}
|
|
delete from cm_brand_auth_banner where authId = #{authId}
|
|
</delete>
|
|
</delete>
|
|
<select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
|
|
<select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
|
|
- select id as authId, authParty, a.status, a.auditStatus, a.shopAuditStatus, a.createTime, cu.name as createBy,
|
|
|
|
- au.name as auditBy,a.auditTime,a.invalidReason,a.sendStatus,
|
|
|
|
|
|
+ select a.id as authId, authParty, cbcu2.mobile, a.status, a.auditStatus, a.shopAuditStatus, a.createTime,
|
|
|
|
+ if(a.createSource = 1,cu.name,cbcu1.mobile) as createBy,au.name as auditBy,a.auditTime,a.invalidReason,
|
|
|
|
+ a.sendStatus, au1.name as shopAuditBy,a.shopAuditTime,
|
|
ifnull(ap.waitAuditNum,0) as waitAuditNum,
|
|
ifnull(ap.waitAuditNum,0) as waitAuditNum,
|
|
ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
|
|
ifnull(bp.waitAuditNum,0) as shopWaitAuditNum,
|
|
if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus
|
|
if(ifnull(ap.waitAuditNum,0)>0,0,1) as lowerAuditStatus
|
|
from cm_brand_auth a
|
|
from cm_brand_auth a
|
|
left join cm_brand_auth_user cu on a.createBy = cu.authUserId
|
|
left join cm_brand_auth_user cu on a.createBy = cu.authUserId
|
|
|
|
+ left join cm_brand_club_user cbcu1 on a.createBy = cbcu1.id
|
|
left join cm_brand_auth_user au on a.auditBy = au.authUserId
|
|
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 authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 and shopAuditStatus = 1 group by
|
|
left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 and shopAuditStatus = 1 group by
|
|
authId) ap on a.id = ap.authId
|
|
authId) ap on a.id = ap.authId
|
|
left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where shopAuditStatus = 2 group by
|
|
left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where shopAuditStatus = 2 group by
|
|
authId) bp on a.id = bp.authId
|
|
authId) bp on a.id = bp.authId
|
|
- where a.authUserId = #{authUserId} and delFlag = 0
|
|
|
|
|
|
+ where a.authUserId = #{authUserId} and a.delFlag = 0
|
|
<if test="authParty != null and authParty != ''">
|
|
<if test="authParty != null and authParty != ''">
|
|
and a.authParty like CONCAT('%',#{authParty},'%')
|
|
and a.authParty like CONCAT('%',#{authParty},'%')
|
|
</if>
|
|
</if>
|
|
@@ -100,15 +107,18 @@
|
|
<if test="1 == listType or 2 == listType">
|
|
<if test="1 == listType or 2 == listType">
|
|
and a.shopAuditStatus = 1
|
|
and a.shopAuditStatus = 1
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">
|
|
|
|
+ and cbcu2.mobile like concat('%', #{mobile},'%')
|
|
|
|
+ </if>
|
|
<if test="4 == listType">
|
|
<if test="4 == listType">
|
|
and a.auditStatus = 1
|
|
and a.auditStatus = 1
|
|
</if>
|
|
</if>
|
|
<if test="shopAuditStatus != null">
|
|
<if test="shopAuditStatus != null">
|
|
<if test="0 == shopAuditStatus">
|
|
<if test="0 == shopAuditStatus">
|
|
- and (a.shopAuditStatus = 2 or ifnull(bp.waitAuditNum,0) > 0)
|
|
|
|
|
|
+ and (a.shopAuditStatus = 2 or (a.shopAuditStatus = 1 and ifnull(bp.waitAuditNum,0) > 0))
|
|
</if>
|
|
</if>
|
|
<if test="1 == shopAuditStatus">
|
|
<if test="1 == shopAuditStatus">
|
|
- and (a.shopAuditStatus = 0 or a.shopAuditStatus = 1 or ifnull(bp.waitAuditNum,0) > 0)
|
|
|
|
|
|
+ and (a.shopAuditStatus = 0 or (a.shopAuditStatus = 1 and ifnull(bp.waitAuditNum,0) = 0))
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
<if test="sendStatus != null">
|
|
<if test="sendStatus != null">
|
|
@@ -214,14 +224,15 @@
|
|
select provinceID from city where cityID = #{cityId}
|
|
select provinceID from city where cityID = #{cityId}
|
|
</select>
|
|
</select>
|
|
<select id="getAuthBaseInfo" resultType="com.caimei.model.vo.AuthFormVo">
|
|
<select id="getAuthBaseInfo" resultType="com.caimei.model.vo.AuthFormVo">
|
|
- select id as authId, authParty, auditStatus, shopAuditStatus
|
|
|
|
- from cm_brand_auth
|
|
|
|
|
|
+ select a.id as authId, authParty, auditStatus, shopAuditStatus,if(u.id is null,0,1) as bindStatus
|
|
|
|
+ from cm_brand_auth a
|
|
|
|
+ left join cm_brand_club_user u on a.id = u.authId
|
|
<where>
|
|
<where>
|
|
<if test="authUserId != null">
|
|
<if test="authUserId != null">
|
|
- and authUserId = #{authUserId}
|
|
|
|
|
|
+ and a.authUserId = #{authUserId}
|
|
</if>
|
|
</if>
|
|
<if test="authId != null">
|
|
<if test="authId != null">
|
|
- and id = #{authId}
|
|
|
|
|
|
+ and a.id = #{authId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|