123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <?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.caimei365.manager.dao.user.CmBehaviorRecordDao">
- <sql id="behaviorRecord">
- b.recordID,
- b.IP as ip,
- b.userID as userId,
- b.pagePath,
- b.pageType,
- b.pageLabel,
- b.productID as productId,
- b.accessTime,
- b.accessDate
- </sql>
- <select id="findList" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
- SELECT
- IP as ip,
- userID as userId,
- clubID as clubId,
- lastAccessTime,
- companyType,
- corporateName,
- contacts,
- phoneNumber,
- spName,
- number as numbers,
- consultName,
- consultMobile,
- productID,
- accessTime,
- accessDuration,
- accessDate,
- accessClient,
- region,
- label,
- relevanceShop,
- addTime
- FROM cm_behavior_record_index
- <where>
- delFlag = 0
- <if test="ip != null and ip != ''">
- AND IP = #{ip}
- </if>
- <if test="corporateName != null and corporateName != ''">
- AND corporateName like concat('%',#{corporateName},'%')
- </if>
- <if test="companyType != null and companyType != ''">
- AND companyType = #{companyType}
- </if>
- <if test="accessClient != null and accessClient != ''">
- AND accessClient =#{accessClient}
- </if>
- <if test="contacts != null and contacts != ''">
- AND contacts = #{contacts}
- </if>
- <if test="phoneNumber != null and phoneNumber != ''">
- AND phoneNumber = #{phoneNumber}
- </if>
- <if test="spName != null and spName != ''">
- AND spName = #{spName}
- </if>
- <if test="relevanceShop != null and relevanceShop != ''">
- AND relevanceShop like concat('%',#{relevanceShop},'%')
- <if test="behaviorType == 2">
- or behaviorType = #{behaviorType}
- </if>
- </if>
- <if test="labels != null and labels.size > 0">
- AND
- <foreach collection="labels" open="(" close=")" separator="or" item="label">
- label like concat('%',#{label},'%')
- </foreach>
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- AND accessDate between #{startTime} and #{endTime}
- </if>
- </where>
- ORDER BY accessTime DESC
- </select>
- <select id="findListToday" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
- SELECT
- IP as ip,
- userID as userId,
- clubID as clubId,
- lastAccessTime,
- companyType,
- corporateName,
- contacts,
- phoneNumber,
- spName,
- number as numbers,
- consultName,
- consultMobile,
- accessTime,
- accessDuration,
- accessDate,
- accessClient,
- region,
- relevanceShop,
- label,
- relevanceShop,
- addTime
- FROM cm_behavior_record_today
- <where>
- <if test="ip != null and ip != ''">
- AND IP = #{ip}
- </if>
- <if test="corporateName != null and corporateName != ''">
- AND corporateName like concat('%',#{corporateName},'%')
- </if>
- <if test="companyType != null and companyType != ''">
- AND companyType = #{companyType}
- </if>
- <if test="accessClient != null and accessClient != ''">
- AND accessClient =#{accessClient}
- </if>
- <if test="contacts != null and contacts != ''">
- AND contacts = #{contacts}
- </if>
- <if test="phoneNumber != null and phoneNumber != ''">
- AND phoneNumber = #{phoneNumber}
- </if>
- <if test="spName != null and spName != ''">
- AND spName = #{spName}
- </if>
- <if test="relevanceShop != null and relevanceShop != ''">
- AND relevanceShop like concat('%',#{relevanceShop},'%')
- </if>
- <if test="labels != null and labels.size > 0">
- AND
- <foreach collection="labels" open="(" close=")" separator="or" item="label">
- label like concat('%',#{label},'%')
- </foreach>
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- AND accessDate between #{startTime} and #{endTime}
- </if>
- </where>
- ORDER BY accessTime DESC
- </select>
- <select id="selRegion" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
- SELECT * FROM cm_behavior_record_ref where accessTime like concat('%',#{accessDate},'%')
- </select>
- <select id="recordList" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
- SELECT
- <include refid="behaviorRecord"/>
- ,b.accessDuration,
- b.accessSource,
- b.accessClient,
- u.userIdentity,
- c.name,
- c.clubId,
- c.linkMan,
- c.contractMobile,
- s.name AS sname,
- s.linkMan AS slinkMan,
- s.contractMobile AS sncontractMobile,
- p.name AS productName,
- p.mainImage AS productImage,
- pt.pagetype AS pageTypes
- FROM cm_behavior_record b
- LEFT JOIN USER u ON b.userID = u.userID
- LEFT JOIN club c ON b.userID = c.userID
- LEFT JOIN shop s ON b.userID = s.userID
- LEFT JOIN product p ON b.productID = p.productID
- LEFT JOIN cm_page_type pt ON b.pageType = pt.id
- <where>
- b.accessDate = #{accessDate} AND b.IP != '106.55.202.118' AND b.delFlag = 0
- <if test="userId != null">
- AND b.userID = #{userId} AND b.IP = #{ip}
- </if>
- </where>
- ORDER BY accessTime DESC
- </select>
- <select id="searchList" resultType="com.caimei365.manager.entity.caimei.RetuenEntity">
- select id , keyword as value from cm_user_search_frequency where trueStatus = 1
- </select>
- <select id="behaviorShopNameList" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
- SELECT cbs.recordID, cbs.shopID, s.name FROM cm_behavior_shopId cbs LEFT JOIN shop s ON cbs.shopID = s.shopID
- </select>
- </mapper>
|