|
@@ -3,9 +3,11 @@
|
|
<mapper namespace="com.caimei.mapper.cmMapper.AuthMapper">
|
|
<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,
|
|
insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lng, lat,
|
|
- mobile, logo, customFlag, remarks, status, createTime, createBy, auditStatus, delFlag)
|
|
|
|
|
|
+ mobile, userMobile, firstClubType, secondClubType, medicalLicenseImage, empNum,
|
|
|
|
+ logo, customFlag, remarks, status, createTime, createBy, auditStatus, shopAuditStatus, delFlag)
|
|
values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
|
|
values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lng}, #{lat},
|
|
- #{mobile}, #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{delFlag})
|
|
|
|
|
|
+ #{mobile}, #{userMobile}, #{firstClubType}, #{secondClubType}, #{medicalLicenseImage}, #{empNum},
|
|
|
|
+ #{logo}, #{customFlag}, #{remarks}, #{status}, NOW(), #{createBy}, #{auditStatus}, #{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)
|
|
@@ -18,19 +20,23 @@
|
|
</update>
|
|
</update>
|
|
<update id="updateAuthByAuthId">
|
|
<update id="updateAuthByAuthId">
|
|
update cm_brand_auth
|
|
update cm_brand_auth
|
|
- set authParty = #{authParty},
|
|
|
|
- provinceId = #{provinceId},
|
|
|
|
- cityId = #{cityId},
|
|
|
|
- townId = #{townId},
|
|
|
|
- address = #{address},
|
|
|
|
- lng = #{lng},
|
|
|
|
- lat = #{lat},
|
|
|
|
- mobile = #{mobile},
|
|
|
|
- logo = #{logo},
|
|
|
|
- customFlag = #{customFlag},
|
|
|
|
- remarks = #{remarks},
|
|
|
|
- status = #{status},
|
|
|
|
- auditStatus = #{auditStatus}
|
|
|
|
|
|
+ set authParty = #{authParty},
|
|
|
|
+ provinceId = #{provinceId},
|
|
|
|
+ cityId = #{cityId},
|
|
|
|
+ townId = #{townId},
|
|
|
|
+ address = #{address},
|
|
|
|
+ lng = #{lng},
|
|
|
|
+ lat = #{lat},
|
|
|
|
+ mobile = #{mobile},
|
|
|
|
+ userMobile = #{userMobile},
|
|
|
|
+ firstClubType = #{firstClubType},
|
|
|
|
+ secondClubType = #{secondClubType},
|
|
|
|
+ logo = #{logo},
|
|
|
|
+ customFlag = #{customFlag},
|
|
|
|
+ remarks = #{remarks},
|
|
|
|
+ status = #{status},
|
|
|
|
+ auditStatus = #{auditStatus},
|
|
|
|
+ shopAuditStatus = #{shopAuditStatus}
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</update>
|
|
</update>
|
|
<update id="updateAuthAuditStatus">
|
|
<update id="updateAuthAuditStatus">
|
|
@@ -48,19 +54,29 @@
|
|
<update id="updateLdmLatestClubId">
|
|
<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>
|
|
|
|
+ <update id="updateAuthShopAuditStatus">
|
|
|
|
+ update cm_brand_auth
|
|
|
|
+ set shopAuditStatus = #{shopAuditStatus},
|
|
|
|
+ shopInvalidReason = #{shopInvalidReason},
|
|
|
|
+ shopAuditTime = #{shopAuditTime}
|
|
|
|
+ where id = #{authId}
|
|
|
|
+ </update>
|
|
<delete id="deleteBanner">
|
|
<delete id="deleteBanner">
|
|
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.createTime, cu.name as createBy,
|
|
|
|
|
|
+ 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,
|
|
au.name as auditBy,a.auditTime,a.invalidReason,
|
|
ifnull(ap.waitAuditNum,0) as waitAuditNum,
|
|
ifnull(ap.waitAuditNum,0) as waitAuditNum,
|
|
|
|
+ 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_auth_user au on a.auditBy = au.authUserId
|
|
left join cm_brand_auth_user au on a.auditBy = au.authUserId
|
|
left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 group by
|
|
left join (select authId,count(*) as waitAuditNum from cm_brand_auth_product where auditStatus = 2 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
|
|
|
|
+ authId) bp on a.id = bp.authId
|
|
where a.authUserId = #{authUserId} and delFlag = 0
|
|
where a.authUserId = #{authUserId} and 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},'%')
|
|
@@ -71,6 +87,20 @@
|
|
<if test="auditStatus != null">
|
|
<if test="auditStatus != null">
|
|
and a.auditStatus = #{auditStatus}
|
|
and a.auditStatus = #{auditStatus}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="1 == listType or 2 == listType">
|
|
|
|
+ and a.shopAuditStatus = 1
|
|
|
|
+ </if>
|
|
|
|
+ <if test="4 == listType">
|
|
|
|
+ and a.auditStatus = 1
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shopAuditStatus != null">
|
|
|
|
+ <if test="0 == shopAuditStatus">
|
|
|
|
+ and (a.shopAuditStatus = 2 or ifnull(bp.waitAuditNum,0) > 0)
|
|
|
|
+ </if>
|
|
|
|
+ <if test="1 == shopAuditStatus">
|
|
|
|
+ and (a.shopAuditStatus = 0 or a.shopAuditStatus = 1 or ifnull(bp.waitAuditNum,0) > 0)
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
<if test="lowerAuditStatus != null">
|
|
<if test="lowerAuditStatus != null">
|
|
<if test="0 == lowerAuditStatus">
|
|
<if test="0 == lowerAuditStatus">
|
|
and ifnull(ap.waitAuditNum,0) > 0
|
|
and ifnull(ap.waitAuditNum,0) > 0
|
|
@@ -83,6 +113,9 @@
|
|
<when test="listType == 2">
|
|
<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>
|
|
|
|
+ <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>
|
|
<otherwise>
|
|
order by a.createTime desc, a.id desc
|
|
order by a.createTime desc, a.id desc
|
|
</otherwise>
|
|
</otherwise>
|
|
@@ -99,28 +132,6 @@
|
|
from cm_brand_auth
|
|
from cm_brand_auth
|
|
where id = #{authId}
|
|
where id = #{authId}
|
|
</select>
|
|
</select>
|
|
- <select id="getAuthById" resultType="com.caimei.model.po.CmBrandAuthPo">
|
|
|
|
- select id,
|
|
|
|
- authParty,
|
|
|
|
- authUserId,
|
|
|
|
- a.provinceId,
|
|
|
|
- a.cityId,
|
|
|
|
- a.townId,
|
|
|
|
- concat(p.name, '/', c.name, '/', t.name) as area,
|
|
|
|
- address,
|
|
|
|
- lng,
|
|
|
|
- lat,
|
|
|
|
- mobile,
|
|
|
|
- logo,
|
|
|
|
- customFlag,
|
|
|
|
- remarks,
|
|
|
|
- status
|
|
|
|
- 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}
|
|
|
|
- </select>
|
|
|
|
<select id="getAuthIdByAuthParty" resultType="java.lang.Integer">
|
|
<select id="getAuthIdByAuthParty" resultType="java.lang.Integer">
|
|
select id
|
|
select id
|
|
from cm_brand_auth
|
|
from cm_brand_auth
|
|
@@ -184,4 +195,57 @@
|
|
<select id="getProvinceIdByCityId" resultType="java.lang.Integer">
|
|
<select id="getProvinceIdByCityId" resultType="java.lang.Integer">
|
|
select provinceID from city where cityID = #{cityId}
|
|
select provinceID from city where cityID = #{cityId}
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getAuthByUserMobile" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
|
+ select id as authId, authParty
|
|
|
|
+ from cm_brand_auth
|
|
|
|
+ where authUserId = #{authUserId}
|
|
|
|
+ and userMobile = #{mobile}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getAuthById" resultType="com.caimei.model.vo.AuthVo">
|
|
|
|
+ select id as authId,
|
|
|
|
+ a.authUserId,
|
|
|
|
+ authParty,
|
|
|
|
+ a.status,
|
|
|
|
+ a.auditStatus,
|
|
|
|
+ a.createTime,
|
|
|
|
+ cu.name as createBy,
|
|
|
|
+ au.name as auditBy,
|
|
|
|
+ a.auditTime,
|
|
|
|
+ a.invalidReason
|
|
|
|
+ from cm_brand_auth a
|
|
|
|
+ left join cm_brand_auth_user cu on a.createBy = cu.authUserId
|
|
|
|
+ left join cm_brand_auth_user au on a.auditBy = au.authUserId
|
|
|
|
+ where a.delFlag = 0
|
|
|
|
+ and a.id = #{authId}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="getAuthFormById" resultType="com.caimei.model.vo.AuthFormVo">
|
|
|
|
+ select id as authId,
|
|
|
|
+ authParty,
|
|
|
|
+ authUserId,
|
|
|
|
+ a.provinceId,
|
|
|
|
+ a.cityId,
|
|
|
|
+ a.townId,
|
|
|
|
+ concat(p.name, '/', c.name, '/', t.name) as area,
|
|
|
|
+ address,
|
|
|
|
+ lng,
|
|
|
|
+ lat,
|
|
|
|
+ mobile,
|
|
|
|
+ userMobile,
|
|
|
|
+ firstClubType,
|
|
|
|
+ secondClubType,
|
|
|
|
+ medicalLicenseImage,
|
|
|
|
+ empNum,
|
|
|
|
+ logo,
|
|
|
|
+ customFlag,
|
|
|
|
+ remarks,
|
|
|
|
+ status,
|
|
|
|
+ auditStatus,
|
|
|
|
+ shopAuditStatus,
|
|
|
|
+ shopInvalidReason
|
|
|
|
+ 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}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|