<?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.ztmap.project.zhny.energystoragefdsdycs.mapper.TEnergyStorageFdsdycsMapper">
    
    <resultMap type="TEnergyStorageFdsdycs" id="TEnergyStorageFdsdycsResult">
        <result property="id"    column="id"    />
        <result property="bfb"    column="bfb"    />
        <result property="fdsd"    column="fdsd"    />
        <result property="fdcs"    column="fdcs"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
    </resultMap>

    <sql id="selectTEnergyStorageFdsdycsVo">
        select id, bfb, fdsd, fdcs, create_time, create_by from t_energy_storage_fdsdycs
    </sql>

    <select id="selectTEnergyStorageFdsdycsList" parameterType="TEnergyStorageFdsdycs" resultMap="TEnergyStorageFdsdycsResult">
        <include refid="selectTEnergyStorageFdsdycsVo"/>
        <where>  
            <if test="bfb != null "> and bfb = #{bfb}</if>
            <if test="fdsd != null "> and fdsd = #{fdsd}</if>
            <if test="fdcs != null "> and fdcs = #{fdcs}</if>
        </where>
    </select>
    
    <select id="selectTEnergyStorageFdsdycsById" parameterType="Long" resultMap="TEnergyStorageFdsdycsResult">
        <include refid="selectTEnergyStorageFdsdycsVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTEnergyStorageFdsdycs" parameterType="TEnergyStorageFdsdycs" useGeneratedKeys="true" keyProperty="id">
        insert into t_energy_storage_fdsdycs
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="bfb != null">bfb,</if>
            <if test="fdsd != null">fdsd,</if>
            <if test="fdcs != null">fdcs,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createBy != null">create_by,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="bfb != null">#{bfb},</if>
            <if test="fdsd != null">#{fdsd},</if>
            <if test="fdcs != null">#{fdcs},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createBy != null">#{createBy},</if>
         </trim>
    </insert>

    <update id="updateTEnergyStorageFdsdycs" parameterType="TEnergyStorageFdsdycs">
        update t_energy_storage_fdsdycs
        <trim prefix="SET" suffixOverrides=",">
            <if test="bfb != null">bfb = #{bfb},</if>
            <if test="fdsd != null">fdsd = #{fdsd},</if>
            <if test="fdcs != null">fdcs = #{fdcs},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTEnergyStorageFdsdycsById" parameterType="Long">
        delete from t_energy_storage_fdsdycs where id = #{id}
    </delete>

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

</mapper>