<?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.zenner_user_infor.mapper.TGuijiZennerUserInforMapper">

    <sql id="selectVo">
        select id, GUID, VC_UI_CODE, VC_UI_NAME, VC_UI_STATE, VC_UI_ADDR, VC_UI_TEL, VC_UI_IDNO, VC_UI_REMARK, N_UI_BEFOREAMOUNT, N_UI_LASTAMOUNT from t_guiji_gas_zenner_user_infor
    </sql>

    <select id="selectList" parameterType="TGuijiZennerUserInfor" resultType="TGuijiZennerUserInfor">
        <include refid="selectVo"/>
        <where>
            <if test="GUID != null  and GUID != ''"> and GUID like concat('%', #{GUID}, '%')</if>
            <if test="VC_UI_CODE != null  and VC_UI_CODE != ''"> and VC_UI_CODE like concat('%', #{VC_UI_CODE}, '%')</if>
            <if test="VC_UI_NAME != null  and VC_UI_NAME != ''"> and VC_UI_NAME like concat('%', #{VC_UI_NAME}, '%')</if>
            <if test="VC_UI_STATE != null  and VC_UI_STATE != ''"> and VC_UI_STATE like concat('%', #{VC_UI_STATE}, '%')</if>
            <if test="VC_UI_ADDR != null  and VC_UI_ADDR != ''"> and VC_UI_ADDR like concat('%', #{VC_UI_ADDR}, '%')</if>
            <if test="VC_UI_TEL != null  and VC_UI_TEL != ''"> and VC_UI_TEL like concat('%', #{VC_UI_TEL}, '%')</if>
            <if test="VC_UI_IDNO != null  and VC_UI_IDNO != ''"> and VC_UI_IDNO like concat('%', #{VC_UI_IDNO}, '%')</if>
            <if test="VC_UI_REMARK != null  and VC_UI_REMARK != ''"> and VC_UI_REMARK like concat('%', #{VC_UI_REMARK}, '%')</if>
            <if test="N_UI_BEFOREAMOUNT != null  and N_UI_BEFOREAMOUNT != ''"> and N_UI_BEFOREAMOUNT like concat('%', #{N_UI_BEFOREAMOUNT}, '%')</if>
            <if test="N_UI_LASTAMOUNT != null  and N_UI_LASTAMOUNT != ''"> and N_UI_LASTAMOUNT like concat('%', #{N_UI_LASTAMOUNT}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
