|
@@ -98,6 +98,139 @@
|
|
|
user.openId
|
|
|
</sql>
|
|
|
|
|
|
+ <select id="findLabels" resultType="com.caimei365.manager.entity.caimei.cmUser.CmClubLabel">
|
|
|
+ SELECT label, dynamicStatus
|
|
|
+ FROM cm_club_label
|
|
|
+ where dynamicStatus = #{dynamicStatus}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findClubList" resultType="com.caimei365.manager.entity.caimei.cmUser.CmClub">
|
|
|
+ SELECT
|
|
|
+ a.checkMan as "checkMan",
|
|
|
+ a.clubID AS "clubId",
|
|
|
+ a.userID AS "userId",
|
|
|
+ u.name AS "name",
|
|
|
+ a.sname AS "sname",
|
|
|
+ a.logo AS "logo",
|
|
|
+ a.legalPerson AS "legalPerson",
|
|
|
+ a.provinceID AS "provinceId",
|
|
|
+ a.cityID AS "cityId",
|
|
|
+ a.townID AS "townId",
|
|
|
+ a.flag AS "flag",
|
|
|
+ a.spID AS "spId",
|
|
|
+ a.mainServiceProviderID AS "mainServiceProviderId",
|
|
|
+ a.scanTime AS "scanTime",
|
|
|
+ a.address AS "address",
|
|
|
+ a.linkMan AS "linkMan",
|
|
|
+ a.linkManIdentity AS "linkManIdentity",
|
|
|
+ a.contractPhone AS "contractPhone",
|
|
|
+ a.contractMobile AS "contractMobile",
|
|
|
+ a.fax AS "fax",
|
|
|
+ a.info AS "info",
|
|
|
+ a.addTime AS "addTime",
|
|
|
+ a.auditTime AS "auditTime",
|
|
|
+ a.auditNote AS "auditNote",
|
|
|
+ a.status AS "status",
|
|
|
+ a.businessLicenseImage AS "businessLicenseImage",
|
|
|
+ a.mainpro AS "mainpro",
|
|
|
+ a.scanFlag AS "scanFlag",
|
|
|
+ a.headpic AS "headpic",
|
|
|
+ a.socialCreditCode AS "socialCreditCode",
|
|
|
+ a.lastModify AS "lastModify",
|
|
|
+ a.firstClubType AS "firstClubType",
|
|
|
+ a.secondClubType AS "secondClubType",
|
|
|
+ a.department AS "department",
|
|
|
+ a.medicalPracticeLicenseImg AS "medicalPracticeLicenseImg",
|
|
|
+ a.newDeal as "newDeal",
|
|
|
+ case sp.status when 91 then '采美默认协销经理(官方账号)' else sp.linkMan end AS "spName",
|
|
|
+ d.name AS "province",
|
|
|
+ c.name AS "city",
|
|
|
+ b.name AS "town",
|
|
|
+ u.account AS "account",
|
|
|
+ u.registerTime AS "registerTime",
|
|
|
+ u.registerIP AS "registerIP",
|
|
|
+ u.userName AS "userName",
|
|
|
+ u.bindMobile AS "bindMobile",
|
|
|
+ u.email AS "email",
|
|
|
+ u.userOrganizeID AS "userOrganizeId",
|
|
|
+ u.userIdentity AS "userIdentity",
|
|
|
+ if(csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime,1,0) as svipUserFlag,
|
|
|
+ u.source,
|
|
|
+ u.loginTime
|
|
|
+ FROM club a
|
|
|
+ LEFT JOIN user u ON u.userID = a.userID
|
|
|
+ LEFT JOIN cm_svip_user csu ON csu.userId = u.userID
|
|
|
+ LEFT JOIN serviceprovider sp ON sp.serviceProviderID = a.spID
|
|
|
+ LEFT JOIN town b ON b.townID=a.townID
|
|
|
+ LEFT JOIN city c ON c.cityID=a.cityID
|
|
|
+ LEFT JOIN province d ON d.provinceID=a.provinceID
|
|
|
+ <where>
|
|
|
+ u.userOrganizeID != 4 AND u.userIdentity != 8
|
|
|
+ <if test="userOrganizeId == null">
|
|
|
+ AND (u.userOrganizeID IN(0,1,5) or u.clubStatus != 92)
|
|
|
+ </if>
|
|
|
+ <if test="userOrganizeId != null">
|
|
|
+ AND u.userOrganizeID = #{userOrganizeId}
|
|
|
+ </if>
|
|
|
+ <if test="clubId != null and clubId != ''">
|
|
|
+ AND a.clubID = #{clubId}
|
|
|
+ </if>
|
|
|
+ <if test="clubId == 0">
|
|
|
+ AND a.clubID = #{clubId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ AND a.userID = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="account != null and account != ''">
|
|
|
+ AND u.account = #{account}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND u.name LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ AND u.userName LIKE concat('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="townId != null and townId != ''">
|
|
|
+ AND d.provinceID = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != ''">
|
|
|
+ AND c.cityID = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="townId != null and townId != ''">
|
|
|
+ AND b.townID = #{townId}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND a.status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="bindMobile != null and bindMobile != ''">
|
|
|
+ AND u.bindMobile LIKE concat('%',#{bindMobile},'%')
|
|
|
+ </if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">
|
|
|
+ AND a.linkMan LIKE concat('%',#{linkMan},'%')
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND u.registerTime <![CDATA[ >= ]]> #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND u.registerTime <![CDATA[ <= ]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="userIdentity != null and userIdentity != '' and userIdentity != '8'.toString()">
|
|
|
+ AND u.userIdentity = #{userIdentity}
|
|
|
+ </if>
|
|
|
+ <if test="userIdentity != null and userIdentity != '' and userIdentity == '8'.toString()">
|
|
|
+ AND csu.delFlag = '0' and now() <![CDATA[ < ]]> csu.endTime
|
|
|
+ </if>
|
|
|
+ <if test="spId != null and spId != ''">
|
|
|
+ AND sp.serviceProviderID = #{spId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY case when a.status = 91 then 0 else 1 end desc, a.addTime DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<select id="getByUser" parameterType="User" resultMap="UserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
from user AS user
|