<?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.userName !=null and userChangeLog.userName !=''">
|
and t2.name like concat('%',#{userChangeLog.userName},'%')
|
</if>
|
<if test="userChangeLog.userPhone !=null and userChangeLog.userPhone !=''">
|
and t2.phone like concat('%',#{userChangeLog.userPhone},'%')
|
</if>
|
<if test="userChangeLog.changeType !=null">
|
and t1.change_type = #{userChangeLog.changeType}
|
</if>
|
<if test="userChangeLog.localDate1 !=null">
|
and t1.create_time between #{userChangeLog.localDate1} and #{userChangeLog.localDate2}
|
</if>
|
</where>
|
order by t1.create_time desc
|
</select>
|
|
</mapper>
|