Pu Zhibing
2025-04-22 fd7b8fb7c89832c28a838b0449bbb8a392433ee2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?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.ruoyi.account.mapper.UserClickLogMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserClickLog">
        <id column="id" property="id" />
        <result column="del_flag" property="delFlag" />
        <result column="create_time" property="createTime" />
        <result column="app_user_id" property="appUserId" />
        <result column="vip_id" property="vipId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, del_flag, create_time, app_user_id, vip_id
    </sql>
    <select id="pageList" resultType="com.ruoyi.account.api.model.UserClickLog">
            select
            t1.* ,
            t2.phone as userPhone,
            t2.name as userName,
            DATE_FORMAT(t1.create_time, '%Y-%m-%d %H:%i:%s') as createTimeStr
            from t_user_click_log t1
            left join t_app_user t2 on t1.app_user_id = t2.id
            <where>
                <if test="agentQuery.userPhone != null and agentQuery.userPhone != ''">
                    and t2.phone like concat('%',#{agentQuery.userPhone},'%')
                </if>
                <if test="agentQuery.userName != null and agentQuery.userName != ''">
                    and t2.name like concat('%',#{agentQuery.userName},'%')
                </if>
                <if test="agentQuery.vipId != null">
                    and t1.vip_id = #{agentQuery.vipId}
                </if>
                <if test="agentQuery.localDate1 != null">
                    and DATE(t1.create_time) between #{agentQuery.localDate1} and #{agentQuery.localDate2}
                </if>
            </where>
        order by t1.create_time desc
    </select>
 
</mapper>