<?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.zt.mapper.JsbaMapper">
    
    <resultMap type="Jsba" id="JsbaResult">
        <result property="jh"    column="jh"    />
        <result property="gzmc"    column="gzmc"  />
        <result property="jx"    column="jx"    />
        <result property="jb"    column="jb"    />
        <result property="jkhzb"    column="jkhzb"    />
        <result property="jkzzb"    column="jkzzb"    />
        <result property="jdhzb"    column="jdhzb"    />
        <result property="jdzzb"    column="jdzzb"    />
        <result property="dlwz"    column="dlwz"    />
        <result property="gzwz"    column="gzwz"    />
        <result property="cxwz"    column="cxwz"    />
        <result property="dmhb"    column="dmhb"    />
        <result property="bxhb"    column="bxhb"    />
        <result property="hssd"    column="hssd"    />
        <result property="lrsd"    column="lrsd"    />
        <result property="zjmd"    column="zjmd"    />
        <result property="cpj"    column="cpj"    />
        <result property="ptbh"    column="ptbh"    />
        <result property="jd"    column="jd"    />
        <result property="wd"    column="wd"    />
        <result property="jdhzb1"    column="jdhzb1"    />
        <result property="jdzzb1"    column="jdzzb1"    />
        <result property="jdhzb2"    column="jdhzb2"    />
        <result property="jdzzb2"    column="jdzzb2"    />
        <result property="jdhzb3"    column="jdhzb3"    />
        <result property="jdzzb3"    column="jdzzb3"    />
        <result property="jdhzb4"    column="jdhzb4"    />
        <result property="jdzzb4"    column="jdzzb4"    />
    </resultMap>

    <sql id="selectJsbaVo">
        select jh, gzmc, jx, jb, jkhzb, jkzzb, jdhzb, jdzzb, dlwz, gzwz, cxwz, dmhb, bxhb, hssd, lrsd, zjmd, cpj, ptbh, jd, wd, jdhzb1, jdzzb1, jdhzb2, jdzzb2, jdhzb3, jdzzb3, jdhzb4, jdzzb4 from jsba
    </sql>

    <select id="selectJsbaList" parameterType="Jsba" resultMap="JsbaResult">
        <include refid="selectJsbaVo"/>
        <where>  
            <if test="gzmc != null  and gzmc != ''"> and gzmc = #{gzmc}</if>
            <if test="jx != null  and jx != ''"> and jx = #{jx}</if>
            <if test="jb != null  and jb != ''"> and jb = #{jb}</if>
            <if test="jkhzb != null "> and jkhzb = #{jkhzb}</if>
            <if test="jkzzb != null "> and jkzzb = #{jkzzb}</if>
            <if test="jdhzb != null "> and jdhzb = #{jdhzb}</if>
            <if test="jdzzb != null "> and jdzzb = #{jdzzb}</if>
            <if test="dlwz != null  and dlwz != ''"> and dlwz = #{dlwz}</if>
            <if test="gzwz != null  and gzwz != ''"> and gzwz = #{gzwz}</if>
            <if test="cxwz != null  and cxwz != ''"> and cxwz = #{cxwz}</if>
            <if test="dmhb != null "> and dmhb = #{dmhb}</if>
            <if test="bxhb != null "> and bxhb = #{bxhb}</if>
            <if test="hssd != null "> and hssd = #{hssd}</if>
            <if test="lrsd != null "> and lrsd = #{lrsd}</if>
            <if test="zjmd != null  and zjmd != ''"> and zjmd = #{zjmd}</if>
            <if test="cpj != null "> and cpj = #{cpj}</if>
            <if test="ptbh != null  and ptbh != ''"> and ptbh = #{ptbh}</if>
            <if test="jd != null "> and jd = #{jd}</if>
            <if test="wd != null "> and wd = #{wd}</if>
            <if test="jdhzb1 != null "> and jdhzb1 = #{jdhzb1}</if>
            <if test="jdzzb1 != null "> and jdzzb1 = #{jdzzb1}</if>
            <if test="jdhzb2 != null "> and jdhzb2 = #{jdhzb2}</if>
            <if test="jdzzb2 != null "> and jdzzb2 = #{jdzzb2}</if>
            <if test="jdhzb3 != null "> and jdhzb3 = #{jdhzb3}</if>
            <if test="jdzzb3 != null "> and jdzzb3 = #{jdzzb3}</if>
            <if test="jdhzb4 != null "> and jdhzb4 = #{jdhzb4}</if>
            <if test="jdzzb4 != null "> and jdzzb4 = #{jdzzb4}</if>
        </where>
    </select>
    
    <select id="selectJsbaByJh" parameterType="String" resultMap="JsbaResult">
        <include refid="selectJsbaVo"/>
        where jh = #{jh}
    </select>
        
    <insert id="insertJsba" parameterType="Jsba">

        insert into jsba
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="gzmc != null">gzmc,</if>
            <if test="jx != null">jx,</if>
            <if test="jb != null">jb,</if>
            <if test="jkhzb != null">jkhzb,</if>
            <if test="jkzzb != null">jkzzb,</if>
            <if test="jdhzb != null">jdhzb,</if>
            <if test="jdzzb != null">jdzzb,</if>
            <if test="dlwz != null">dlwz,</if>
            <if test="gzwz != null">gzwz,</if>
            <if test="cxwz != null">cxwz,</if>
            <if test="dmhb != null">dmhb,</if>
            <if test="bxhb != null">bxhb,</if>
            <if test="hssd != null">hssd,</if>
            <if test="lrsd != null">lrsd,</if>
            <if test="zjmd != null">zjmd,</if>
            <if test="cpj != null">cpj,</if>
            <if test="ptbh != null">ptbh,</if>
            <if test="jd != null">jd,</if>
            <if test="wd != null">wd,</if>
            <if test="jdhzb1 != null">jdhzb1,</if>
            <if test="jdzzb1 != null">jdzzb1,</if>
            <if test="jdhzb2 != null">jdhzb2,</if>
            <if test="jdzzb2 != null">jdzzb2,</if>
            <if test="jdhzb3 != null">jdhzb3,</if>
            <if test="jdzzb3 != null">jdzzb3,</if>
            <if test="jdhzb4 != null">jdhzb4,</if>
            <if test="jdzzb4 != null">jdzzb4,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jh != null">#{jh},</if>
            <if test="gzmc != null">#{gzmc},</if>
            <if test="jx != null">#{jx},</if>
            <if test="jb != null">#{jb},</if>
            <if test="jkhzb != null">#{jkhzb},</if>
            <if test="jkzzb != null">#{jkzzb},</if>
            <if test="jdhzb != null">#{jdhzb},</if>
            <if test="jdzzb != null">#{jdzzb},</if>
            <if test="dlwz != null">#{dlwz},</if>
            <if test="gzwz != null">#{gzwz},</if>
            <if test="cxwz != null">#{cxwz},</if>
            <if test="dmhb != null">#{dmhb},</if>
            <if test="bxhb != null">#{bxhb},</if>
            <if test="hssd != null">#{hssd},</if>
            <if test="lrsd != null">#{lrsd},</if>
            <if test="zjmd != null">#{zjmd},</if>
            <if test="cpj != null">#{cpj},</if>
            <if test="ptbh != null">#{ptbh},</if>
            <if test="jd != null">#{jd},</if>
            <if test="wd != null">#{wd},</if>
            <if test="jdhzb1 != null">#{jdhzb1},</if>
            <if test="jdzzb1 != null">#{jdzzb1},</if>
            <if test="jdhzb2 != null">#{jdhzb2},</if>
            <if test="jdzzb2 != null">#{jdzzb2},</if>
            <if test="jdhzb3 != null">#{jdhzb3},</if>
            <if test="jdzzb3 != null">#{jdzzb3},</if>
            <if test="jdhzb4 != null">#{jdhzb4},</if>
            <if test="jdzzb4 != null">#{jdzzb4},</if>
         </trim>
    </insert>

    <update id="updateJsba" parameterType="Jsba">
        update jsba
        <trim prefix="SET" suffixOverrides=",">
            <if test="gzmc != null">gzmc = #{gzmc},</if>
            <if test="jx != null">jx = #{jx},</if>
            <if test="jb != null">jb = #{jb},</if>
            <if test="jkhzb != null">jkhzb = #{jkhzb},</if>
            <if test="jkzzb != null">jkzzb = #{jkzzb},</if>
            <if test="jdhzb != null">jdhzb = #{jdhzb},</if>
            <if test="jdzzb != null">jdzzb = #{jdzzb},</if>
            <if test="dlwz != null">dlwz = #{dlwz},</if>
            <if test="gzwz != null">gzwz = #{gzwz},</if>
            <if test="cxwz != null">cxwz = #{cxwz},</if>
            <if test="dmhb != null">dmhb = #{dmhb},</if>
            <if test="bxhb != null">bxhb = #{bxhb},</if>
            <if test="hssd != null">hssd = #{hssd},</if>
            <if test="lrsd != null">lrsd = #{lrsd},</if>
            <if test="zjmd != null">zjmd = #{zjmd},</if>
            <if test="cpj != null">cpj = #{cpj},</if>
            <if test="ptbh != null">ptbh = #{ptbh},</if>
            <if test="jd != null">jd = #{jd},</if>
            <if test="wd != null">wd = #{wd},</if>
            <if test="jdhzb1 != null">jdhzb1 = #{jdhzb1},</if>
            <if test="jdzzb1 != null">jdzzb1 = #{jdzzb1},</if>
            <if test="jdhzb2 != null">jdhzb2 = #{jdhzb2},</if>
            <if test="jdzzb2 != null">jdzzb2 = #{jdzzb2},</if>
            <if test="jdhzb3 != null">jdhzb3 = #{jdhzb3},</if>
            <if test="jdzzb3 != null">jdzzb3 = #{jdzzb3},</if>
            <if test="jdhzb4 != null">jdhzb4 = #{jdhzb4},</if>
            <if test="jdzzb4 != null">jdzzb4 = #{jdzzb4},</if>
        </trim>
        where jh = #{jh}
    </update>

    <delete id="deleteJsbaByJh" parameterType="String">
        delete from jsba where jh = #{jh}
    </delete>

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