<?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.base.mapper.BaseCardMapper">
    
    <resultMap type="BaseCard" id="BaseCardResult">
        <result property="id"    column="id"    />
        <result property="cardName"    column="card_name"    />
        <result property="userType"    column="user_type"    />
        <result property="content"    column="content"    />
        <result property="sort"    column="sort"    />
        <result property="isSystem"    column="is_system"    />
        <result property="image"    column="image"    />
        <result property="monthPrice"    column="month_price"    />
        <result property="quarterPrice"    column="quarter_price"    />
        <result property="yearPrice"    column="year_price"    />
        <result property="remark"    column="remark"    />
        <result property="isShow"    column="is_show"    />
        <result property="creator"    column="creator"    />
        <result property="createTime"    column="create_time"    />
        <result property="updater"    column="updater"    />
        <result property="updateTime"    column="update_time"    />
        <result property="delFlag"    column="del_flag"    />
    </resultMap>

    <sql id="selectBaseCardVo">
        select id, card_name, user_type, content, sort, is_system, image, month_price, quarter_price, year_price, remark, is_show, creator, create_time, updater, update_time, del_flag from dl_base_card
    </sql>

    <select id="queryListPage" parameterType="BaseCard" resultMap="BaseCardResult">
        <include refid="selectBaseCardVo"/>
        <where>
del_flag=0
                        <if test="entity.cardName != null  and entity.cardName != ''"> and card_name like concat('%', #{entity.cardName}, '%')</if>
                        <if test="entity.userType != null  and entity.userType != ''"> and user_type = #{entity.userType}</if>
                        <if test="entity.isSystem != null "> and is_system = #{entity.isSystem}</if>
        </where>
        order by user_type,sort asc,create_time desc
    </select>
</mapper>