<?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.sckw.file.dao.KwsFileInfoDao">
    <resultMap id="BaseResultMap" type="com.sckw.file.model.kwfFileInfo">
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="type" jdbcType="VARCHAR" property="type" />
        <result column="original_name" jdbcType="VARCHAR" property="originalName" />
        <result column="file_name" jdbcType="VARCHAR" property="fileName" />
        <result column="md5" jdbcType="VARCHAR" property="md5" />
        <result column="file_suffix" jdbcType="BIGINT" property="fileSuffix" />
        <result column="file_size" jdbcType="DECIMAL" property="fileSize" />
        <result column="file_path" jdbcType="INTEGER" property="filePath" />
        <result column="remark" jdbcType="INTEGER" property="remark" />
        <result column="status" jdbcType="INTEGER" property="status" />
        <result column="create_by" jdbcType="VARCHAR" property="createBy" />
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
        <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
        <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
    </resultMap>

    <sql id="Base_Column_List">
        id, type, original_name, file_name, md5, file_suffix, file_size, file_path, remark, status,
    create_by, create_time, update_by, update_time, del_flag
    </sql>
    <update id="update"></update>

    <select id="selectByKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from kwf_file_info
        where id = #{id,jdbcType=BIGINT}
    </select>
    <select id="findList" resultType="com.sckw.file.model.kwfFileInfo">

    </select>

    <insert id="insert" parameterType="com.sckw.file.model.kwfFileInfo">
        insert into kwf_file_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="type != null">
                type,
            </if>
            <if test="originalName != null">
                original_name,
            </if>
            <if test="fileName != null">
                file_name,
            </if>
            <if test="md5 != null">
                md5,
            </if>
            <if test="fileSuffix != null">
                file_suffix,
            </if>
            <if test="fileSize != null">
                file_size,
            </if>
            <if test="filePath != null">
                file_path,
            </if>
            <if test="remark != null">
                remark,
            </if>
            <if test="status != null">
                status,
            </if>
            <if test="createBy != null">
                create_by,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="updateBy != null">
                update_by,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
            <if test="delFlag != null">
                del_flag,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            </if>
            <if test="type != null">
                #{type,jdbcType=INTEGER},
            </if>
            <if test="originalName != null">
                #{originalName,jdbcType=VARCHAR},
            </if>
            <if test="fileName != null">
                #{fileName,jdbcType=VARCHAR},
            </if>
            <if test="md5 != null">
                #{md5,jdbcType=VARCHAR},
            </if>
            <if test="fileSuffix != null">
                #{fileSuffix,jdbcType=VARCHAR},
            </if>
            <if test="fileSize != null">
                #{fileSize,jdbcType=DECIMAL},
            </if>
            <if test="filePath != null">
                #{filePath,jdbcType=VARCHAR},
            </if>
            <if test="remark != null">
                #{remark,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                #{status,jdbcType=INTEGER},
            </if>
            <if test="createBy != null">
                #{createBy,jdbcType=BIGINT},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                #{updateBy,jdbcType=BIGINT},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="delFlag != null">
                #{delFlag,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>

</mapper>
