<?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="org.springblade.system.mapper.FilesCustomizeClassifyMapper">
    <insert id="addKyFilesCustomizeClassify">
        insert into da_ky_files_customize_classify
        (customize_classify_name,classify_desc,create_time,update_time,create_user_id,create_user_name,update_user_id,update_user_name)
        values (#{customizeClassifyName},#{classifyDesc},#{createTime},#{createTime},#{createUserId},#{createUserName},#{updateUserId},#{updateUserName})

    </insert>
    <update id="updateKyFilesCustomizeClassify">
        update da_ky_files_customize_classify
        <trim prefix="set" suffixOverrides=",">
            <if test="customizeClassifyName!=null">
                customize_classify_name =#{customizeClassifyName},
            </if>
            <if test="classifyDesc!=null">
                classify_desc =#{classifyDesc},
            </if>
            <if test="updateUserId!=null">
                update_user_id =#{updateUserId},
            </if>
            <if test="updateUserName!=null">
                update_user_name =#{updateUserName},
            </if>
            <if test="updateTime!=null">
                update_time =#{updateTime},
            </if>
        </trim>
        where id = #{id}
    </update>
    <delete id="delKyFilesCustomizeClassify">
        update da_ky_files_customize_classify set del_flag = '0' where id = #{id}
    </delete>

    <select id="getKyFilesCustomizeClassifyList" resultType="org.springblade.common.core.domain.entity.KyFilesCustomizeClassify">
    select id,customize_classify_name,classify_desc,create_time,update_time,create_user_id,create_user_name,
           update_user_id,update_user_name
    from da_ky_files_customize_classify where del_flag = '1'
        <if test="customizeClassifyName!=null">
            AND INSTR(customize_classify_name, #{customizeClassifyName}) > 0
        </if>
    </select>
    <select id="getKyFilesCustomizeClassify" resultType="org.springblade.common.core.domain.entity.KyFilesCustomizeClassify">
        select id,customize_classify_name,classify_desc,create_time,update_time,create_user_id,create_user_name,
               update_user_id,update_user_name
        from da_ky_files_customize_classify where del_flag = '1' and customize_classify_name =#{customizeClassifyName}
    </select>
</mapper>
