<?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.BasePicMapper">
    
    <resultMap type="BasePic" id="BasePicResult">
        <result property="id"    column="id"    />
        <result property="title"    column="title"    />
        <result property="sort"    column="sort"    />
        <result property="pic"    column="pic"    />
        <result property="tenantId"    column="tenant_id"    />
        <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="selectBasePicVo">
        select id, title, sort, pic, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_pic
    </sql>

    <select id="queryListPage" parameterType="BasePic" resultMap="BasePicResult">
        <include refid="selectBasePicVo"/>
        <where>
            and del_flag='0'
                        <if test="entity.title != null  and entity.title != ''"> and title = #{entity.title}</if>
                        <if test="entity.sort != null "> and sort = #{entity.sort}</if>
                        <if test="entity.pic != null  and entity.pic != ''"> and pic = #{entity.pic}</if>
                        <if test="entity.tenantId != null  and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
        </where>
        ORDER BY sort DESC
    </select>
</mapper>