<?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_meter_reading_infor.mapper.TGuijiAofeMeterReadingMapper">

    <sql id="selectVo">
        select id, f_userid, f_username, f_usertype, f_districtname, f_address, f_filiale, f_network, f_operator, oughtamount, oughtfee, lastrecord, lastinputgasnum, f_inputdate, scinputdate, f_handdate, shifoujiaofei, f_endjfdate, f_state, f_sellid, f_zhinajin, f_zhinajindate, f_zhinajintianshu from t_guiji_gas_aofe_meter_reading_infor
    </sql>

    <select id="selectList" parameterType="TGuijiAofeMeterReadingInfor" resultType="TGuijiAofeMeterReadingInfor">
        <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_districtname != null  and f_districtname != ''"> and f_districtname like concat('%', #{f_districtname}, '%')</if>
            <if test="f_address != null  and f_address != ''"> and f_address like concat('%', #{f_address}, '%')</if>
            <if test="f_filiale != null  and f_filiale != ''"> and f_filiale like concat('%', #{f_filiale}, '%')</if>
            <if test="f_network != null  and f_network != ''"> and f_network like concat('%', #{f_network}, '%')</if>
            <if test="f_operator != null  and f_operator != ''"> and f_operator like concat('%', #{f_operator}, '%')</if>
            <if test="oughtamount != null  and oughtamount != ''"> and oughtamount like concat('%', #{oughtamount}, '%')</if>
            <if test="oughtfee != null  and oughtfee != ''"> and oughtfee like concat('%', #{oughtfee}, '%')</if>
            <if test="lastrecord != null  and lastrecord != ''"> and lastrecord like concat('%', #{lastrecord}, '%')</if>
            <if test="lastinputgasnum != null  and lastinputgasnum != ''"> and lastinputgasnum like concat('%', #{lastinputgasnum}, '%')</if>
            <if test="f_inputdate != null  and f_inputdate != ''"> and f_inputdate like concat('%', #{f_inputdate}, '%')</if>
            <if test="scinputdate != null  and scinputdate != ''"> and scinputdate like concat('%', #{scinputdate}, '%')</if>
            <if test="f_handdate != null  and f_handdate != ''"> and f_handdate like concat('%', #{f_handdate}, '%')</if>
            <if test="shifoujiaofei != null  and shifoujiaofei != ''"> and shifoujiaofei like concat('%', #{shifoujiaofei}, '%')</if>
            <if test="f_endjfdate != null  and f_endjfdate != ''"> and f_endjfdate like concat('%', #{f_endjfdate}, '%')</if>
            <if test="f_state != null  and f_state != ''"> and f_state like concat('%', #{f_state}, '%')</if>
            <if test="f_sellid != null  and f_sellid != ''"> and f_sellid like concat('%', #{f_sellid}, '%')</if>
            <if test="f_zhinajin != null  and f_zhinajin != ''"> and f_zhinajin like concat('%', #{f_zhinajin}, '%')</if>
            <if test="f_zhinajindate != null  and f_zhinajindate != ''"> and f_zhinajindate like concat('%', #{f_zhinajindate}, '%')</if>
            <if test="f_zhinajintianshu != null  and f_zhinajintianshu != ''"> and f_zhinajintianshu like concat('%', #{f_zhinajintianshu}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
