<?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.kxs.user.biz.mapper.KxsUserPresetLogMapper">

    <resultMap type="com.kxs.user.api.model.KxsUserPresetLog" id="KxsUserPresetLogMap">
        <result column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
        <result column="version" property="version" />
        <result column="user_id" property="userId" />
        <result column="start_time" property="startTime" />
        <result column="end_time" property="endTime" />
        <result column="preset_level" property="presetLevel" />
        <result column="create_by_id" property="createById" />

    </resultMap>
    <select id="logList" resultType="com.kxs.user.api.vo.kxsapp.userPresetLevel.UserPresetLogVO">
        select u.id, a.end_time, a.preset_level, u.username, u.avatar from kxs_user_preset_log a
                 left join kxs_user u on u.id = a.user_id
                 where a.create_by_id = #{userId}
                 order by a.end_time desc
    </select>

</mapper>
