<?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_meter_infor.mapper.TGuijiAofeGasMeterInforMapper">

    <sql id="selectVo">
        select id, f_userid, f_gaswatchbrand, f_metertype, f_aliasname, f_gasmeterstyle, f_meternumber, f_cardid from t_guiji_gas_aofe_gas_meter_infor
    </sql>

    <select id="selectList" parameterType="TGuijiAofeGasMeterInfor" resultType="TGuijiAofeGasMeterInfor">
        <include refid="selectVo"/>
        <where>
            <if test="f_userid != null  and f_userid != ''"> and f_userid like concat('%', #{f_userid}, '%')</if>
            <if test="f_gaswatchbrand != null  and f_gaswatchbrand != ''"> and f_gaswatchbrand like concat('%', #{f_gaswatchbrand}, '%')</if>
            <if test="f_metertype != null  and f_metertype != ''"> and f_metertype like concat('%', #{f_metertype}, '%')</if>
            <if test="f_aliasname != null  and f_aliasname != ''"> and f_aliasname like concat('%', #{f_aliasname}, '%')</if>
            <if test="f_gasmeterstyle != null  and f_gasmeterstyle != ''"> and f_gasmeterstyle like concat('%', #{f_gasmeterstyle}, '%')</if>
            <if test="f_meternumber != null  and f_meternumber != ''"> and f_meternumber like concat('%', #{f_meternumber}, '%')</if>
            <if test="f_cardid != null  and f_cardid != ''"> and f_cardid like concat('%', #{f_cardid}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
