<?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_meter_reading_infor.mapper.TGuijiSCMeterReadingMapper">

    <sql id="selectVo">
        select id, readNow, readLast, useAmount, useMoney, barCode, recordTime from t_guiji_gas_sc_meter_reading_infor
    </sql>

    <select id="selectList" parameterType="TGuijiSCMeterReadingInfor" resultType="TGuijiSCMeterReadingInfor">
        <include refid="selectVo"/>
        <where>
            <if test="readNow != null  and readNow != ''"> and readNow like concat('%', #{readNow}, '%')</if>
            <if test="readLast != null  and readLast != ''"> and readLast like concat('%', #{readLast}, '%')</if>
            <if test="useAmount != null  and useAmount != ''"> and useAmount like concat('%', #{useAmount}, '%')</if>
            <if test="useMoney != null  and useMoney != ''"> and useMoney like concat('%', #{useMoney}, '%')</if>
            <if test="barCode != null  and barCode != ''"> and barCode like concat('%', #{barCode}, '%')</if>
            <if test="recordTime != null  and recordTime != ''"> and recordTime like concat('%', #{recordTime}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
