<?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.ruoyi.project.zjsgfa.mapper.SjZjyFdxnbMapper">
    
    <resultMap type="SjZjyFdxnb" id="SjZjyFdxnbResult">
        <result property="id"    column="id"    />
        <result property="jh"    column="jh"    />
        <result property="jd"    column="jd"    />
        <result property="md"    column="md"    />
        <result property="msldnd"    column="msldnd"    />
        <result property="apilsl"    column="apilsl"    />
        <result property="apinb"    column="apinb"    />
        <result property="jql"    column="jql"    />
        <result property="ph"    column="ph"    />
        <result property="hsl"    column="hsl"    />
        <result property="zgh"    column="zgh"    />
        <result property="mzxs"    column="mzxs"    />
        <result property="dql"    column="dql"    />
        <result property="sxnd"    column="sxnd"    />
        <result property="bz"    column="bz"    />
        <result property="createdBy"    column="created_by"    />
        <result property="createdTime"    column="created_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectSjZjyFdxnbVo">
        select id, jh, jd, md, msldnd, apilsl, apinb, jql, ph, hsl, zgh, mzxs, dql, sxnd, bz, created_by, created_time, update_by, update_time from sj_zjy_fdxnb
    </sql>

    <select id="selectSjZjyFdxnbList" parameterType="SjZjyFdxnb" resultMap="SjZjyFdxnbResult">
        <include refid="selectSjZjyFdxnbVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh = #{jh}</if>
            <if test="jd != null  and jd != ''"> and jd = #{jd}</if>
            <if test="md != null  and md != ''"> and md = #{md}</if>
            <if test="msldnd != null  and msldnd != ''"> and msldnd = #{msldnd}</if>
            <if test="apilsl != null  and apilsl != ''"> and apilsl = #{apilsl}</if>
            <if test="apinb != null  and apinb != ''"> and apinb = #{apinb}</if>
            <if test="jql != null  and jql != ''"> and jql = #{jql}</if>
            <if test="ph != null  and ph != ''"> and ph = #{ph}</if>
            <if test="hsl != null  and hsl != ''"> and hsl = #{hsl}</if>
            <if test="zgh != null  and zgh != ''"> and zgh = #{zgh}</if>
            <if test="mzxs != null  and mzxs != ''"> and mzxs = #{mzxs}</if>
            <if test="dql != null  and dql != ''"> and dql = #{dql}</if>
            <if test="sxnd != null  and sxnd != ''"> and sxnd = #{sxnd}</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</if>
            <if test="createdBy != null  and createdBy != ''"> and created_by = #{createdBy}</if>
            <if test="createdTime != null "> and created_time = #{createdTime}</if>
        </where>
    </select>
    
    <select id="selectSjZjyFdxnbById" parameterType="Long" resultMap="SjZjyFdxnbResult">
        <include refid="selectSjZjyFdxnbVo"/>
        where id = #{id}
    </select>

    <insert id="insertSjZjyFdxnb" parameterType="SjZjyFdxnb" useGeneratedKeys="true" keyProperty="id">
        insert into sj_zjy_fdxnb
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="jd != null">jd,</if>
            <if test="md != null">md,</if>
            <if test="msldnd != null">msldnd,</if>
            <if test="apilsl != null">apilsl,</if>
            <if test="apinb != null">apinb,</if>
            <if test="jql != null">jql,</if>
            <if test="ph != null">ph,</if>
            <if test="hsl != null">hsl,</if>
            <if test="zgh != null">zgh,</if>
            <if test="mzxs != null">mzxs,</if>
            <if test="dql != null">dql,</if>
            <if test="sxnd != null">sxnd,</if>
            <if test="bz != null">bz,</if>
            <if test="createdBy != null">created_by,</if>
            <if test="createdTime != null">created_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jh != null">#{jh},</if>
            <if test="jd != null">#{jd},</if>
            <if test="md != null">#{md},</if>
            <if test="msldnd != null">#{msldnd},</if>
            <if test="apilsl != null">#{apilsl},</if>
            <if test="apinb != null">#{apinb},</if>
            <if test="jql != null">#{jql},</if>
            <if test="ph != null">#{ph},</if>
            <if test="hsl != null">#{hsl},</if>
            <if test="zgh != null">#{zgh},</if>
            <if test="mzxs != null">#{mzxs},</if>
            <if test="dql != null">#{dql},</if>
            <if test="sxnd != null">#{sxnd},</if>
            <if test="bz != null">#{bz},</if>
            <if test="createdBy != null">#{createdBy},</if>
            <if test="createdTime != null">#{createdTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>
    <insert id="insertSjZjyFdxnbBatch">

        INSERT INTO sj_zjy_fdxnb
        (jh, jd, md, msldnd, apilsl, apinb, jql, ph, hsl, zgh, mzxs, dql, sxnd, bz)
        VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.jh},
            #{item.jd},
            #{item.md},
            #{item.msldnd},
            #{item.apilsl},
            #{item.apinb},
            #{item.jql},
            #{item.ph},
            #{item.hsl},
            #{item.zgh},
            #{item.mzxs},
            #{item.dql},
            #{item.sxnd},
            #{item.bz}
            )
        </foreach>

    </insert>

    <update id="updateSjZjyFdxnb" parameterType="SjZjyFdxnb">
        update sj_zjy_fdxnb
        <trim prefix="SET" suffixOverrides=",">
            <if test="jh != null">jh = #{jh},</if>
            <if test="jd != null">jd = #{jd},</if>
            <if test="md != null">md = #{md},</if>
            <if test="msldnd != null">msldnd = #{msldnd},</if>
            <if test="apilsl != null">apilsl = #{apilsl},</if>
            <if test="apinb != null">apinb = #{apinb},</if>
            <if test="jql != null">jql = #{jql},</if>
            <if test="ph != null">ph = #{ph},</if>
            <if test="hsl != null">hsl = #{hsl},</if>
            <if test="zgh != null">zgh = #{zgh},</if>
            <if test="mzxs != null">mzxs = #{mzxs},</if>
            <if test="dql != null">dql = #{dql},</if>
            <if test="sxnd != null">sxnd = #{sxnd},</if>
            <if test="bz != null">bz = #{bz},</if>
            <if test="createdBy != null">created_by = #{createdBy},</if>
            <if test="createdTime != null">created_time = #{createdTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSjZjyFdxnbById" parameterType="Long">
        delete from sj_zjy_fdxnb where id = #{id}
    </delete>

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