|
@@ -80,34 +80,35 @@
|
|
|
where userID = #{userId}
|
|
|
</update>
|
|
|
<select id="selClubData" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
|
- select
|
|
|
- userId,
|
|
|
- clubId,
|
|
|
- name,
|
|
|
- linkMan,
|
|
|
- linkManIdentity,
|
|
|
- contractEmail,
|
|
|
- sname as shortName,
|
|
|
- provinceId,
|
|
|
- cityId,
|
|
|
- townId,
|
|
|
- address,
|
|
|
- socialCreditCode,
|
|
|
- businessLicenseImage as businessLicense,
|
|
|
- headpic as shopPhoto,
|
|
|
- firstClubType,
|
|
|
- secondClubType,
|
|
|
- department,
|
|
|
- medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
|
- mainpro as mainProduct,
|
|
|
- fax,
|
|
|
- contractPhone,
|
|
|
- info as profile
|
|
|
- from club where clubID = #{clubID}
|
|
|
+ select userId,
|
|
|
+ clubId,
|
|
|
+ name,
|
|
|
+ linkMan,
|
|
|
+ linkManIdentity,
|
|
|
+ contractEmail,
|
|
|
+ sname as shortName,
|
|
|
+ provinceId,
|
|
|
+ cityId,
|
|
|
+ townId,
|
|
|
+ address,
|
|
|
+ socialCreditCode,
|
|
|
+ businessLicenseImage as businessLicense,
|
|
|
+ headpic as shopPhoto,
|
|
|
+ firstClubType,
|
|
|
+ secondClubType,
|
|
|
+ department,
|
|
|
+ medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
|
+ mainpro as mainProduct,
|
|
|
+ fax,
|
|
|
+ contractPhone,
|
|
|
+ info as profile
|
|
|
+ from club
|
|
|
+ where clubID = #{clubID}
|
|
|
</select>
|
|
|
<select id="selSpName" resultType="java.lang.String">
|
|
|
select case status when 91 then '采美默认协销经理(官方账号)' else linkMan end AS spName
|
|
|
- from serviceprovider where serviceProviderID = #{serviceProviderId}
|
|
|
+ from serviceprovider
|
|
|
+ where serviceProviderID = #{serviceProviderId}
|
|
|
</select>
|
|
|
<insert id="insertOpLogs">
|
|
|
INSERT INTO operational_logs
|
|
@@ -209,7 +210,7 @@
|
|
|
provinceID as proviceId,
|
|
|
cityID as cityId,
|
|
|
townID as townId,
|
|
|
- ifnull(address,'暂无') as address,
|
|
|
+ ifnull(address, '暂无') as address,
|
|
|
headpic as shopPhoto,
|
|
|
businessLicenseImage as businessLicense,
|
|
|
socialCreditCode,
|
|
@@ -944,7 +945,11 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selAddTime" resultType="java.lang.String">
|
|
|
- select addTime from record_link where clubId = #{clubId} order by addTime desc limit 1
|
|
|
+ select addTime
|
|
|
+ from record_link
|
|
|
+ where clubId = #{clubId}
|
|
|
+ order by addTime desc
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="serviceProviderNameage" resultType="java.lang.String">
|
|
@@ -1015,41 +1020,50 @@
|
|
|
<select id="findLeaderIdBySp" resultType="java.lang.Integer">
|
|
|
SELECT leaderId
|
|
|
FROM cm_serviceteam_role csr
|
|
|
- LEFT JOIN cm_serviceteam_group csg ON csr.id=csg.teamId
|
|
|
+ LEFT JOIN cm_serviceteam_group csg ON csr.id = csg.teamId
|
|
|
WHERE csg.serviceId = #{spId}
|
|
|
</select>
|
|
|
<select id="selTotal" resultType="com.caimei365.user.model.dto.CmPortraitDto">
|
|
|
- SELECT
|
|
|
- (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubId} AND orderTime <![CDATA[ < ]]> now()) AS orderTotal,
|
|
|
- (SELECT SUM(payTotalFee) FROM cm_order WHERE clubID = #{clubId} 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 COUNT(orderID) FROM cm_order WHERE clubID = #{clubId} AND orderTime <![CDATA[ < ]]> now()) AS orderTotal,
|
|
|
+ (SELECT SUM(payTotalFee)
|
|
|
+ FROM cm_order
|
|
|
+ WHERE clubID = #{clubId}
|
|
|
+ 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">
|
|
|
- SELECT accessDate,COUNT(cbr.recordID) AS number,IP AS ip
|
|
|
+ SELECT accessDate, COUNT(cbr.recordID) AS number, IP AS ip
|
|
|
FROM cm_behavior_record cbr
|
|
|
- LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
+ LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
WHERE cbr.delFlag = 0
|
|
|
AND c.clubID = #{clubId}
|
|
|
- GROUP BY cbr.IP, cbr.accessDate ORDER BY cbr.accessDate DESC
|
|
|
+ GROUP BY cbr.IP, cbr.accessDate
|
|
|
+ ORDER BY cbr.accessDate DESC
|
|
|
</select>
|
|
|
<select id="recordDetail" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
|
- SELECT
|
|
|
- pt.pageType,
|
|
|
- b.pageLabel,
|
|
|
- p.name AS productName,
|
|
|
- p.mainImage AS productImage,
|
|
|
- b.accessDuration,
|
|
|
- b.accessSource,
|
|
|
- b.accessClient,
|
|
|
- b.accessTime
|
|
|
+ SELECT pt.pageType,
|
|
|
+ b.pageLabel,
|
|
|
+ p.name AS productName,
|
|
|
+ p.mainImage AS productImage,
|
|
|
+ b.accessDuration,
|
|
|
+ b.accessSource,
|
|
|
+ b.accessClient,
|
|
|
+ b.accessTime
|
|
|
FROM cm_behavior_record b
|
|
|
- LEFT JOIN club c ON b.userID = c.userID
|
|
|
- LEFT JOIN product p ON b.productID = p.productID
|
|
|
- LEFT JOIN cm_page_type pt ON b.pageType = pt.id
|
|
|
- WHERE c.clubID = #{clubId} AND b.accessDate = #{accessDate} order by b.accessTime desc
|
|
|
+ LEFT JOIN club c ON b.userID = c.userID
|
|
|
+ LEFT JOIN product p ON b.productID = p.productID
|
|
|
+ LEFT JOIN cm_page_type pt ON b.pageType = pt.id
|
|
|
+ WHERE c.clubID = #{clubId}
|
|
|
+ AND b.accessDate = #{accessDate}
|
|
|
+ order by b.accessTime desc
|
|
|
</select>
|
|
|
- <select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
|
|
|
+ <select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
|
|
|
SELECT
|
|
|
(SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubId}) as numbers,
|
|
|
(SELECT SUM(payTotalFee) FROM cm_order WHERE clubID = #{clubId}) as totalMoney,
|
|
@@ -1085,12 +1099,13 @@
|
|
|
ORDER BY COUNT(cbr.pageLabel) LIMIT 10
|
|
|
</select>
|
|
|
<select id="selRegion" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
|
- SELECT
|
|
|
- IP as ip,
|
|
|
- accessSource,
|
|
|
- accessTime,
|
|
|
- pageType
|
|
|
- FROM cm_behavior_record_ref WHERE IP = #{ip} AND accessTime like concat('%', #{accessDate} ,'%')
|
|
|
+ SELECT IP as ip,
|
|
|
+ accessSource,
|
|
|
+ accessTime,
|
|
|
+ pageType
|
|
|
+ FROM cm_behavior_record_ref
|
|
|
+ WHERE IP = #{ip}
|
|
|
+ AND accessTime like concat('%', #{accessDate}, '%')
|
|
|
</select>
|
|
|
<select id="selRemarksList" resultType="com.caimei365.user.model.vo.CmClubRemarksVo">
|
|
|
SELECT
|
|
@@ -1122,13 +1137,20 @@
|
|
|
AND cbr.accessDate <![CDATA[ >= ]]> #{startTime} AND cbr.accessDate <![CDATA[ <= ]]> #{endTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
- GROUP BY cbr.pageType ORDER BY COUNT(cbr.pageType) LIMIT 10
|
|
|
+ GROUP BY cbr.pageType ORDER BY COUNT(cbr.pageType) LIMIT 10
|
|
|
</select>
|
|
|
<select id="findBanks" resultType="com.caimei365.user.model.vo.BanksVo">
|
|
|
- SELECT DISTINCT id, bankNumber, bankType, cqb.bankName
|
|
|
+ SELECT DISTINCT cqi.id,
|
|
|
+ bankNumber as quickPayBankNumber,
|
|
|
+ bankType,
|
|
|
+ cqb.bankName,
|
|
|
+ cqi.quickPayBankCode as bankCode,
|
|
|
+ bindMobile as quickPayMobile,
|
|
|
+ bankUserName as quickPayUserName,
|
|
|
+ idCard
|
|
|
FROM cm_quickpay_info cqi
|
|
|
- LEFT JOIN cm_quickpay_bankcode cqb ON cqi.quickPayBankCode = cqb.bankCode
|
|
|
+ LEFT JOIN cm_quickpay_bankcode cqb ON cqi.quickPayBankCode = cqb.bankCode
|
|
|
where cqi.userId = #{userId}
|
|
|
- and cqi.delFlag = 0
|
|
|
+ and cqi.delFlag = 0
|
|
|
</select>
|
|
|
</mapper>
|