<?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.KxsLeaderMapper">

    <resultMap type="com.kxs.user.api.model.KxsLeader" id="KxsLeaderMap">
        <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="leader_type" property="leaderType"/>
        <result column="expired_date" property="expiredDate"/>
        <result column="last_buy_date" property="lastBuyDate"/>
        <result column="leader_level" property="leaderLevel"/>

    </resultMap>
    <select id="selectByLeader" resultMap="KxsLeaderMap">
        select *
        from kxs_leader
        where user_id = #{userId}
          and expired_date > #{expiredDate}
          and del_flag = 0
    </select>

</mapper>
