<?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.sooka.system.gas.aofe_gas_purchase_infor.mapper.TGuijiAofeGasPurchaseMapper">

    <sql id="selectVo">
        select id, f_userid, f_username, f_usertype, f_zhye, f_benqizhye, f_gasmeterstyle, f_pregas, f_preamount, f_payment, f_upbuynum, f_sgnetwork, f_sgoperator, f_deliverydate, f_deliverytime, f_filiale, f_fengongsinum, f_payfeetype, f_payfeevalid, f_times, f_stairtype, f_stair1price, f_stair1amount, f_stair1fee, f_stair2price, f_stair2amount, f_stair2fee, f_stair3price, f_stair3amount, f_stair3fee from t_guiji_gas_aofe_gas_purchase_infor
    </sql>

    <select id="selectList" parameterType="TGuijiAofeGasPurchaseInfor" resultType="TGuijiAofeGasPurchaseInfor">
        <include refid="selectVo"/>
        <where>
            <if test="f_userid != null  and f_userid != ''"> and f_userid like concat('%', #{f_userid}, '%')</if>
            <if test="f_username != null  and f_username != ''"> and f_username like concat('%', #{f_username}, '%')</if>
            <if test="f_usertype != null  and f_usertype != ''"> and f_usertype like concat('%', #{f_usertype}, '%')</if>
            <if test="f_zhye != null  and f_zhye != ''"> and f_zhye like concat('%', #{f_zhye}, '%')</if>
            <if test="f_benqizhye != null  and f_benqizhye != ''"> and f_benqizhye like concat('%', #{f_benqizhye}, '%')</if>
            <if test="f_gasmeterstyle != null  and f_gasmeterstyle != ''"> and f_gasmeterstyle like concat('%', #{f_gasmeterstyle}, '%')</if>
            <if test="f_pregas != null  and f_pregas != ''"> and f_pregas like concat('%', #{f_pregas}, '%')</if>
            <if test="f_preamount != null  and f_preamount != ''"> and f_preamount like concat('%', #{f_preamount}, '%')</if>
            <if test="f_payment != null  and f_payment != ''"> and f_payment like concat('%', #{f_payment}, '%')</if>
            <if test="f_upbuynum != null  and f_upbuynum != ''"> and f_upbuynum like concat('%', #{f_upbuynum}, '%')</if>
            <if test="f_sgnetwork != null  and f_sgnetwork != ''"> and f_sgnetwork like concat('%', #{f_sgnetwork}, '%')</if>
            <if test="f_sgoperator != null  and f_sgoperator != ''"> and f_sgoperator like concat('%', #{f_sgoperator}, '%')</if>
            <if test="f_deliverydate != null  and f_deliverydate != ''"> and f_deliverydate like concat('%', #{f_deliverydate}, '%')</if>
            <if test="f_deliverytime != null  and f_deliverytime != ''"> and f_deliverytime like concat('%', #{f_deliverytime}, '%')</if>
            <if test="f_filiale != null  and f_filiale != ''"> and f_filiale like concat('%', #{f_filiale}, '%')</if>
            <if test="f_fengongsinum != null  and f_fengongsinum != ''"> and f_fengongsinum like concat('%', #{f_fengongsinum}, '%')</if>
            <if test="f_payfeetype != null  and f_payfeetype != ''"> and f_payfeetype like concat('%', #{f_payfeetype}, '%')</if>
            <if test="f_payfeevalid != null  and f_payfeevalid != ''"> and f_payfeevalid like concat('%', #{f_payfeevalid}, '%')</if>
            <if test="f_times != null  and f_times != ''"> and f_times like concat('%', #{f_times}, '%')</if>
            <if test="f_stairtype != null  and f_stairtype != ''"> and f_stairtype like concat('%', #{f_stairtype}, '%')</if>
            <if test="f_stair1price != null  and f_stair1price != ''"> and f_stair1price like concat('%', #{f_stair1price}, '%')</if>
            <if test="f_stair1amount != null  and f_stair1amount != ''"> and f_stair1amount like concat('%', #{f_stair1amount}, '%')</if>
            <if test="f_stair1fee != null  and f_stair1fee != ''"> and f_stair1fee like concat('%', #{f_stair1fee}, '%')</if>
            <if test="f_stair2price != null  and f_stair2price != ''"> and f_stair2price like concat('%', #{f_stair2price}, '%')</if>
            <if test="f_stair2amount != null  and f_stair2amount != ''"> and f_stair2amount like concat('%', #{f_stair2amount}, '%')</if>
            <if test="f_stair2fee != null  and f_stair2fee != ''"> and f_stair2fee like concat('%', #{f_stair2fee}, '%')</if>
            <if test="f_stair3price != null  and f_stair3price != ''"> and f_stair3price like concat('%', #{f_stair3price}, '%')</if>
            <if test="f_stair3amount != null  and f_stair3amount != ''"> and f_stair3amount like concat('%', #{f_stair3amount}, '%')</if>
            <if test="f_stair3fee != null  and f_stair3fee != ''"> and f_stair3fee like concat('%', #{f_stair3fee}, '%')</if>
        </where>
    </select>

    <select id="selectById" parameterType="String" resultType="TGuijiAofeGasPurchaseInfor">
        <include refid="selectVo"/>
        where id = #{id}
    </select>

    <insert id="insert" parameterType="TGuijiAofeGasPurchaseInfor">
        insert into t_guiji_gas_aofe_gas_purchase_infor
        <trim prefix="(" suffix=")" suffixOverrides=",">
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
         </trim>
    </insert>

    <update id="update" parameterType="TGuijiAofeGasPurchaseInfor">
        update t_guiji_gas_aofe_gas_purchase_infor
        <trim prefix="SET" suffixOverrides=",">
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteById" parameterType="String">
        delete from t_guiji_gas_aofe_gas_purchase_infor where id = #{id}
    </delete>

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

</mapper>
