<?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_user_infor.mapper.TGuijiAofeUserInforMapper">

    <sql id="selectVo">
        select id, f_userid, f_userstate, f_state, f_username, f_idnumber, f_phone, f_yytdepa, f_yytoper, f_yytdate, f_dateofopening, f_filiale, f_fengongsinum, f_usertype, f_districtname, f_address from t_guiji_gas_aofe_user_infor
    </sql>

    <select id="selectList" parameterType="TGuijiAofeUserInfor" resultType="TGuijiAofeUserInfor">
        <include refid="selectVo"/>
        <where>
            <if test="f_userid != null  and f_userid != ''"> and f_userid like concat('%', #{f_userid}, '%')</if>
            <if test="f_userstate != null  and f_userstate != ''"> and f_userstate like concat('%', #{f_userstate}, '%')</if>
            <if test="f_state != null  and f_state != ''"> and f_state like concat('%', #{f_state}, '%')</if>
            <if test="f_username != null  and f_username != ''"> and f_username like concat('%', #{f_username}, '%')</if>
            <if test="f_idnumber != null  and f_idnumber != ''"> and f_idnumber like concat('%', #{f_idnumber}, '%')</if>
            <if test="f_phone != null  and f_phone != ''"> and f_phone like concat('%', #{f_phone}, '%')</if>
            <if test="f_yytdepa != null  and f_yytdepa != ''"> and f_yytdepa like concat('%', #{f_yytdepa}, '%')</if>
            <if test="f_yytoper != null  and f_yytoper != ''"> and f_yytoper like concat('%', #{f_yytoper}, '%')</if>
            <if test="f_yytdate != null  and f_yytdate != ''"> and f_yytdate like concat('%', #{f_yytdate}, '%')</if>
            <if test="f_dateofopening != null  and f_dateofopening != ''"> and f_dateofopening like concat('%', #{f_dateofopening}, '%')</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_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>
        </where>
    </select>

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

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

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

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

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

</mapper>
