|
@@ -4,11 +4,14 @@
|
|
|
<insert id="insertRemarks" parameterType="com.caimei365.user.model.po.ClubRemarksPo" keyProperty="remarksId"
|
|
|
useGeneratedKeys="true">
|
|
|
insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, consultType, clubType,
|
|
|
- pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID, reportID,
|
|
|
- communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition, trendsKeyword, stateKeyword)
|
|
|
+ pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID,
|
|
|
+ reportID,
|
|
|
+ communicationSituation, communicationMethods, customerSource, customerGender,
|
|
|
+ customerAge, groupAddition, trendsKeyword, stateKeyword)
|
|
|
values (#{clubId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{consult}, #{clubType},
|
|
|
#{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productID}, #{reportID},
|
|
|
- #{communicationSituation}, #{communicationMethods},#{customerSource},#{customerGender},#{customerAge},#{groupAddition},#{trendsKeyword}, #{stateKeyword} )
|
|
|
+ #{communicationSituation}, #{communicationMethods}, #{customerSource}, #{customerGender},
|
|
|
+ #{customerAge}, #{groupAddition}, #{trendsKeyword}, #{stateKeyword})
|
|
|
</insert>
|
|
|
<insert id="insertRemarksImage">
|
|
|
insert into cm_club_remarks_file(remarksId, fileType, imageUrl)
|
|
@@ -19,16 +22,21 @@
|
|
|
values (#{remarksId}, 2, #{fileName}, #{ossName})
|
|
|
</insert>
|
|
|
<insert id="insertQuestionMan" keyProperty="remarksId" keyColumn="id" useGeneratedKeys="true">
|
|
|
- insert into cm_visitor_remarks(questionManId, serviceProviderId, remarks, addTime, questionMan, concactTime, createServiceProviderId)
|
|
|
- values (#{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{concactTime}, #{serviceProviderId})
|
|
|
+ insert into cm_visitor_remarks(questionManId, serviceProviderId, remarks, addTime, questionMan, concactTime,
|
|
|
+ createServiceProviderId)
|
|
|
+ values (#{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{questionMan}, #{concactTime},
|
|
|
+ #{serviceProviderId})
|
|
|
</insert>
|
|
|
<insert id="insertVisitorRemark" keyProperty="remarksId" useGeneratedKeys="true">
|
|
|
insert into cm_visitor_remarks(questionMan, questionManId, serviceProviderId, remarks, addTime, consultType,
|
|
|
- clubType, pinceSensitve, satisfied, followup, extra, reportID, productID, createServiceProviderId,
|
|
|
- communicationSituation, communicationMethods, customerSource, customerGender, customerAge, groupAddition, trendsKeyword, stateKeyword)
|
|
|
+ clubType, pinceSensitve, satisfied, followup, extra, reportID, productID,
|
|
|
+ createServiceProviderId,
|
|
|
+ communicationSituation, communicationMethods, customerSource, customerGender,
|
|
|
+ customerAge, groupAddition, trendsKeyword, stateKeyword)
|
|
|
values (#{questionMan}, #{questionManId}, #{serviceProviderId}, #{remarks}, now(), #{consult}, #{clubType},
|
|
|
#{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{reportId}, #{productId}, #{serviceProviderId},
|
|
|
- #{communicationSituation}, #{communicationMethods},#{customerSource},#{customerGender},#{customerAge},#{groupAddition},#{trendsKeyword}, #{stateKeyword})
|
|
|
+ #{communicationSituation}, #{communicationMethods}, #{customerSource}, #{customerGender},
|
|
|
+ #{customerAge}, #{groupAddition}, #{trendsKeyword}, #{stateKeyword})
|
|
|
</insert>
|
|
|
<update id="updateClubNewDeal">
|
|
|
update club
|
|
@@ -46,9 +54,10 @@
|
|
|
<insert id="concactVisit" parameterType="com.caimei365.user.model.vo.RemarksVo" keyProperty="remarksId"
|
|
|
useGeneratedKeys="true">
|
|
|
insert into cm_club_remarks(clubId, serviceProviderId, remarks, addTime, questionMan, concactTime, consultType,
|
|
|
- clubType, pinceSensitve, satisfied, followup, extra, createServiceProviderId, productID, reportID)
|
|
|
+ clubType, pinceSensitve, satisfied, followup, extra, createServiceProviderId,
|
|
|
+ productID, reportID)
|
|
|
values (#{clubId}, #{serviceProviderId}, #{remarks}, #{addTime}, #{questionMan}, now(), #{consult}, #{clubType},
|
|
|
- #{pinceSensitve}, #{satisfied}, #{followup}, #{extra},#{serviceProviderId}, #{productId}, #{reportId})
|
|
|
+ #{pinceSensitve}, #{satisfied}, #{followup}, #{extra}, #{serviceProviderId}, #{productId}, #{reportId})
|
|
|
</insert>
|
|
|
<insert id="insertChangeRecord" parameterType="com.caimei365.user.model.vo.ClubChangeSpVo"
|
|
|
keyProperty="clubChangeSpRecordID"
|
|
@@ -91,8 +100,7 @@
|
|
|
<if test="email != null and email != ''">
|
|
|
email = #{email},
|
|
|
</if>
|
|
|
- userName = #{userName},
|
|
|
- clubStatus = 1
|
|
|
+ userName = #{userName}
|
|
|
where userID = #{userId}
|
|
|
</update>
|
|
|
<select id="selClubData" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
@@ -216,37 +224,45 @@
|
|
|
where id = #{remarksId}
|
|
|
</delete>
|
|
|
<select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
|
- select clubID as clubId,
|
|
|
- userID as userId,
|
|
|
+ select clubID as clubId,
|
|
|
+ userID as userId,
|
|
|
name,
|
|
|
- sname as shortName,
|
|
|
+ sname as shortName,
|
|
|
contractMobile,
|
|
|
contractEmail,
|
|
|
contractPhone,
|
|
|
linkMan,
|
|
|
linkManIdentity,
|
|
|
- provinceID as proviceId,
|
|
|
- cityID as cityId,
|
|
|
- townID as townId,
|
|
|
- ifnull(address, '暂无') as address,
|
|
|
- headpic as shopPhoto,
|
|
|
- businessLicenseImage as businessLicense,
|
|
|
+ provinceID as proviceId,
|
|
|
+ cityID as cityId,
|
|
|
+ townID as townId,
|
|
|
+ ifnull(address, '暂无') as address,
|
|
|
+ headpic as shopPhoto,
|
|
|
+ businessLicenseImage as businessLicense,
|
|
|
socialCreditCode,
|
|
|
firstClubType,
|
|
|
secondClubType,
|
|
|
department,
|
|
|
- medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
|
- mainpro as mainProduct,
|
|
|
+ medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
|
+ mainpro as mainProduct,
|
|
|
fax,
|
|
|
- info as profile,
|
|
|
- spID as serviceProviderId,
|
|
|
+ info as profile,
|
|
|
+ spID as serviceProviderId,
|
|
|
addTime,
|
|
|
status,
|
|
|
lastCheckOrderDate,
|
|
|
- newDeal as newDeal,
|
|
|
- (select userIdentity from user where userId = c.userId) as userIdentity,
|
|
|
- (select activeState from cm_organ_value_system where stage = 0 and delType = 1 and userId = c.userId) as activeState,
|
|
|
- (select customerValue from cm_organ_value_system where stage = 0 and delType = 1 and userId = c.userId) as customerValue
|
|
|
+ newDeal as newDeal,
|
|
|
+ (select userIdentity from user where userId = c.userId) as userIdentity,
|
|
|
+ (select activeState
|
|
|
+ from cm_organ_value_system
|
|
|
+ where stage = 0
|
|
|
+ and delType = 1
|
|
|
+ and userId = c.userId) as activeState,
|
|
|
+ (select customerValue
|
|
|
+ from cm_organ_value_system
|
|
|
+ where stage = 0
|
|
|
+ and delType = 1
|
|
|
+ and userId = c.userId) as customerValue
|
|
|
from club c
|
|
|
where clubID = #{clubId}
|
|
|
</select>
|
|
@@ -305,25 +321,25 @@
|
|
|
</update>
|
|
|
<update id="updateRemarks">
|
|
|
update cm_club_remarks
|
|
|
- set remarks = #{remarks},
|
|
|
- questionMan = #{questionMan},
|
|
|
- consultType = #{consult},
|
|
|
- clubType = #{clubType},
|
|
|
- pinceSensitve = #{pinceSensitve},
|
|
|
- satisfied = #{satisfied},
|
|
|
- followup = #{followup},
|
|
|
- extra = #{extra},
|
|
|
- productID = #{productID},
|
|
|
- reportID = #{reportID},
|
|
|
- communicationSituation = #{communicationSituation},
|
|
|
- communicationMethods = #{communicationMethods},
|
|
|
- customerSource = #{customerSource},
|
|
|
- customerGender = #{customerGender},
|
|
|
- customerAge = #{customerAge},
|
|
|
- groupAddition = #{groupAddition},
|
|
|
- trendsKeyword = #{trendsKeyword},
|
|
|
- stateKeyword = #{stateKeyword}
|
|
|
- where id = #{remarksId}
|
|
|
+ set remarks = #{remarks},
|
|
|
+ questionMan = #{questionMan},
|
|
|
+ consultType = #{consult},
|
|
|
+ clubType = #{clubType},
|
|
|
+ pinceSensitve = #{pinceSensitve},
|
|
|
+ satisfied = #{satisfied},
|
|
|
+ followup = #{followup},
|
|
|
+ extra = #{extra},
|
|
|
+ productID = #{productID},
|
|
|
+ reportID = #{reportID},
|
|
|
+ communicationSituation = #{communicationSituation},
|
|
|
+ communicationMethods = #{communicationMethods},
|
|
|
+ customerSource = #{customerSource},
|
|
|
+ customerGender = #{customerGender},
|
|
|
+ customerAge = #{customerAge},
|
|
|
+ groupAddition = #{groupAddition},
|
|
|
+ trendsKeyword = #{trendsKeyword},
|
|
|
+ stateKeyword = #{stateKeyword}
|
|
|
+ where id = #{remarksId}
|
|
|
</update>
|
|
|
<update id="updateQuestionMan">
|
|
|
update cm_visitor_remarks
|
|
@@ -333,8 +349,8 @@
|
|
|
</update>
|
|
|
<update id="updateVisitorRemark">
|
|
|
update cm_visitor_remarks
|
|
|
- set remarks = #{remarks},
|
|
|
- consultType = #{consult},
|
|
|
+ set remarks = #{remarks},
|
|
|
+ consultType = #{consult},
|
|
|
clubType=#{clubType},
|
|
|
pinceSensitve=#{pinceSensitve},
|
|
|
satisfied=#{satisfied},
|
|
@@ -342,14 +358,14 @@
|
|
|
extra=#{extra},
|
|
|
reportID=#{reportId},
|
|
|
productID=#{productId},
|
|
|
- communicationSituation = #{communicationSituation},
|
|
|
- communicationMethods = #{communicationMethods},
|
|
|
- customerSource = #{customerSource},
|
|
|
- customerGender = #{customerGender},
|
|
|
- customerAge = #{customerAge},
|
|
|
- groupAddition = #{groupAddition},
|
|
|
- trendsKeyword = #{trendsKeyword},
|
|
|
- stateKeyword = #{stateKeyword}
|
|
|
+ communicationSituation = #{communicationSituation},
|
|
|
+ communicationMethods = #{communicationMethods},
|
|
|
+ customerSource = #{customerSource},
|
|
|
+ customerGender = #{customerGender},
|
|
|
+ customerAge = #{customerAge},
|
|
|
+ groupAddition = #{groupAddition},
|
|
|
+ trendsKeyword = #{trendsKeyword},
|
|
|
+ stateKeyword = #{stateKeyword}
|
|
|
where id = #{remarksId}
|
|
|
</update>
|
|
|
<update id="updateVisit">
|
|
@@ -503,20 +519,31 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getRemarksInfo" resultType="com.caimei365.user.model.po.ClubRemarksPo">
|
|
|
- select ccr.communicationSituation, ccr.communicationMethods, ccr.customerSource,
|
|
|
- ccr.customerGender, ccr.groupAddition, ccr.customerAge,
|
|
|
- (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = c.clubId ORDER BY ADDTIME ASC LIMIT 1) AS firstTime,
|
|
|
- (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = c.clubId ORDER BY ADDTIME DESC LIMIT 1) AS recentlyTime
|
|
|
+ select ccr.communicationSituation,
|
|
|
+ ccr.communicationMethods,
|
|
|
+ ccr.customerSource,
|
|
|
+ ccr.customerGender,
|
|
|
+ ccr.groupAddition,
|
|
|
+ ccr.customerAge,
|
|
|
+ (SELECT ADDTIME FROM cm_club_remarks WHERE clubId = c.clubId ORDER BY ADDTIME ASC LIMIT 1) AS firstTime,
|
|
|
+ (SELECT ADDTIME
|
|
|
+ FROM cm_club_remarks
|
|
|
+ WHERE clubId = c.clubId
|
|
|
+ ORDER BY ADDTIME DESC
|
|
|
+ LIMIT 1) AS recentlyTime
|
|
|
from cm_club_remarks ccr
|
|
|
- left join club c on ccr.clubId = c.clubId
|
|
|
- where c.userId = #{userId} order by ccr.addTime desc limit 1
|
|
|
+ left join club c on ccr.clubId = c.clubId
|
|
|
+ where c.userId = #{userId}
|
|
|
+ order by ccr.addTime desc
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="getPriorKeywordList" resultType="java.util.Map">
|
|
|
select cusf.keyword as label
|
|
|
from cm_prior_keyword cpk
|
|
|
- left join cm_user_search_frequency cusf on cpk.searchId = cusf.id
|
|
|
- WHERE cpk.delFlag = 0 AND cusf.delStatus = 1
|
|
|
+ left join cm_user_search_frequency cusf on cpk.searchId = cusf.id
|
|
|
+ WHERE cpk.delFlag = 0
|
|
|
+ AND cusf.delStatus = 1
|
|
|
order by cusf.dynamicStatus DESC, cpk.addTime desc
|
|
|
</select>
|
|
|
|
|
@@ -529,7 +556,8 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertLabel">
|
|
|
- insert into cm_user_search_frequency(fromSearch, serviceProviderId, keyword, frequency, trueStatus, dynamicStatus, addTime)
|
|
|
+ insert into cm_user_search_frequency(fromSearch, serviceProviderId, keyword, frequency, trueStatus,
|
|
|
+ dynamicStatus, addTime)
|
|
|
values (4, #{serviceProviderId}, #{keyword}, 0, #{trueStatus}, #{dynamicStatus}, now())
|
|
|
</insert>
|
|
|
|
|
@@ -675,13 +703,16 @@
|
|
|
<select id="getRemarksListByKey" resultType="com.caimei365.user.model.vo.RemarksVo">
|
|
|
|
|
|
SELECT DISTINCT
|
|
|
- ccr.id AS remarksId, ccr.remarks,ccr.addTime,ccr.questionMan,ccr.serviceProviderId as serviceProviderId, ccr.createServiceProviderId as createServiceProviderId,
|
|
|
+ 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.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, ccr.trendsKeyword, ccr.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,c.newDeal as newDeal,cmc.status as status
|
|
|
+ (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.createServiceProviderId) as
|
|
|
+ recordName,c.newDeal as newDeal,cmc.status as status
|
|
|
# (SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.oldserviceProviderId) AS oldName
|
|
|
FROM cm_club_remarks ccr
|
|
|
LEFT JOIN serviceprovider s ON ccr.serviceProviderId = s.serviceProviderID
|
|
@@ -690,7 +721,7 @@
|
|
|
LEFT JOIN cm_serviceTeam_role csr ON csr.id = csg.teamId
|
|
|
LEFT JOIN cm_club_report cmc ON cmc.ID = ccr.reportID
|
|
|
where
|
|
|
- (ccr.serviceProviderId=#{serviceProviderId} or ccr.createServiceProviderId=#{serviceProviderId})
|
|
|
+ (ccr.serviceProviderId=#{serviceProviderId} or ccr.createServiceProviderId=#{serviceProviderId})
|
|
|
|
|
|
<if test="keyWord != null and keyWord != ''">
|
|
|
AND (ccr.remarks LIKE CONCAT('%', #{keyWord}, '%')
|
|
@@ -738,7 +769,8 @@
|
|
|
SELECT DISTINCT
|
|
|
ccr.id as remarksId, ccr.questionManId, ccr.remarks, ccr.addTime as addDate,
|
|
|
ccr.questionMan,IFNULL(ccr.consultType,'') as consult, ccr.createServiceProviderId as createServiceProviderId,
|
|
|
- ccr.serviceProviderId,ccr.clubType,ccr.pinceSensitve,ccr.satisfied,ccr.followup,ccr.extra,ccr.trendsKeyword, ccr.stateKeyword,
|
|
|
+ ccr.serviceProviderId,ccr.clubType,ccr.pinceSensitve,ccr.satisfied,ccr.followup,ccr.extra,ccr.trendsKeyword,
|
|
|
+ ccr.stateKeyword,
|
|
|
(SELECT linkMan FROM serviceprovider s WHERE s.serviceProviderID = ccr.serviceProviderId) AS recordName,
|
|
|
(select name from serviceprovider s where s.serviceProviderID = csr.leaderId) as leaderName,cmc.status as status
|
|
|
FROM cm_visitor_remarks ccr
|
|
@@ -959,8 +991,8 @@
|
|
|
SELECT keyword as label
|
|
|
FROM cm_user_search_frequency
|
|
|
WHERE keyword like concat('%', #{keyword}, '%')
|
|
|
- and dynamicStatus = #{type}
|
|
|
- and delStatus = 1
|
|
|
+ and dynamicStatus = #{type}
|
|
|
+ and delStatus = 1
|
|
|
order by addtime DESC
|
|
|
</select>
|
|
|
|
|
@@ -1086,10 +1118,26 @@
|
|
|
WHERE csg.serviceId = #{spId}
|
|
|
</select>
|
|
|
<select id="selTotal" resultType="com.caimei365.user.model.dto.CmPortraitDto">
|
|
|
- SELECT (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
|
|
|
- (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
|
|
|
- (SELECT COUNT(cbr.recordID) FROM cm_behavior_record cbr LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
- WHERE cbr.pageType IN (8, 9) AND c.clubID = #{clubId} AND cbr.accessDate <![CDATA[ < ]]> now()) AS totalkeywords,
|
|
|
+ SELECT (SELECT COUNT(shopOrderId)
|
|
|
+ FROM cm_shop_order
|
|
|
+ WHERE clubID = #{clubId}
|
|
|
+ AND shopStatus != 4
|
|
|
+ AND shopStatus != 5
|
|
|
+ AND refundStatus != 2
|
|
|
+ AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
|
|
|
+ (SELECT IFNULL(SUM(totalAmount), 0)
|
|
|
+ FROM cm_shop_order
|
|
|
+ WHERE clubID = #{clubId}
|
|
|
+ AND shopStatus != 4
|
|
|
+ AND shopStatus != 5
|
|
|
+ AND refundStatus != 2
|
|
|
+ AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
|
|
|
+ (SELECT COUNT(cbr.recordID)
|
|
|
+ FROM cm_behavior_record cbr
|
|
|
+ LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
+ WHERE cbr.pageType IN (8, 9)
|
|
|
+ AND c.clubID = #{clubId}
|
|
|
+ AND cbr.accessDate <![CDATA[ < ]]> now()) AS totalkeywords,
|
|
|
(SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubId} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
|
|
|
</select>
|
|
|
<select id="accessRecords" resultType="com.caimei365.user.model.vo.RecordVo">
|
|
@@ -1102,22 +1150,21 @@
|
|
|
ORDER BY cbr.accessDate DESC
|
|
|
</select>
|
|
|
<select id="recordDetail" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
|
- SELECT
|
|
|
- b.recordID,
|
|
|
- b.userID,
|
|
|
- b.pagePath,
|
|
|
- pt.pageType,
|
|
|
- b.pageLabel,
|
|
|
- b.productID,
|
|
|
- b.accessTime,
|
|
|
- b.accessDuration,
|
|
|
- b.accessDate,
|
|
|
- b.referer,
|
|
|
- b.accessClient,
|
|
|
- b.isReckon,
|
|
|
- b.region,
|
|
|
- p.name AS productName,
|
|
|
- p.mainImage AS productImage
|
|
|
+ SELECT b.recordID,
|
|
|
+ b.userID,
|
|
|
+ b.pagePath,
|
|
|
+ pt.pageType,
|
|
|
+ b.pageLabel,
|
|
|
+ b.productID,
|
|
|
+ b.accessTime,
|
|
|
+ b.accessDuration,
|
|
|
+ b.accessDate,
|
|
|
+ b.referer,
|
|
|
+ b.accessClient,
|
|
|
+ b.isReckon,
|
|
|
+ b.region,
|
|
|
+ p.name AS productName,
|
|
|
+ p.mainImage AS productImage
|
|
|
FROM cm_behavior_record b
|
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
|
LEFT JOIN product p ON b.productID = p.productID
|
|
@@ -1152,8 +1199,10 @@
|
|
|
|
|
|
<select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
|
|
|
SELECT
|
|
|
- (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
|
|
|
- (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
|
|
|
+ (SELECT COUNT(shopOrderId) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND shopStatus != 5
|
|
|
+ AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotal,
|
|
|
+ (SELECT IFNULL(SUM(totalAmount), 0) FROM cm_shop_order WHERE clubID = #{clubId} AND shopStatus != 4 AND
|
|
|
+ shopStatus != 5 AND refundStatus != 2 AND orderTime <![CDATA[ < ]]> NOW()) AS orderTotalAmount,
|
|
|
cso.clubID,
|
|
|
co.secondHandOrderFlag,
|
|
|
co.rebateFlag,
|
|
@@ -1165,7 +1214,8 @@
|
|
|
LEFT JOIN cm_order co ON cso.orderId = co.orderId
|
|
|
left join cm_order_product cop on cop.shopOrderId = cso.shopOrderId
|
|
|
<where>
|
|
|
- cso.clubID = #{clubId} AND cso.shopStatus != 4 AND cso.shopStatus != 5 AND cso.refundStatus != 2 AND cop.productId != 999
|
|
|
+ cso.clubID = #{clubId} AND cso.shopStatus != 4 AND cso.shopStatus != 5 AND cso.refundStatus != 2 AND
|
|
|
+ cop.productId != 999
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
|
AND cso.orderTime <![CDATA[ >= ]]> #{startTime} AND cso.orderTime <![CDATA[ <= ]]> #{endTime}
|
|
|
</if>
|
|
@@ -1189,14 +1239,14 @@
|
|
|
</select>
|
|
|
<select id="selRegion" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
|
SELECT IP as ip,
|
|
|
- accessSource,
|
|
|
- accessTime,
|
|
|
- pageType
|
|
|
+ accessSource,
|
|
|
+ accessTime,
|
|
|
+ pageType
|
|
|
FROM cm_behavior_record_ref
|
|
|
<where>
|
|
|
<if test="type == 0">
|
|
|
- IP = #{ip}
|
|
|
- AND accessTime like concat('%', #{accessDate}, '%')
|
|
|
+ IP = #{ip}
|
|
|
+ AND accessTime like concat('%', #{accessDate}, '%')
|
|
|
</if>
|
|
|
<if test="type == 1">
|
|
|
<if test="accessDateList.size()>0">
|
|
@@ -1249,30 +1299,35 @@
|
|
|
bindMobile as quickPayMobile,
|
|
|
bankUserName as quickPayUserName,
|
|
|
idCard,
|
|
|
- cqi.bankCvvCode as cvvCode,
|
|
|
- cqi.bankExpireTime as quickPayBankExpireTime
|
|
|
+ cqi.bankCvvCode as cvvCode,
|
|
|
+ cqi.bankExpireTime as quickPayBankExpireTime
|
|
|
FROM cm_quickpay_info cqi
|
|
|
LEFT JOIN cm_quickpay_bankcode cqb ON cqi.quickPayBankCode = cqb.bankCode
|
|
|
where cqi.userId = #{userId}
|
|
|
and cqi.delFlag = 0
|
|
|
</select>
|
|
|
<select id="selSpLinkMan" resultType="java.lang.String">
|
|
|
- SELECT linkMan FROM serviceprovider WHERE serviceProviderID = #{choseServiceId}
|
|
|
+ SELECT linkMan
|
|
|
+ FROM serviceprovider
|
|
|
+ WHERE serviceProviderID = #{choseServiceId}
|
|
|
</select>
|
|
|
<select id="getSpIdRAND" resultType="java.lang.Integer">
|
|
|
- SELECT sp.serviceProviderID FROM serviceprovider sp
|
|
|
+ SELECT sp.serviceProviderID
|
|
|
+ FROM serviceprovider sp
|
|
|
WHERE sp.organizeID = 0
|
|
|
- and sp.status=90
|
|
|
- and sp.serviceProviderID NOT IN ( 1342 , 1353 , 1369)
|
|
|
+ and sp.status = 90
|
|
|
+ and sp.insiderFlag = 0
|
|
|
+ and sp.serviceProviderID != 1342
|
|
|
and linkMan not LIKE '%测试%'
|
|
|
ORDER BY RAND()
|
|
|
LIMIT 0,1;
|
|
|
</select>
|
|
|
<select id="getSpUserId" resultType="java.lang.Integer">
|
|
|
- SELECT sp.userId FROM serviceprovider sp
|
|
|
+ SELECT sp.userId
|
|
|
+ FROM serviceprovider sp
|
|
|
WHERE sp.organizeID = 0
|
|
|
- and sp.status=90
|
|
|
- and sp.serviceProviderID=#{spId}
|
|
|
+ and sp.status = 90
|
|
|
+ and sp.serviceProviderID = #{spId}
|
|
|
LIMIT 0,1;
|
|
|
</select>
|
|
|
<insert id="inProvider">
|