<?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_gas_meter_infor.mapper.TGuijiZennerGasMeterInforMapper">

    <sql id="selectVo">
        select id, GUID, VC_MI_USERGUID, VC_MI_NO, VC_MI_CARDNO, VC_MI_DIRECTION, VC_MI_TIMA, VC_MI_CHAOBIAO, N_MI_BASECOUNT, N_MI_BASELEAVE, VC_MI_STATE, I_MI_SALECOUNT, I_MI_WLSALECOUNT, I_MI_FILLCARDCOUNT, VC_MI_REMARK, I_MI_REPORTCOUNT, D_MI_CREATETIME from t_guiji_gas_zenner_gas_meter_infor
    </sql>

    <select id="selectList" parameterType="TGuijiZennerGasMeterInfor" resultType="TGuijiZennerGasMeterInfor">
        <include refid="selectVo"/>
        <where>
            VC_MI_NO is not null and VC_MI_NO != ''
            <if test="GUID != null  and GUID != ''"> and GUID like concat('%', #{GUID}, '%')</if>
            <if test="VC_MI_USERGUID != null  and VC_MI_USERGUID != ''"> and VC_MI_USERGUID like concat('%', #{VC_MI_USERGUID}, '%')</if>
            <if test="VC_MI_NO != null  and VC_MI_NO != ''"> and VC_MI_NO like concat('%', #{VC_MI_NO}, '%')</if>
            <if test="VC_MI_CARDNO != null  and VC_MI_CARDNO != ''"> and VC_MI_CARDNO like concat('%', #{VC_MI_CARDNO}, '%')</if>
            <if test="VC_MI_DIRECTION != null  and VC_MI_DIRECTION != ''"> and VC_MI_DIRECTION like concat('%', #{VC_MI_DIRECTION}, '%')</if>
            <if test="VC_MI_TIMA != null  and VC_MI_TIMA != ''"> and VC_MI_TIMA like concat('%', #{VC_MI_TIMA}, '%')</if>
            <if test="VC_MI_CHAOBIAO != null  and VC_MI_CHAOBIAO != ''"> and VC_MI_CHAOBIAO like concat('%', #{VC_MI_CHAOBIAO}, '%')</if>
            <if test="N_MI_BASECOUNT != null  and N_MI_BASECOUNT != ''"> and N_MI_BASECOUNT like concat('%', #{N_MI_BASECOUNT}, '%')</if>
            <if test="N_MI_BASELEAVE != null  and N_MI_BASELEAVE != ''"> and N_MI_BASELEAVE like concat('%', #{N_MI_BASELEAVE}, '%')</if>
            <if test="VC_MI_STATE != null  and VC_MI_STATE != ''"> and VC_MI_STATE like concat('%', #{VC_MI_STATE}, '%')</if>
            <if test="I_MI_SALECOUNT != null  and I_MI_SALECOUNT != ''"> and I_MI_SALECOUNT like concat('%', #{I_MI_SALECOUNT}, '%')</if>
            <if test="I_MI_WLSALECOUNT != null  and I_MI_WLSALECOUNT != ''"> and I_MI_WLSALECOUNT like concat('%', #{I_MI_WLSALECOUNT}, '%')</if>
            <if test="I_MI_FILLCARDCOUNT != null  and I_MI_FILLCARDCOUNT != ''"> and I_MI_FILLCARDCOUNT like concat('%', #{I_MI_FILLCARDCOUNT}, '%')</if>
            <if test="VC_MI_REMARK != null  and VC_MI_REMARK != ''"> and VC_MI_REMARK like concat('%', #{VC_MI_REMARK}, '%')</if>
            <if test="I_MI_REPORTCOUNT != null  and I_MI_REPORTCOUNT != ''"> and I_MI_REPORTCOUNT like concat('%', #{I_MI_REPORTCOUNT}, '%')</if>
            <if test="D_MI_CREATETIME != null  and D_MI_CREATETIME != ''"> and D_MI_CREATETIME like concat('%', #{D_MI_CREATETIME}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
