<?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.fs.course.mapper.FsVideoResourceMapper">

    <select id="selectVideoResourceListByMap" resultType="com.fs.course.vo.FsVideoResourceVO">
        select
            rr.*
        from fs_video_resource rr
        where rr.is_del = 0
        <if test="params.resourceName != null and params.resourceName != ''">
            and rr.resource_name like concat('%', #{params.resourceName}, '%')
        </if>
        <if test="params.fileName != null and params.fileName != ''">
            and rr.file_name like concat('%', #{params.fileName}, '%')
        </if>
        <if test="params.typeId != null">
            and rr.type_id = #{params.typeId}
        </if>
        <if test="params.userId != null">
            and rr.user_id = #{params.userId}
        </if>
        <if test="params.typeSubId != null">
            and rr.type_sub_id = #{params.typeSubId}
        </if>
        order by rr.resource_name
    </select>
</mapper>
