<?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.web.modules.account.mapper.BizMemberLevelMapper">

    <resultMap id="BizMemberLevelResult" type="com.ruoyi.web.modules.account.domain.BizMemberLevel">
        <id property="levelId" column="level_id"/>
        <result property="levelNo" column="level_no"/>
        <result property="levelName" column="level_name"/>
        <result property="levelIcon" column="level_icon"/>
        <result property="benefits" column="benefits"/>
        <result property="sortNo" column="sort_no"/>
        <result property="status" column="status"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
    </resultMap>

    <sql id="selectVo">
        select level_id, level_no, level_name, level_icon, benefits, sort_no, status, del_flag,
               create_by, create_time, update_by, update_time, remark
        from biz_member_level
    </sql>

    <select id="selectEnabledList" resultMap="BizMemberLevelResult">
        <include refid="selectVo"/>
        where del_flag = '0' and status = '0'
        order by sort_no asc, level_no asc
    </select>

    <select id="selectByLevelNo" resultMap="BizMemberLevelResult">
        <include refid="selectVo"/>
        where del_flag = '0' and level_no = #{levelNo}
        limit 1
    </select>

</mapper>
