luodangjia
2024-12-16 a8d2cb07f6440dc54dc4005b0b06d5a47cb1517d
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
<?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.UserChangeLogMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserChangeLog">
        <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="before_vip_id" property="beforeVipId" />
        <result column="after_vip_id" property="afterVipId" />
        <result column="change_type" property="changeType" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, del_flag, create_time, app_user_id, before_vip_id, after_vip_id, change_type
    </sql>
    <select id="pageList" resultType="com.ruoyi.account.api.model.UserChangeLog">
        SELECT t1.*,t2.`name` as userName,t2.phone as userPhone
        from t_user_change_log t1
                 LEFT JOIN t_app_user t2 on t1.app_user_id = t2.id
        <where>
            <if test="userChangeLog.name !=null and userChangeLog.name !=''">
                and t2.name like concat('%',#{userChangeLog.name},'%')
            </if>
            <if test="userChangeLog.phone !=null and userChangeLog.phone !=''">
                and t2.phone like concat('%',#{userChangeLog.phone},'%')
            </if>
            <if test="userChangeLog.changeType !=null">
                and t1.change_type = #{userChangeLog.phone.changeType}
            </if>
            <if test="userChangeLog.localDate1 !=null">
                and DATE(t1.create_time) between #{userChangeLog.localDate1} and #{userChangeLog.localDate2}
            </if>
        </where>
    </select>
 
</mapper>