<?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.qianhe.mapper.SjGfjsFdgzMapper">
    
    <resultMap type="SjGfjsFdgz" id="SjGfjsFdgzResult">
        <result property="id"    column="id"    />
        <result property="nd"    column="nd"    />
        <result property="jb"    column="jb"    />
        <result property="minjcz"    column="minjcz"    />
        <result property="yl1"    column="yl1"    />
        <result property="yl2"    column="yl2"    />
        <result property="yl3"    column="yl3"    />
        <result property="yl4"    column="yl4"    />
        <result property="yl5"    column="yl5"    />
        <result property="maxjcz"    column="maxjcz"    />
    </resultMap>

    <sql id="selectSjGfjsFdgzVo">
        select id, nd, jb, minjcz, yl1, yl2, yl3, yl4, yl5, maxjcz from sj_gfjs_fdgz
    </sql>

    <select id="selectSjGfjsFdgzList" parameterType="SjGfjsFdgz" resultMap="SjGfjsFdgzResult">
        <include refid="selectSjGfjsFdgzVo"/>
        <where>  
            <if test="nd != null  and nd != ''"> and nd = #{nd}</if>
            <if test="jb != null  and jb != ''"> and jb = #{jb}</if>
            <if test="minjcz != null  and minjcz != ''"> and minjcz = #{minjcz}</if>
            <if test="yl1 != null  and yl1 != ''"> and yl1 = #{yl1}</if>
            <if test="yl2 != null  and yl2 != ''"> and yl2 = #{yl2}</if>
            <if test="yl3 != null  and yl3 != ''"> and yl3 = #{yl3}</if>
            <if test="yl4 != null  and yl4 != ''"> and yl4 = #{yl4}</if>
            <if test="yl5 != null  and yl5 != ''"> and yl5 = #{yl5}</if>
            <if test="maxjcz != null  and maxjcz != ''"> and maxjcz = #{maxjcz}</if>
        </where>
    </select>
    
    <select id="selectSjGfjsFdgzById" parameterType="Long" resultMap="SjGfjsFdgzResult">
        <include refid="selectSjGfjsFdgzVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertSjGfjsFdgz" parameterType="SjGfjsFdgz" useGeneratedKeys="true" keyProperty="id">
        insert into sj_gfjs_fdgz
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="nd != null">nd,</if>
            <if test="jb != null">jb,</if>
            <if test="minjcz != null">minjcz,</if>
            <if test="yl1 != null">yl1,</if>
            <if test="yl2 != null">yl2,</if>
            <if test="yl3 != null">yl3,</if>
            <if test="yl4 != null">yl4,</if>
            <if test="yl5 != null">yl5,</if>
            <if test="maxjcz != null">maxjcz,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="nd != null">#{nd},</if>
            <if test="jb != null">#{jb},</if>
            <if test="minjcz != null">#{minjcz},</if>
            <if test="yl1 != null">#{yl1},</if>
            <if test="yl2 != null">#{yl2},</if>
            <if test="yl3 != null">#{yl3},</if>
            <if test="yl4 != null">#{yl4},</if>
            <if test="yl5 != null">#{yl5},</if>
            <if test="maxjcz != null">#{maxjcz},</if>
         </trim>
    </insert>

    <update id="updateSjGfjsFdgz" parameterType="SjGfjsFdgz">
        update sj_gfjs_fdgz
        <trim prefix="SET" suffixOverrides=",">
            <if test="nd != null">nd = #{nd},</if>
            <if test="jb != null">jb = #{jb},</if>
            <if test="minjcz != null">minjcz = #{minjcz},</if>
            <if test="yl1 != null">yl1 = #{yl1},</if>
            <if test="yl2 != null">yl2 = #{yl2},</if>
            <if test="yl3 != null">yl3 = #{yl3},</if>
            <if test="yl4 != null">yl4 = #{yl4},</if>
            <if test="yl5 != null">yl5 = #{yl5},</if>
            <if test="maxjcz != null">maxjcz = #{maxjcz},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSjGfjsFdgzById" parameterType="Long">
        delete from sj_gfjs_fdgz where id = #{id}
    </delete>

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