<?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.sc_gas_meter_infor.mapper.TGuijiSCGasMeterInforMapper">

    <sql id="selectVo">
        select id, trademark, productType, obsolescence, baseRead, barcode, userCode from t_guiji_gas_sc_gas_meter_infor
    </sql>

    <select id="selectList" parameterType="TGuijiSCGasMeterInfor" resultType="TGuijiSCGasMeterInfor">
        <include refid="selectVo"/>
        <where>
            <if test="trademark != null  and trademark != ''"> and trademark like concat('%', #{trademark}, '%')</if>
            <if test="productType != null  and productType != ''"> and productType like concat('%', #{productType}, '%')</if>
            <if test="obsolescence != null  and obsolescence != ''"> and obsolescence like concat('%', #{obsolescence}, '%')</if>
            <if test="baseRead != null  and baseRead != ''"> and baseRead like concat('%', #{baseRead}, '%')</if>
            <if test="barcode != null  and barcode != ''"> and barcode like concat('%', #{barcode}, '%')</if>
            <if test="userCode != null  and userCode != ''"> and userCode like concat('%', #{userCode}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
