|
@@ -1,20 +1,25 @@
|
|
<?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.caimei365.user.mapper.SellerMapper">
|
|
<mapper namespace="com.caimei365.user.mapper.SellerMapper">
|
|
|
|
+ <insert id="insertClick">
|
|
|
|
+ insert into provider_task_click(serviceProviderId, taskId, clickTime, userId, ip)
|
|
|
|
+ value (#{serviceProviderId}, #{taskId}, now(), #{userId}, #{ip})
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
<select id="getLoginSellerByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
|
|
<select id="getLoginSellerByMobile" resultType="com.caimei365.user.model.vo.UserLoginVo">
|
|
- select u.userID as userId,
|
|
|
|
- u.clubID as clubId,
|
|
|
|
- u.shopID as shopId,
|
|
|
|
- u.userName as userName,
|
|
|
|
- u.name as name,
|
|
|
|
- u.mobile as mobile,
|
|
|
|
- u.bindMobile as bindMobile,
|
|
|
|
- u.email as email,
|
|
|
|
- u.guideFlag as guideFlag,
|
|
|
|
- u.userIdentity as userIdentity,
|
|
|
|
- u.serviceProviderID as serviceProviderId,
|
|
|
|
|
|
+ select u.userID as userId,
|
|
|
|
+ u.clubID as clubId,
|
|
|
|
+ u.shopID as shopId,
|
|
|
|
+ u.userName as userName,
|
|
|
|
+ u.name as name,
|
|
|
|
+ u.mobile as mobile,
|
|
|
|
+ u.bindMobile as bindMobile,
|
|
|
|
+ u.email as email,
|
|
|
|
+ u.guideFlag as guideFlag,
|
|
|
|
+ u.userIdentity as userIdentity,
|
|
|
|
+ u.serviceProviderID as serviceProviderId,
|
|
u.serviceProviderStatus as serviceStatus,
|
|
u.serviceProviderStatus as serviceStatus,
|
|
- u.password as password
|
|
|
|
|
|
+ u.password as password
|
|
from user u
|
|
from user u
|
|
where u.mobile = #{mobile}
|
|
where u.mobile = #{mobile}
|
|
and u.userIdentity = 1
|
|
and u.userIdentity = 1
|
|
@@ -32,7 +37,7 @@
|
|
</trim>
|
|
</trim>
|
|
where userID = #{userId}
|
|
where userID = #{userId}
|
|
</update>
|
|
</update>
|
|
- <update id="setSellerUserHome" >
|
|
|
|
|
|
+ <update id="setSellerUserHome">
|
|
update user
|
|
update user
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="image != null and image != ''">image = #{image},</if>
|
|
<if test="image != null and image != ''">image = #{image},</if>
|
|
@@ -97,6 +102,14 @@
|
|
WHERE `id` = #{id}
|
|
WHERE `id` = #{id}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
+ <update id="receiveTask">
|
|
|
|
+ update provider_task_role
|
|
|
|
+ set receiveFlag = 1,
|
|
|
|
+ receiveTime = now()
|
|
|
|
+ where serviceProviderId = #{serviceProviderId}
|
|
|
|
+ and taskId = #{taskId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
<delete id="deleteTemporaryClub">
|
|
<delete id="deleteTemporaryClub">
|
|
DELETE
|
|
DELETE
|
|
FROM `club_temporary`
|
|
FROM `club_temporary`
|
|
@@ -117,7 +130,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
<select id="findClubs" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
- select c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile,
|
|
|
|
|
|
+ select c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile,
|
|
c.contractEmail as contractEmail,
|
|
c.contractEmail as contractEmail,
|
|
c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
|
|
c.contractPhone, c.linkMan, c.provinceID as proviceId, c.cityID as cityId, c.townID as townId,
|
|
c.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
|
|
c.address, c.headpic as shopPhoto, c.businessLicenseImage as businessLicense, c.socialCreditCode,
|
|
@@ -132,11 +145,14 @@
|
|
from club c
|
|
from club c
|
|
left join user u on c.userID = u.userID
|
|
left join user u on c.userID = u.userID
|
|
LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
|
|
LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
|
|
- LEFT JOIN (SELECT userId, activeStatus, activeState FROM cm_organ_active_system WHERE stage = 0 AND delType = 1) coas ON coas.userId = c.userId
|
|
|
|
- LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) covs ON covs.userID = c.userID
|
|
|
|
|
|
+ LEFT JOIN (SELECT userId, activeStatus, activeState FROM cm_organ_active_system WHERE stage = 0 AND delType = 1)
|
|
|
|
+ coas ON coas.userId = c.userId
|
|
|
|
+ LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) covs ON
|
|
|
|
+ covs.userID = c.userID
|
|
LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
LEFT JOIN cm_provider_record cpr ON cpr.spID = sp.serviceProviderID and cpr.clubId = c.clubId
|
|
LEFT JOIN cm_provider_record cpr ON cpr.spID = sp.serviceProviderID and cpr.clubId = c.clubId
|
|
- LEFT JOIN (SELECT DISTINCT clubID, checkTime FROM clubchangesprecord WHERE checkStatus = 1 GROUP BY clubID ORDER BY clubChangeSpRecordID DESC )ccs ON ccs.clubId = c.clubId
|
|
|
|
|
|
+ LEFT JOIN (SELECT DISTINCT clubID, checkTime FROM clubchangesprecord WHERE checkStatus = 1 GROUP BY clubID ORDER
|
|
|
|
+ BY clubChangeSpRecordID DESC )ccs ON ccs.clubId = c.clubId
|
|
where
|
|
where
|
|
<if test="1 == type">
|
|
<if test="1 == type">
|
|
c.spID = #{serviceProviderId}
|
|
c.spID = #{serviceProviderId}
|
|
@@ -164,18 +180,19 @@
|
|
AND c.newDeal =1
|
|
AND c.newDeal =1
|
|
</if>
|
|
</if>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- AND (c.name LIKE CONCAT('%',#{name},'%') OR c.linkMan LIKE CONCAT('%',#{name},'%') OR c.contractMobile LIKE CONCAT('%',#{name},'%'))
|
|
|
|
|
|
+ AND (c.name LIKE CONCAT('%',#{name},'%') OR c.linkMan LIKE CONCAT('%',#{name},'%') OR c.contractMobile LIKE
|
|
|
|
+ CONCAT('%',#{name},'%'))
|
|
</if>
|
|
</if>
|
|
<if test="userIdentity != null">
|
|
<if test="userIdentity != null">
|
|
AND u.userIdentity = #{userIdentity}
|
|
AND u.userIdentity = #{userIdentity}
|
|
</if>
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
<if test="startTime != null and startTime != ''">
|
|
AND (ccs.checkTime <![CDATA[ >= ]]> #{startTime}
|
|
AND (ccs.checkTime <![CDATA[ >= ]]> #{startTime}
|
|
- OR cpr.createTime <![CDATA[ >= ]]> #{startTime})
|
|
|
|
|
|
+ OR cpr.createTime <![CDATA[ >= ]]> #{startTime})
|
|
</if>
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
AND (ccs.checkTime <![CDATA[ <= ]]> #{endTime}
|
|
AND (ccs.checkTime <![CDATA[ <= ]]> #{endTime}
|
|
- OR cpr.createTime <![CDATA[ <= ]]> #{endTime})
|
|
|
|
|
|
+ OR cpr.createTime <![CDATA[ <= ]]> #{endTime})
|
|
</if>
|
|
</if>
|
|
<if test="activeState != null and activeState != ''">
|
|
<if test="activeState != null and activeState != ''">
|
|
AND coas.activeState like concat('%', #{userIdentity}, '%')
|
|
AND coas.activeState like concat('%', #{userIdentity}, '%')
|
|
@@ -217,29 +234,32 @@
|
|
covs.customerValue AS customerValue,
|
|
covs.customerValue AS customerValue,
|
|
b.num,
|
|
b.num,
|
|
(
|
|
(
|
|
- SELECT ADDTIME FROM
|
|
|
|
- (
|
|
|
|
- SELECT
|
|
|
|
- ADDTIME
|
|
|
|
- FROM cm_club_remarks
|
|
|
|
- WHERE clubId = c.clubId
|
|
|
|
- UNION
|
|
|
|
- SELECT
|
|
|
|
- ADDTIME
|
|
|
|
- FROM cm_visitor_remarks
|
|
|
|
- WHERE
|
|
|
|
- clubId IS NOT NULL AND clubId != ''
|
|
|
|
- AND clubId = c.clubId
|
|
|
|
- ) b ORDER BY ADDTIME DESC LIMIT 1
|
|
|
|
|
|
+ SELECT ADDTIME FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ ADDTIME
|
|
|
|
+ FROM cm_club_remarks
|
|
|
|
+ WHERE clubId = c.clubId
|
|
|
|
+ UNION
|
|
|
|
+ SELECT
|
|
|
|
+ ADDTIME
|
|
|
|
+ FROM cm_visitor_remarks
|
|
|
|
+ WHERE
|
|
|
|
+ clubId IS NOT NULL AND clubId != ''
|
|
|
|
+ AND clubId = c.clubId
|
|
|
|
+ ) b ORDER BY ADDTIME DESC LIMIT 1
|
|
) AS ADDTIME
|
|
) AS ADDTIME
|
|
FROM club c
|
|
FROM club c
|
|
LEFT JOIN USER u ON c.userID = u.userID
|
|
LEFT JOIN USER u ON c.userID = u.userID
|
|
LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
- LEFT JOIN (SELECT userId, activeState FROM cm_organ_active_system WHERE stage = 0 AND delType = 1) coas ON coas.userId = c.userId
|
|
|
|
- LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) covs ON covs.userID = c.userID
|
|
|
|
- LEFT JOIN (SELECT clubId, COUNT(id) AS num FROM cm_club_remarks GROUP BY clubId
|
|
|
|
- UNION
|
|
|
|
- SELECT clubId, COUNT(id) AS num FROM cm_visitor_remarks WHERE clubId IS NOT NULL AND clubId != '' GROUP BY clubId ) AS b ON c.clubId = b.clubId
|
|
|
|
|
|
+ LEFT JOIN (SELECT userId, activeState FROM cm_organ_active_system WHERE stage = 0 AND delType = 1) coas ON
|
|
|
|
+ coas.userId = c.userId
|
|
|
|
+ LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) covs ON
|
|
|
|
+ covs.userID = c.userID
|
|
|
|
+ LEFT JOIN (SELECT clubId, COUNT(id) AS num FROM cm_club_remarks GROUP BY clubId
|
|
|
|
+ UNION
|
|
|
|
+ SELECT clubId, COUNT(id) AS num FROM cm_visitor_remarks WHERE clubId IS NOT NULL AND clubId != '' GROUP BY
|
|
|
|
+ clubId ) AS b ON c.clubId = b.clubId
|
|
where c.spId = #{spId}
|
|
where c.spId = #{spId}
|
|
<if test="type != null">
|
|
<if test="type != null">
|
|
<if test="type == 1">
|
|
<if test="type == 1">
|
|
@@ -255,130 +275,128 @@
|
|
select * from
|
|
select * from
|
|
(
|
|
(
|
|
SELECT DISTINCT ccr.id AS remarksId,
|
|
SELECT DISTINCT ccr.id AS remarksId,
|
|
- ccr.remarks,
|
|
|
|
- ccr.addTime,
|
|
|
|
- ccr.questionMan,
|
|
|
|
- ccr.serviceProviderId AS serviceProviderId,
|
|
|
|
- ccr.createServiceProviderId AS createServiceProviderId,
|
|
|
|
- csr.leaderId AS leaderId,
|
|
|
|
- IFNULL(ccr.consultType,'') AS consult,
|
|
|
|
- c.Name AS clubName,
|
|
|
|
- ccr.clubType AS clubType,
|
|
|
|
- ccr.pinceSensitve AS pinceSensitve,
|
|
|
|
- ccr.satisfied AS satisfied,
|
|
|
|
- ccr.followup AS followup,
|
|
|
|
- ccr.extra AS extra,
|
|
|
|
- ccr.communicationSituation,
|
|
|
|
- ccr.communicationMethods,
|
|
|
|
- ccr.customerSource,
|
|
|
|
- ccr.customerGender,
|
|
|
|
- ccr.groupAddition,
|
|
|
|
- ccr.customerAge,
|
|
|
|
- ifnull(ccr.trendsKeyword, "") as trendsKeyword,
|
|
|
|
- ifnull(ccr.stateKeyword, "") as stateKeyword,
|
|
|
|
- (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID= csr.leaderId) AS leaderName,
|
|
|
|
- (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.createServiceProviderId) AS recordName,
|
|
|
|
- cmc.status AS STATUS
|
|
|
|
|
|
+ ccr.remarks,
|
|
|
|
+ ccr.addTime,
|
|
|
|
+ ccr.questionMan,
|
|
|
|
+ ccr.serviceProviderId AS serviceProviderId,
|
|
|
|
+ ccr.createServiceProviderId AS createServiceProviderId,
|
|
|
|
+ csr.leaderId AS leaderId,
|
|
|
|
+ IFNULL(ccr.consultType,'') AS consult,
|
|
|
|
+ c.Name AS clubName,
|
|
|
|
+ ccr.clubType AS clubType,
|
|
|
|
+ ccr.pinceSensitve AS pinceSensitve,
|
|
|
|
+ ccr.satisfied AS satisfied,
|
|
|
|
+ ccr.followup AS followup,
|
|
|
|
+ ccr.extra AS extra,
|
|
|
|
+ ccr.communicationSituation,
|
|
|
|
+ ccr.communicationMethods,
|
|
|
|
+ ccr.customerSource,
|
|
|
|
+ ccr.customerGender,
|
|
|
|
+ ccr.groupAddition,
|
|
|
|
+ ccr.customerAge,
|
|
|
|
+ ifnull(ccr.trendsKeyword, "") as trendsKeyword,
|
|
|
|
+ ifnull(ccr.stateKeyword, "") as stateKeyword,
|
|
|
|
+ (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID= csr.leaderId) AS leaderName,
|
|
|
|
+ (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.createServiceProviderId) AS recordName,
|
|
|
|
+ cmc.status AS STATUS
|
|
FROM cm_club_remarks ccr
|
|
FROM cm_club_remarks ccr
|
|
- LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
|
|
- LEFT JOIN club c ON c.clubId=ccr.clubId
|
|
|
|
- LEFT JOIN cm_serviceTeam_group csg ON ccr.createServiceProviderId = csg.serviceId
|
|
|
|
- LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
|
- LEFT JOIN cm_club_report cmc ON cmc.clubId = ccr.clubId
|
|
|
|
|
|
+ LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
|
|
+ LEFT JOIN club c ON c.clubId=ccr.clubId
|
|
|
|
+ LEFT JOIN cm_serviceTeam_group csg ON ccr.createServiceProviderId = csg.serviceId
|
|
|
|
+ LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
|
+ LEFT JOIN cm_club_report cmc ON cmc.clubId = ccr.clubId
|
|
<where>
|
|
<where>
|
|
ccr.clubId = #{clubId}
|
|
ccr.clubId = #{clubId}
|
|
<if test="search != null and search != ''">
|
|
<if test="search != null and search != ''">
|
|
and (
|
|
and (
|
|
- ccr.remarks like concat('%',#{search},'%')
|
|
|
|
- or ccr.questionMan like concat('%',#{search},'%')
|
|
|
|
- or c.name like concat('%',#{search},'%')
|
|
|
|
- or c.contractMobile like concat('%',#{search},'%')
|
|
|
|
|
|
+ ccr.remarks like concat('%',#{search},'%')
|
|
|
|
+ or ccr.questionMan like concat('%',#{search},'%')
|
|
|
|
+ or c.name like concat('%',#{search},'%')
|
|
|
|
+ or c.contractMobile like concat('%',#{search},'%')
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
UNION
|
|
UNION
|
|
SELECT DISTINCT ccr.id AS remarksId,
|
|
SELECT DISTINCT ccr.id AS remarksId,
|
|
- ccr.remarks,
|
|
|
|
- ccr.addTime AS ADDDATE,
|
|
|
|
- ccr.questionMan,
|
|
|
|
- ccr.serviceProviderId,
|
|
|
|
- ccr.createServiceProviderId AS createServiceProviderId,
|
|
|
|
- csr.leaderId AS leaderId,
|
|
|
|
- IFNULL(ccr.consultType,'') AS consult,
|
|
|
|
- c.Name AS clubName,
|
|
|
|
- ccr.clubType AS clubType,
|
|
|
|
- ccr.pinceSensitve AS pinceSensitve,
|
|
|
|
- ccr.satisfied AS satisfied,
|
|
|
|
- ccr.followup AS followup,
|
|
|
|
- ccr.extra AS extra,
|
|
|
|
- ccr.communicationSituation,
|
|
|
|
- ccr.communicationMethods,
|
|
|
|
- ccr.customerSource,
|
|
|
|
- ccr.customerGender,
|
|
|
|
- ccr.groupAddition,
|
|
|
|
- ccr.customerAge,
|
|
|
|
- ifnull(ccr.trendsKeyword, "") as trendsKeyword,
|
|
|
|
- ifnull(ccr.stateKeyword, "") as stateKeyword,
|
|
|
|
- (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID = csr.leaderId) AS leaderName,
|
|
|
|
- (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.serviceProviderId) AS recordName,
|
|
|
|
- cmc.status AS STATUS
|
|
|
|
|
|
+ ccr.remarks,
|
|
|
|
+ ccr.addTime AS ADDDATE,
|
|
|
|
+ ccr.questionMan,
|
|
|
|
+ ccr.serviceProviderId,
|
|
|
|
+ ccr.createServiceProviderId AS createServiceProviderId,
|
|
|
|
+ csr.leaderId AS leaderId,
|
|
|
|
+ IFNULL(ccr.consultType,'') AS consult,
|
|
|
|
+ c.Name AS clubName,
|
|
|
|
+ ccr.clubType AS clubType,
|
|
|
|
+ ccr.pinceSensitve AS pinceSensitve,
|
|
|
|
+ ccr.satisfied AS satisfied,
|
|
|
|
+ ccr.followup AS followup,
|
|
|
|
+ ccr.extra AS extra,
|
|
|
|
+ ccr.communicationSituation,
|
|
|
|
+ ccr.communicationMethods,
|
|
|
|
+ ccr.customerSource,
|
|
|
|
+ ccr.customerGender,
|
|
|
|
+ ccr.groupAddition,
|
|
|
|
+ ccr.customerAge,
|
|
|
|
+ ifnull(ccr.trendsKeyword, "") as trendsKeyword,
|
|
|
|
+ ifnull(ccr.stateKeyword, "") as stateKeyword,
|
|
|
|
+ (SELECT NAME FROM serviceprovider s WHERE s.serviceProviderID = csr.leaderId) AS leaderName,
|
|
|
|
+ (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.serviceProviderId) AS recordName,
|
|
|
|
+ cmc.status AS STATUS
|
|
FROM cm_visitor_remarks ccr
|
|
FROM cm_visitor_remarks ccr
|
|
- LEFT JOIN club c ON c.clubId=ccr.clubId
|
|
|
|
- LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
|
|
- LEFT JOIN cm_serviceTeam_group csg ON ccr.serviceProviderId = csg.serviceId
|
|
|
|
- LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
|
- LEFT JOIN cm_club_report cmc ON cmc.Id = ccr.reportID
|
|
|
|
|
|
+ LEFT JOIN club c ON c.clubId=ccr.clubId
|
|
|
|
+ LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
|
|
+ LEFT JOIN cm_serviceTeam_group csg ON ccr.serviceProviderId = csg.serviceId
|
|
|
|
+ LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
|
+ LEFT JOIN cm_club_report cmc ON cmc.Id = ccr.reportID
|
|
<where>
|
|
<where>
|
|
ccr.remarks IS NOT NULL
|
|
ccr.remarks IS NOT NULL
|
|
AND ccr.clubId is NOT null AND ccr.clubId != '' AND ccr.clubId = #{clubId}
|
|
AND ccr.clubId is NOT null AND ccr.clubId != '' AND ccr.clubId = #{clubId}
|
|
<if test="search != null and search != ''">
|
|
<if test="search != null and search != ''">
|
|
and (
|
|
and (
|
|
- ccr.remarks like concat('%',#{search},'%')
|
|
|
|
- or ccr.questionMan like concat('%',#{search},'%')
|
|
|
|
- or c.name like concat('%',#{search},'%')
|
|
|
|
- or c.contractMobile like concat('%',#{search},'%')
|
|
|
|
|
|
+ ccr.remarks like concat('%',#{search},'%')
|
|
|
|
+ or ccr.questionMan like concat('%',#{search},'%')
|
|
|
|
+ or c.name like concat('%',#{search},'%')
|
|
|
|
+ or c.contractMobile like concat('%',#{search},'%')
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- ) b
|
|
|
|
|
|
+ ) b
|
|
ORDER BY b.addTime DESC
|
|
ORDER BY b.addTime DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="findSpUserLoginSum" resultType="java.util.HashMap">
|
|
<select id="findSpUserLoginSum" resultType="java.util.HashMap">
|
|
- SELECT
|
|
|
|
- (CASE coas.activeStatus
|
|
|
|
- WHEN 0 THEN 'active'
|
|
|
|
- WHEN 1 THEN 'unActive'
|
|
|
|
- END) AS activeStatus,
|
|
|
|
- COUNT(coas.activeStatus) AS number
|
|
|
|
|
|
+ SELECT (CASE coas.activeStatus
|
|
|
|
+ WHEN 0 THEN 'active'
|
|
|
|
+ WHEN 1 THEN 'unActive'
|
|
|
|
+ END) AS activeStatus,
|
|
|
|
+ COUNT(coas.activeStatus) AS number
|
|
FROM cm_organ_active_system coas
|
|
FROM cm_organ_active_system coas
|
|
LEFT JOIN club c ON coas.userId = c.userId
|
|
LEFT JOIN club c ON coas.userId = c.userId
|
|
LEFT JOIN serviceprovider s ON s.serviceProviderId = c.spId
|
|
LEFT JOIN serviceprovider s ON s.serviceProviderId = c.spId
|
|
- WHERE s.serviceProviderId = #{spId} AND coas.stage = 0 AND delType = 1
|
|
|
|
|
|
+ WHERE s.serviceProviderId = #{spId}
|
|
|
|
+ AND coas.stage = 0
|
|
|
|
+ AND delType = 1
|
|
GROUP BY coas.activeStatus
|
|
GROUP BY coas.activeStatus
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getRemarkClub" resultType="java.util.Map">
|
|
<select id="getRemarkClub" resultType="java.util.Map">
|
|
- SELECT
|
|
|
|
- COUNT(clubId) AS isHaveClub,
|
|
|
|
- (SELECT COUNT(clubId) FROM club c LEFT JOIN serviceprovider s ON s.serviceProviderId = c.spId WHERE s.serviceProviderId = #{spId})AS allclub
|
|
|
|
- FROM
|
|
|
|
- (
|
|
|
|
- SELECT
|
|
|
|
- clubid AS clubID
|
|
|
|
- FROM cm_club_remarks
|
|
|
|
- WHERE createServiceProviderId = #{spId}
|
|
|
|
- GROUP BY clubId
|
|
|
|
- UNION
|
|
|
|
- SELECT
|
|
|
|
- clubId AS clubID
|
|
|
|
- FROM cm_visitor_remarks
|
|
|
|
- WHERE
|
|
|
|
- clubId IS NOT NULL AND clubId != ''
|
|
|
|
- AND createServiceProviderId = #{spId}
|
|
|
|
- GROUP BY clubId
|
|
|
|
- ) b
|
|
|
|
|
|
+ SELECT COUNT(clubId) AS isHaveClub,
|
|
|
|
+ (SELECT COUNT(clubId)
|
|
|
|
+ FROM club c
|
|
|
|
+ LEFT JOIN serviceprovider s ON s.serviceProviderId = c.spId
|
|
|
|
+ WHERE s.serviceProviderId = #{spId}) AS allclub
|
|
|
|
+ FROM (SELECT clubid AS clubID
|
|
|
|
+ FROM cm_club_remarks
|
|
|
|
+ WHERE createServiceProviderId = #{spId}
|
|
|
|
+ GROUP BY clubId
|
|
|
|
+ UNION
|
|
|
|
+ SELECT clubId AS clubID
|
|
|
|
+ FROM cm_visitor_remarks
|
|
|
|
+ WHERE clubId IS NOT NULL
|
|
|
|
+ AND clubId != ''
|
|
|
|
+ AND createServiceProviderId = #{spId}
|
|
|
|
+ GROUP BY clubId) b
|
|
</select>
|
|
</select>
|
|
<select id="getAllClubList" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
<select id="getAllClubList" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
SELECT DISTINCT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile,
|
|
SELECT DISTINCT c.clubID as clubId, c.userID as userId, c.name, c.sname as shortName, c.contractMobile,
|
|
@@ -401,9 +419,9 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="getSellerByUserId" resultType="com.caimei365.user.model.po.ServiceProviderPo">
|
|
<select id="getSellerByUserId" resultType="com.caimei365.user.model.po.ServiceProviderPo">
|
|
- select s.serviceProviderID AS serviceProviderId,
|
|
|
|
|
|
+ select s.serviceProviderID AS serviceProviderId,
|
|
s.status,
|
|
s.status,
|
|
- s.userID AS userId,
|
|
|
|
|
|
+ s.userID AS userId,
|
|
s.openid,
|
|
s.openid,
|
|
s.unionId,
|
|
s.unionId,
|
|
s.name,
|
|
s.name,
|
|
@@ -415,7 +433,7 @@
|
|
s.qrCode,
|
|
s.qrCode,
|
|
u.image
|
|
u.image
|
|
from serviceprovider s
|
|
from serviceprovider s
|
|
- LEFT JOIN USER u ON s.userId = u.userId
|
|
|
|
|
|
+ LEFT JOIN USER u ON s.userId = u.userId
|
|
where s.userID = #{userId}
|
|
where s.userID = #{userId}
|
|
</select>
|
|
</select>
|
|
<select id="findManager" resultType="java.lang.Integer">
|
|
<select id="findManager" resultType="java.lang.Integer">
|
|
@@ -435,7 +453,7 @@
|
|
<select id="findLeaderId" resultType="java.lang.Integer">
|
|
<select id="findLeaderId" resultType="java.lang.Integer">
|
|
SELECT csr.leaderId
|
|
SELECT csr.leaderId
|
|
FROM cm_serviceteam_role csr
|
|
FROM cm_serviceteam_role csr
|
|
- LEFT JOIN serviceprovider s ON s.serviceProviderId = csr.leaderId
|
|
|
|
|
|
+ LEFT JOIN serviceprovider s ON s.serviceProviderId = csr.leaderId
|
|
WHERE s.userId = #{userId}
|
|
WHERE s.userId = #{userId}
|
|
</select>
|
|
</select>
|
|
<select id="findLeaderIdByServiceId" resultType="java.lang.Integer">
|
|
<select id="findLeaderIdByServiceId" resultType="java.lang.Integer">
|
|
@@ -461,7 +479,7 @@
|
|
WHERE csg.serviceId != #{serviceProviderId}
|
|
WHERE csg.serviceId != #{serviceProviderId}
|
|
</select>
|
|
</select>
|
|
<select id="findServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
<select id="findServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
- SELECT csg.serviceId as serviceProviderId,s.linkMan as name
|
|
|
|
|
|
+ SELECT csg.serviceId as serviceProviderId,s.name as name
|
|
FROM cm_serviceteam_group csg
|
|
FROM cm_serviceteam_group csg
|
|
LEFT JOIN cm_serviceteam_role csr ON csr.id=csg.teamId
|
|
LEFT JOIN cm_serviceteam_role csr ON csr.id=csg.teamId
|
|
left join serviceprovider s on csg.serviceId=s.serviceProviderID
|
|
left join serviceprovider s on csg.serviceId=s.serviceProviderID
|
|
@@ -471,7 +489,7 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="findAllServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
<select id="findAllServices" resultType="com.caimei365.user.model.vo.ServiceProviderVo">
|
|
- SELECT csg.serviceId AS serviceProviderId,s.linkMan AS NAME
|
|
|
|
|
|
+ SELECT csg.serviceId AS serviceProviderId,s.name AS NAME
|
|
FROM cm_serviceteam_group csg
|
|
FROM cm_serviceteam_group csg
|
|
LEFT JOIN serviceprovider s ON csg.serviceId=s.serviceProviderID
|
|
LEFT JOIN serviceprovider s ON csg.serviceId=s.serviceProviderID
|
|
<where>
|
|
<where>
|
|
@@ -492,7 +510,7 @@
|
|
AND c.clubId =#{clubId}
|
|
AND c.clubId =#{clubId}
|
|
</if>
|
|
</if>
|
|
and b.pageType in(6,8,11)
|
|
and b.pageType in(6,8,11)
|
|
- and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
|
|
|
|
+ and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
GROUP BY b.pageLabel LIMIT 10) as a
|
|
GROUP BY b.pageLabel LIMIT 10) as a
|
|
</select>
|
|
</select>
|
|
<select id="getBehaviorRecordMinutePageLabel" resultType="string">
|
|
<select id="getBehaviorRecordMinutePageLabel" resultType="string">
|
|
@@ -501,66 +519,69 @@
|
|
FROM cm_behavior_record b
|
|
FROM cm_behavior_record b
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
- WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
|
|
|
+ WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
and b.pageType in (69,70,71)
|
|
and b.pageType in (69,70,71)
|
|
- and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
|
|
|
|
+ and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
<if test="clubId != null">
|
|
<if test="clubId != null">
|
|
AND c.clubId =#{clubId}
|
|
AND c.clubId =#{clubId}
|
|
</if>
|
|
</if>
|
|
GROUP BY b.pageLabel LIMIT 10) as a
|
|
GROUP BY b.pageLabel LIMIT 10) as a
|
|
</select>
|
|
</select>
|
|
<select id="getBehaviorRecordYesterdayClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
<select id="getBehaviorRecordYesterdayClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
- SELECT
|
|
|
|
- b.recordID,
|
|
|
|
- b.userID,
|
|
|
|
- b.pagePath,
|
|
|
|
- b.pageType,
|
|
|
|
- b.pageLabel,
|
|
|
|
- b.productID,
|
|
|
|
- b.accessTime,
|
|
|
|
- b.accessDuration,
|
|
|
|
- b.accessDate,
|
|
|
|
- b.referer,
|
|
|
|
- b.accessClient,
|
|
|
|
- b.isReckon,
|
|
|
|
- b.region,
|
|
|
|
- c.name,c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
|
|
|
+ SELECT b.recordID,
|
|
|
|
+ b.userID,
|
|
|
|
+ b.pagePath,
|
|
|
|
+ b.pageType,
|
|
|
|
+ b.pageLabel,
|
|
|
|
+ b.productID,
|
|
|
|
+ b.accessTime,
|
|
|
|
+ b.accessDuration,
|
|
|
|
+ b.accessDate,
|
|
|
|
+ b.referer,
|
|
|
|
+ b.accessClient,
|
|
|
|
+ b.isReckon,
|
|
|
|
+ b.region,
|
|
|
|
+ c.name,
|
|
|
|
+ c.linkMan,
|
|
|
|
+ c.contractMobile,
|
|
|
|
+ c.clubId,
|
|
|
|
+ u.image
|
|
FROM cm_behavior_record b
|
|
FROM cm_behavior_record b
|
|
- LEFT JOIN club c ON b.userID = c.userID
|
|
|
|
- LEFT JOIN user u ON u.userID = c.userID
|
|
|
|
- WHERE b.userId !=0
|
|
|
|
- and c.spId=#{spId}
|
|
|
|
- and c.clubId=#{clubId}
|
|
|
|
- and b.pageType in(6,11)
|
|
|
|
- and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
|
|
|
|
+ LEFT JOIN club c ON b.userID = c.userID
|
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
|
+ WHERE b.userId != 0
|
|
|
|
+ and c.spId = #{spId}
|
|
|
|
+ and c.clubId = #{clubId}
|
|
|
|
+ and b.pageType in (6, 11)
|
|
|
|
+ and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
</select>
|
|
</select>
|
|
<select id="getBehaviorRecordMinuteClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
<select id="getBehaviorRecordMinuteClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
SELECT
|
|
SELECT
|
|
- b.recordID,
|
|
|
|
- b.userID,
|
|
|
|
- b.pagePath,
|
|
|
|
- b.pageType,
|
|
|
|
- b.pageLabel,
|
|
|
|
- b.productID,
|
|
|
|
- b.accessTime,
|
|
|
|
- b.accessDuration,
|
|
|
|
- b.accessDate,
|
|
|
|
- b.referer,
|
|
|
|
- b.accessClient,
|
|
|
|
- b.isReckon,
|
|
|
|
- b.region,
|
|
|
|
- (select cpaf.fileName from cm_product_archive_content cpac
|
|
|
|
- left join cm_product_archive_file cpaf on cpaf.archiveContentId=cpac.id
|
|
|
|
- where cpac.id=b.productArchiveId limit 1)as title,
|
|
|
|
- ifnull(c.name,b.IP),
|
|
|
|
- c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
|
|
|
+ b.recordID,
|
|
|
|
+ b.userID,
|
|
|
|
+ b.pagePath,
|
|
|
|
+ b.pageType,
|
|
|
|
+ b.pageLabel,
|
|
|
|
+ b.productID,
|
|
|
|
+ b.accessTime,
|
|
|
|
+ b.accessDuration,
|
|
|
|
+ b.accessDate,
|
|
|
|
+ b.referer,
|
|
|
|
+ b.accessClient,
|
|
|
|
+ b.isReckon,
|
|
|
|
+ b.region,
|
|
|
|
+ (select cpaf.fileName from cm_product_archive_content cpac
|
|
|
|
+ left join cm_product_archive_file cpaf on cpaf.archiveContentId=cpac.id
|
|
|
|
+ where cpac.id=b.productArchiveId limit 1)as title,
|
|
|
|
+ ifnull(c.name,b.IP),
|
|
|
|
+ c.linkMan,c.contractMobile,c.clubId,u.image
|
|
FROM cm_behavior_record b
|
|
FROM cm_behavior_record b
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
- WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
|
- and b.pageType in (69,70,71)
|
|
|
|
- and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
|
|
|
|
+ WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
|
+ and b.pageType in (69,70,71)
|
|
|
|
+ and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
<if test="clubId != null">
|
|
<if test="clubId != null">
|
|
AND c.clubId =#{clubId}
|
|
AND c.clubId =#{clubId}
|
|
</if>
|
|
</if>
|
|
@@ -579,14 +600,18 @@
|
|
b.accessClient,
|
|
b.accessClient,
|
|
b.isReckon,
|
|
b.isReckon,
|
|
b.region,
|
|
b.region,
|
|
- c.name,c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
|
|
|
+ c.name,
|
|
|
|
+ c.linkMan,
|
|
|
|
+ c.contractMobile,
|
|
|
|
+ c.clubId,
|
|
|
|
+ u.image
|
|
FROM cm_behavior_record b
|
|
FROM cm_behavior_record b
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
- WHERE b.userId !=0
|
|
|
|
- and c.spId=#{spId}
|
|
|
|
- and b.pageType in(6,8,11)
|
|
|
|
- and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
|
|
|
|
+ WHERE b.userId != 0
|
|
|
|
+ and c.spId = #{spId}
|
|
|
|
+ and b.pageType in (6, 8, 11)
|
|
|
|
+ and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
GROUP BY c.clubId
|
|
GROUP BY c.clubId
|
|
</select>
|
|
</select>
|
|
<select id="getBehaviorRecordMinuteClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
<select id="getBehaviorRecordMinuteClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
@@ -603,23 +628,30 @@
|
|
b.accessClient,
|
|
b.accessClient,
|
|
b.isReckon,
|
|
b.isReckon,
|
|
b.region,
|
|
b.region,
|
|
- ifnull(c.name,b.region)
|
|
|
|
- ,c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
|
|
|
+ ifnull(c.name, b.region)
|
|
|
|
+ ,
|
|
|
|
+ c.linkMan,
|
|
|
|
+ c.contractMobile,
|
|
|
|
+ c.clubId,
|
|
|
|
+ u.image
|
|
FROM cm_behavior_record b
|
|
FROM cm_behavior_record b
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
- WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
|
- and b.pageType in (69,70,71)
|
|
|
|
- and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
|
|
|
|
+ WHERE sp.status = 90
|
|
|
|
+ and sp.serviceProviderID = #{spId}
|
|
|
|
+ and b.pageType in (69, 70, 71)
|
|
|
|
+ and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
GROUP BY b.region
|
|
GROUP BY b.region
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getClubAccessDate" resultType="com.caimei365.user.model.vo.RetuenDataVo">
|
|
<select id="getClubAccessDate" resultType="com.caimei365.user.model.vo.RetuenDataVo">
|
|
select cbr.accessDate
|
|
select cbr.accessDate
|
|
from cm_behavior_record cbr
|
|
from cm_behavior_record cbr
|
|
- LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
|
- where c.clubID = #{clubId} group by cbr.accessDate order by cbr.accessDate desc
|
|
|
|
|
|
+ LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
|
+ where c.clubID = #{clubId}
|
|
|
|
+ group by cbr.accessDate
|
|
|
|
+ order by cbr.accessDate desc
|
|
</select>
|
|
</select>
|
|
<select id="getClubKeynoteRecord" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
<select id="getClubKeynoteRecord" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
SELECT
|
|
SELECT
|
|
@@ -636,63 +668,107 @@
|
|
b.accessClient,
|
|
b.accessClient,
|
|
b.isReckon,
|
|
b.isReckon,
|
|
b.region,
|
|
b.region,
|
|
- p.name AS productName,
|
|
|
|
|
|
+ p.name AS productName,
|
|
p.mainImage AS productImage
|
|
p.mainImage AS productImage
|
|
FROM cm_behavior_record b
|
|
FROM cm_behavior_record b
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
LEFT JOIN product p ON b.productID = p.productID
|
|
LEFT JOIN product p ON b.productID = p.productID
|
|
LEFT JOIN cm_page_type pt ON b.pageType = pt.id
|
|
LEFT JOIN cm_page_type pt ON b.pageType = pt.id
|
|
WHERE c.clubID = #{clubId}
|
|
WHERE c.clubID = #{clubId}
|
|
- and b.pageType IN (6,11)
|
|
|
|
- <if test="accessDateList.size()>0">
|
|
|
|
- and
|
|
|
|
- <foreach collection="accessDateList" item="accessDate" open="(" separator="or" close=")">
|
|
|
|
- b.accessTime like concat('%', #{accessDate}, '%')
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
|
|
+ and b.pageType IN (6,11)
|
|
|
|
+ <if test="accessDateList.size()>0">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="accessDateList" item="accessDate" open="(" separator="or" close=")">
|
|
|
|
+ b.accessTime like concat('%', #{accessDate}, '%')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
order by b.accessTime desc
|
|
order by b.accessTime desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getUnActiveClub" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
<select id="getUnActiveClub" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
- SELECT c.clubID as clubId,
|
|
|
|
- c.userID as userId,
|
|
|
|
|
|
+ SELECT c.clubID as clubId,
|
|
|
|
+ c.userID as userId,
|
|
c.name,
|
|
c.name,
|
|
- c.sname as shortName,
|
|
|
|
|
|
+ c.sname as shortName,
|
|
c.contractMobile,
|
|
c.contractMobile,
|
|
- c.contractEmail as contractEmail,
|
|
|
|
|
|
+ c.contractEmail as contractEmail,
|
|
c.contractPhone,
|
|
c.contractPhone,
|
|
c.linkMan,
|
|
c.linkMan,
|
|
- c.provinceID as proviceId,
|
|
|
|
- c.cityID as cityId,
|
|
|
|
- c.townID as townId,
|
|
|
|
|
|
+ c.provinceID as proviceId,
|
|
|
|
+ c.cityID as cityId,
|
|
|
|
+ c.townID as townId,
|
|
c.address,
|
|
c.address,
|
|
- c.headpic as shopPhoto,
|
|
|
|
- c.businessLicenseImage as businessLicense,
|
|
|
|
|
|
+ c.headpic as shopPhoto,
|
|
|
|
+ c.businessLicenseImage as businessLicense,
|
|
c.socialCreditCode,
|
|
c.socialCreditCode,
|
|
c.firstClubType,
|
|
c.firstClubType,
|
|
c.secondClubType,
|
|
c.secondClubType,
|
|
c.department,
|
|
c.department,
|
|
c.medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
c.medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
- c.mainpro as mainProduct,
|
|
|
|
|
|
+ c.mainpro as mainProduct,
|
|
c.fax,
|
|
c.fax,
|
|
- c.info as profile,
|
|
|
|
- c.spID as serviceProviderId,
|
|
|
|
- c.addTime, c.status,
|
|
|
|
|
|
+ c.info as profile,
|
|
|
|
+ c.spID as serviceProviderId,
|
|
|
|
+ c.addTime,
|
|
|
|
+ c.status,
|
|
c.lastCheckOrderDate,
|
|
c.lastCheckOrderDate,
|
|
u.userIdentity,
|
|
u.userIdentity,
|
|
- c.newDeal as newDeal,IF(r.id IS NOT NULL,1,0) AS recordCount,
|
|
|
|
- sp.name AS serviceName,
|
|
|
|
- coas.activeState AS activeState,
|
|
|
|
- covs.customerValue AS customerValue
|
|
|
|
- from club c
|
|
|
|
- left join user u on c.userID = u.userID
|
|
|
|
- LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
|
|
|
|
- LEFT JOIN (SELECT userId, activeState, activeStatus FROM cm_organ_active_system WHERE stage = 0 AND delType = 1) AS coas ON coas.userId = c.userId
|
|
|
|
- LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) AS covs ON covs.userId = c.userId
|
|
|
|
- LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
|
|
|
|
+ c.newDeal as newDeal,
|
|
|
|
+ IF(r.id IS NOT NULL, 1, 0) AS recordCount,
|
|
|
|
+ sp.name AS serviceName,
|
|
|
|
+ coas.activeState AS activeState,
|
|
|
|
+ covs.customerValue AS customerValue
|
|
|
|
+ from club c
|
|
|
|
+ left join user u on c.userID = u.userID
|
|
|
|
+ LEFT JOIN record_link r ON r.`clubId` = c.`clubID`
|
|
|
|
+ LEFT JOIN (SELECT userId, activeState, activeStatus
|
|
|
|
+ FROM cm_organ_active_system
|
|
|
|
+ WHERE stage = 0
|
|
|
|
+ AND delType = 1) AS coas ON coas.userId = c.userId
|
|
|
|
+ LEFT JOIN (SELECT userId, customerValue
|
|
|
|
+ FROM cm_organ_value_system
|
|
|
|
+ WHERE stage = 0
|
|
|
|
+ AND delType = 1) AS covs ON covs.userId = c.userId
|
|
|
|
+ LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
WHERE coas.activeStatus = 1
|
|
WHERE coas.activeStatus = 1
|
|
AND sp.serviceProviderID = #{serviceProviderId}
|
|
AND sp.serviceProviderID = #{serviceProviderId}
|
|
GROUP BY covs.userID
|
|
GROUP BY covs.userID
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="getTaskList" resultType="com.caimei365.user.model.vo.ProviderTaskVo">
|
|
|
|
+ SELECT ptr.taskId,
|
|
|
|
+ ptr.receiveFlag,
|
|
|
|
+ ptr.auditStatus,
|
|
|
|
+ ptr.receiveTime,
|
|
|
|
+ cpt.shopId,
|
|
|
|
+ cpt.title,
|
|
|
|
+ cpt.content,
|
|
|
|
+ cpt.reward,
|
|
|
|
+ cpt.productId,
|
|
|
|
+ cpt.addTime,
|
|
|
|
+ cpt.startTime,
|
|
|
|
+ cpt.endTime,
|
|
|
|
+ cpt.topPic
|
|
|
|
+ FROM provider_task_role ptr
|
|
|
|
+ LEFT JOIN cm_provider_task cpt ON ptr.taskId = cpt.id
|
|
|
|
+ WHERE cpt.delflag = 0
|
|
|
|
+ AND ptr.serviceProviderId = #{serviceProviderId}
|
|
|
|
+ order by cpt.addTime desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getTaskDetail" resultType="com.caimei365.user.model.vo.ProviderTaskVo">
|
|
|
|
+ select id as taskId,
|
|
|
|
+ shopId,
|
|
|
|
+ productId,
|
|
|
|
+ title,
|
|
|
|
+ topPic,
|
|
|
|
+ content,
|
|
|
|
+ reward,
|
|
|
|
+ addTime,
|
|
|
|
+ startTime,
|
|
|
|
+ endTime
|
|
|
|
+ from cm_provider_task
|
|
|
|
+ where id = #{taskId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|