<?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.zehong.system.mapper.TSupBalStopSupOprPressLogMapper">
    
    <resultMap type="TSupBalStopSupOprPressLog" id="TSupBalStopSupOprPressLogResult">
        <result property="fOprPressLogId"    column="f_opr_press_log_id"    />
        <result property="fGasStopId"    column="f_gas_stop_id"    />
        <result property="fStopProgress"    column="f_stop_progress"    />
        <result property="fOprDate"    column="f_opr_date"    />
    </resultMap>

    <sql id="selectTSupBalStopSupOprPressLogVo">
        select f_opr_press_log_id, f_gas_stop_id, f_stop_progress, f_opr_date from t_sup_bal_stop_sup_opr_press_log
    </sql>

    <select id="selectTSupBalStopSupOprPressLogList" parameterType="TSupBalStopSupOprPressLog" resultMap="TSupBalStopSupOprPressLogResult">
        <include refid="selectTSupBalStopSupOprPressLogVo"/>
        <where>  
            <if test="fGasStopId != null "> and f_gas_stop_id = #{fGasStopId}</if>
            <if test="fStopProgress != null  and fStopProgress != ''"> and f_stop_progress = #{fStopProgress}</if>
            <if test="fOprDate != null "> and f_opr_date = #{fOprDate}</if>
        </where>
    </select>
    
    <select id="selectTSupBalStopSupOprPressLogById" parameterType="Long" resultMap="TSupBalStopSupOprPressLogResult">
        <include refid="selectTSupBalStopSupOprPressLogVo"/>
        where f_opr_press_log_id = #{fOprPressLogId}
    </select>
        
    <insert id="insertTSupBalStopSupOprPressLog" parameterType="TSupBalStopSupOprPressLog" useGeneratedKeys="true" keyProperty="fOprPressLogId">
        insert into t_sup_bal_stop_sup_opr_press_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fGasStopId != null">f_gas_stop_id,</if>
            <if test="fStopProgress != null and fStopProgress != ''">f_stop_progress,</if>
            <if test="fOprDate != null">f_opr_date,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fGasStopId != null">#{fGasStopId},</if>
            <if test="fStopProgress != null and fStopProgress != ''">#{fStopProgress},</if>
            <if test="fOprDate != null">#{fOprDate},</if>
         </trim>
    </insert>

    <update id="updateTSupBalStopSupOprPressLog" parameterType="TSupBalStopSupOprPressLog">
        update t_sup_bal_stop_sup_opr_press_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="fGasStopId != null">f_gas_stop_id = #{fGasStopId},</if>
            <if test="fStopProgress != null and fStopProgress != ''">f_stop_progress = #{fStopProgress},</if>
            <if test="fOprDate != null">f_opr_date = #{fOprDate},</if>
        </trim>
        where f_opr_press_log_id = #{fOprPressLogId}
    </update>

    <delete id="deleteTSupBalStopSupOprPressLogById" parameterType="Long">
        delete from t_sup_bal_stop_sup_opr_press_log where f_opr_press_log_id = #{fOprPressLogId}
    </delete>

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