<?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.BasePicsMapper">
    
    <resultMap type="BasePics" id="BasePicsResult">
        <result property="id"    column="id"    />
        <result property="fileType"    column="file_type"    />
        <result property="name"    column="name"    />
        <result property="url"    column="url"    />
        <result property="size"    column="size"    />
        <result property="width"    column="width"    />
        <result property="height"    column="height"    />
        <result property="remark"    column="remark"    />
        <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="selectBasePicsVo">
        select id, file_type, name, url, size, width, height, remark, tenant_id, creator, create_time, updater, update_time, del_flag from dl_base_pics
    </sql>

    <select id="queryListPage" parameterType="BasePics" resultMap="BasePicsResult">
        <include refid="selectBasePicsVo"/>
        <where>
            and del_flag='0'
                        <if test="entity.fileType != null  and entity.fileType != ''"> and file_type = #{entity.fileType}</if>
                        <if test="entity.name != null  and entity.name != ''"> and name like concat('%', #{entity.name}, '%')</if>
                        <if test="entity.url != null  and entity.url != ''"> and url = #{entity.url}</if>
                        <if test="entity.size != null "> and size = #{entity.size}</if>
                        <if test="entity.width != null "> and width = #{entity.width}</if>
                        <if test="entity.height != null "> and height = #{entity.height}</if>
                        <if test="entity.remark != null  and entity.remark != ''"> and remark = #{entity.remark}</if>
                        <if test="entity.tenantId != null  and entity.tenantId != ''"> and tenant_id = #{entity.tenantId}</if>
        </where>
        ORDER BY create_time DESC
    </select>
</mapper>