123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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">
- <mapper namespace="com.caimei.modules.user.dao.CmPortraitDao">
- <select id="selTotal" resultType="com.caimei.modules.user.entity.CmPortrait">
- 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="selOrderList" resultType="com.caimei.modules.order.entity.NewOrder">
- SELECT
- (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubID}) as numbers,
- (SELECT SUM(payTotalFee) FROM cm_order WHERE clubID = #{clubID}) as totalMoney,
- clubID,
- secondHandOrderFlag,
- rebateFlag,
- refundType,
- productTotalFee,
- STATUS,
- orderTime
- FROM cm_order
- <where>
- clubID = #{clubID}
- <if test="accessDate != null and accessDate != ''">
- AND orderTime like concat('%',#{accessDate},'%')
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- AND orderTime <![CDATA[ >= ]]> #{startTime} AND orderTime <![CDATA[ <= ]]> #{endTime}
- </if>
- </where>
- </select>
- <select id="selBehaviorList" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">
- SELECT
- c.clubID,
- COUNT(cbr.pageLabel) as number,
- cbr.pageLabel,
- cbr.accessDate
- 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.pageLabel IS NOT NULL AND cbr.pageLabel != ''
- <if test="accessDate != null and accessDate != ''">
- AND cbr.accessDate = #{accessDate}
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- AND cbr.accessDate between #{startTime} and #{endTime}
- </if>
- </where>
- GROUP BY cbr.pageLabel
- ORDER BY COUNT(cbr.pageLabel) LIMIT 10
- </select>
- <select id="selRemarksList" resultType="com.caimei.modules.user.entity.CmClubRemarks">
- SELECT
- (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubID}) as numbers,
- clubID,
- COUNT(remarks) as number,
- remarks,
- addTime
- FROM cm_club_remarks
- <where>
- clubID = #{clubID}
- <if test="accessDate != null and accessDate != ''">
- AND addTime like concat('%', #{accessDate},'%')
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- AND addTime between #{startTime} and #{endTime}
- </if>
- </where>
- GROUP BY remarks ORDER BY COUNT(remarks) LIMIT 10
- </select>
- <select id="selBehaviorPageTypeList" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">
- SELECT
- c.clubID,
- COUNT(cbr.pageType) as numbers,
- cbr.pageLabel,
- cbr.accessDate
- FROM cm_behavior_record cbr
- LEFT JOIN club c ON cbr.userID = c.userID
- <where>
- c.clubID = #{clubID}
- <if test="accessDate != null and accessDate != ''">
- AND cbr.accessDate like concat('%', #{accessDate},'%')
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- AND cbr.accessDate between #{startTime} and #{endTime}
- </if>
- </where>
- GROUP BY cbr.pageType ORDER BY COUNT(cbr.pageType) LIMIT 10
- </select>
- </mapper>
|