<?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.fidms.web.mapper.FlowFieldOutputMapper">
    
    <resultMap type="FlowFieldOutput" id="FlowFieldOutputResult">
        <result property="id"    column="id"    />
        <result property="outputFile"    column="output_file"    />
        <result property="outputFilePath"    column="output_file_path"    />
        <result property="softScreenShoot"    column="soft_screen_shoot"    />
        <result property="softScreenShootPath"    column="soft_screen_shoot_path"    />
        <result property="gridNumber"    column="grid_number"    />
        <result property="isStructureGrid"    column="is_structure_grid"    />
        <result property="temperature"    column="temperature"    />
        <result property="co2"    column="co2"    />
        <result property="co"    column="co"    />
        <result property="h2o"    column="h2o"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectFlowFieldOutputVo">
        select id, output_file, output_file_path, soft_screen_shoot, soft_screen_shoot_path, grid_number, is_structure_grid, temperature, co2, co, h2o, create_by, create_time, update_by, update_time from bz_flow_field_output_t
    </sql>

    <select id="selectFlowFieldOutputList" parameterType="FlowFieldOutput" resultMap="FlowFieldOutputResult">
        <include refid="selectFlowFieldOutputVo"/>
        <where>  
            <if test="outputFile != null  and outputFile != ''"> and output_file = #{outputFile}</if>
            <if test="outputFilePath != null  and outputFilePath != ''"> and output_file_path = #{outputFilePath}</if>
            <if test="softScreenShoot != null  and softScreenShoot != ''"> and soft_screen_shoot = #{softScreenShoot}</if>
            <if test="softScreenShootPath != null  and softScreenShootPath != ''"> and soft_screen_shoot_path = #{softScreenShootPath}</if>
            <if test="gridNumber != null "> and grid_number = #{gridNumber}</if>
            <if test="isStructureGrid != null "> and is_structure_grid = #{isStructureGrid}</if>
            <if test="temperature != null "> and temperature = #{temperature}</if>
            <if test="co2 != null "> and co2 = #{co2}</if>
            <if test="co != null "> and co = #{co}</if>
            <if test="h2o != null "> and h2o = #{h2o}</if>
        </where>
    </select>
    
    <select id="selectFlowFieldOutputById" parameterType="Long" resultMap="FlowFieldOutputResult">
        <include refid="selectFlowFieldOutputVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertFlowFieldOutput" parameterType="FlowFieldOutput" useGeneratedKeys="true" keyProperty="id">
        insert into bz_flow_field_output_t
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="outputFile != null">output_file,</if>
            <if test="outputFilePath != null">output_file_path,</if>
            <if test="softScreenShoot != null">soft_screen_shoot,</if>
            <if test="softScreenShootPath != null">soft_screen_shoot_path,</if>
            <if test="gridNumber != null">grid_number,</if>
            <if test="isStructureGrid != null">is_structure_grid,</if>
            <if test="temperature != null">temperature,</if>
            <if test="co2 != null">co2,</if>
            <if test="co != null">co,</if>
            <if test="h2o != null">h2o,</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>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="outputFile != null">#{outputFile},</if>
            <if test="outputFilePath != null">#{outputFilePath},</if>
            <if test="softScreenShoot != null">#{softScreenShoot},</if>
            <if test="softScreenShootPath != null">#{softScreenShootPath},</if>
            <if test="gridNumber != null">#{gridNumber},</if>
            <if test="isStructureGrid != null">#{isStructureGrid},</if>
            <if test="temperature != null">#{temperature},</if>
            <if test="co2 != null">#{co2},</if>
            <if test="co != null">#{co},</if>
            <if test="h2o != null">#{h2o},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>

    <update id="updateFlowFieldOutput" parameterType="FlowFieldOutput">
        update bz_flow_field_output_t
        <trim prefix="SET" suffixOverrides=",">
            <if test="outputFile != null">output_file = #{outputFile},</if>
            <if test="outputFilePath != null">output_file_path = #{outputFilePath},</if>
            <if test="softScreenShoot != null">soft_screen_shoot = #{softScreenShoot},</if>
            <if test="softScreenShootPath != null">soft_screen_shoot_path = #{softScreenShootPath},</if>
            <if test="gridNumber != null">grid_number = #{gridNumber},</if>
            <if test="isStructureGrid != null">is_structure_grid = #{isStructureGrid},</if>
            <if test="temperature != null">temperature = #{temperature},</if>
            <if test="co2 != null">co2 = #{co2},</if>
            <if test="co != null">co = #{co},</if>
            <if test="h2o != null">h2o = #{h2o},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteFlowFieldOutputById" parameterType="Long">
        delete from bz_flow_field_output_t where id = #{id}
    </delete>

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