<?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.siwei.rsmonitoring.mapper.TDkAuditflowFjMapper">
    
    <resultMap type="TDkAuditflowFj" id="TDkAuditflowFjResult">
        <result property="id"    column="id"    />
        <result property="dkjbxxId"    column="dkjbxx_id"    />
        <result property="fjPath"    column="fj_path"    />
        <result property="fjName"    column="fj_name"    />
        <result property="fjSize"    column="fj_size"    />
        <result property="fjType"    column="fj_type"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="auditflowId"    column="auditflow_id"    />
        <result property="fjLatitude"    column="fj_latitude"    />
        <result property="fjLongitude"    column="fj_longitude"    />
        <result property="fjAltitude"    column="fj_altitude"    />
        <result property="fjDatetime"    column="fj_datetime"    />
        <result property="fjDirection"    column="fj_direction"    />
        <result property="fjArtist"    column="fj_artist"    />
        <result property="fjSoftware"    column="fj_software"    />
        <result property="fjPreview"    column="fj_preview"    />
    </resultMap>

    <sql id="selectTDkAuditflowFjVo">
        select id, dkjbxx_id, fj_path,fj_name, fj_size, fj_type, create_by, create_time,auditflow_id,
               fj_latitude, fj_longitude, fj_altitude, fj_datetime, fj_direction, fj_artist, fj_software,fj_preview from t_dk_auditflow_fj
    </sql>

    <select id="selectTDkAuditflowFjList" parameterType="TDkAuditflowFj" resultMap="TDkAuditflowFjResult">
        <include refid="selectTDkAuditflowFjVo"/>
        <where>
            <if test="dkjbxxId != null  and dkjbxxId != ''"> and dkjbxx_id = #{dkjbxxId}</if>
            <if test="fjPath != null  and fjPath != ''"> and fj_path = #{fjPath}</if>
            <if test="fjSize != null "> and fj_size = #{fjSize}</if>
            <if test="fjType != null  and fjType != ''"> and fj_type = #{fjType}</if>
            <if test="auditflowId != null  and auditflowId != ''"> and auditflow_id = #{auditflowId}</if>
        </where>
    </select>


    <select id="selectTDkAuditflowFjById" parameterType="String" resultMap="TDkAuditflowFjResult">
        <include refid="selectTDkAuditflowFjVo"/>
        where id = #{id}
    </select>

    <insert id="insertTDkAuditflowFj" parameterType="TDkAuditflowFj">
        insert into t_dk_auditflow_fj
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">id,</if>
            <if test="dkjbxxId != null">dkjbxx_id,</if>
            <if test="fjPath != null">fj_path,</if>
            <if test="fjName != null">fj_name,</if>
            <if test="fjSize != null">fj_size,</if>
            <if test="fjType != null">fj_type,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="auditflowId != null">auditflow_id,</if>
            <if test="fjLatitude != null">fj_latitude,</if>
            <if test="fjLongitude != null">fj_longitude,</if>
            <if test="fjAltitude != null">fj_altitude,</if>
            <if test="fjDatetime != null">fj_datetime,</if>
            <if test="fjDirection != null">fj_direction,</if>
            <if test="fjArtist != null">fj_artist,</if>
            <if test="fjSoftware != null">fj_software,</if>
            <if test="fjPreview != null">fj_preview,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">#{id},</if>
            <if test="dkjbxxId != null">#{dkjbxxId},</if>
            <if test="fjPath != null">#{fjPath},</if>
            <if test="fjName != null">#{fjName},</if>
            <if test="fjSize != null">#{fjSize},</if>
            <if test="fjType != null">#{fjType},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="auditflowId != null">#{auditflowId},</if>
            <if test="fjLatitude != null">#{fjLatitude},</if>
            <if test="fjLongitude != null">#{fjLongitude},</if>
            <if test="fjAltitude != null">#{fjAltitude},</if>
            <if test="fjDatetime != null">#{fjDatetime},</if>
            <if test="fjDirection != null">#{fjDirection},</if>
            <if test="fjArtist != null">#{fjArtist},</if>
            <if test="fjSoftware != null">#{fjSoftware},</if>
            <if test="fjPreview != null">#{fjPreview},</if>
         </trim>
    </insert>

    <update id="updateTDkAuditflowFj" parameterType="TDkAuditflowFj">
        update t_dk_auditflow_fj
        <trim prefix="SET" suffixOverrides=",">
            <if test="dkjbxxId != null">dkjbxx_id = #{dkjbxxId},</if>
            <if test="fjPath != null">fj_path = #{fjPath},</if>
            <if test="fjName != null">fj_name= #{fjName},</if>
            <if test="fjSize != null">fj_size = #{fjSize},</if>
            <if test="fjType != null">fj_type = #{fjType},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="auditflowId != null">auditflow_id = #{auditflowId},</if>
            <if test="fjLatitude != null">fj_latitude = #{fjLatitude},</if>
            <if test="fjLongitude != null">fj_longitude = #{fjLongitude},</if>
            <if test="fjAltitude != null">fj_altitude = #{fjAltitude},</if>
            <if test="fjDatetime != null">fj_datetime = #{fjDatetime},</if>
            <if test="fjDirection != null">fj_direction = #{fjDirection},</if>
            <if test="fjArtist != null">fj_artist = #{fjArtist},</if>
            <if test="fjSoftware != null">fj_software = #{fjSoftware},</if>
            <if test="fjPreview != null">fj_preview = #{fjPreview},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTDkAuditflowFjById" parameterType="String">
        delete from t_dk_auditflow_fj where id = #{id}
    </delete>

    <delete id="deleteTDkAuditflowFjByAuditflowId" parameterType="String">
        delete from t_dk_auditflow_fj where auditflow_id = #{auditflowId}
    </delete>

    <delete id="deleteTDkAuditflowFjByIds" parameterType="String">
        delete from t_dk_auditflow_fj where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>