<?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="im.zhaojun.zfile.module.filter.mapper.FilterConfigMapper">
    <resultMap id="BaseResultMap" type="im.zhaojun.zfile.module.filter.model.entity.FilterConfig">
        <!--@mbg.generated-->
        <!--@Table filter_config-->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="storage_id" jdbcType="INTEGER" property="storageId"/>
        <result column="expression" jdbcType="VARCHAR" property="expression"/>
        <result column="mode" jdbcType="VARCHAR" property="mode"/>
        <result column="description" jdbcType="VARCHAR" property="description" />
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id, storage_id, expression, mode, description
    </sql>

<!--auto generated by MybatisCodeHelper on 2021-07-15-->
    <select id="findByStorageId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from filter_config
        where storage_id=#{storageId,jdbcType=INTEGER}
    </select>

<!--auto generated by MybatisCodeHelper on 2021-07-15-->
    <delete id="deleteByStorageId">
        delete from filter_config
        where storage_id=#{storageId,jdbcType=INTEGER}
    </delete>

<!--auto generated by MybatisCodeHelper on 2022-02-13-->
    <select id="findByStorageIdAndInaccessible" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from filter_config
        where `storage_id`=#{storageId,jdbcType=INTEGER}
        and `mode` = 'inaccessible'
    </select>

    <!--auto generated by MybatisCodeHelper on 2022-02-13-->
    <select id="findByStorageIdAndDisableDownload" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from filter_config
        where `storage_id`=#{storageId,jdbcType=INTEGER}
        and `mode` = 'disable_download'
    </select>
</mapper>