<?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.SjJygjInfoMapper">
    
    <resultMap type="SjJygjInfo" id="SjJygjInfoResult">
        <result property="id"    column="id"    />
        <result property="jh"    column="jh"    />
        <result property="gdlx"    column="gdlx"    />
        <result property="jkhzb"    column="jkhzb"    />
        <result property="jkzzb"    column="jkzzb"    />
        <result property="bdhzb"    column="bdhzb"    />
        <result property="bdzzb"    column="bdzzb"    />
        <result property="cs"    column="cs"    />
        <result property="bhj"    column="bhj"    />
        <result property="bhfx"    column="bhfx"    />
        <result property="bbj"    column="bbj"    />
        <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="selectSjJygjInfoVo">
        select id, jh, gdlx, jkhzb, jkzzb, bdhzb, bdzzb, cs, bhj, bhfx, bbj, bz, created_by, created_time, update_by, update_time from sj_jygj_info
    </sql>

    <select id="selectSjJygjInfoList" parameterType="SjJygjInfo" resultMap="SjJygjInfoResult">
        <include refid="selectSjJygjInfoVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh = #{jh}</if>
            <if test="gdlx != null  and gdlx != ''"> and gdlx = #{gdlx}</if>
            <if test="jkhzb != null "> and jkhzb = #{jkhzb}</if>
            <if test="jkzzb != null "> and jkzzb = #{jkzzb}</if>
            <if test="bdhzb != null "> and bdhzb = #{bdhzb}</if>
            <if test="bdzzb != null "> and bdzzb = #{bdzzb}</if>
            <if test="cs != null "> and cs = #{cs}</if>
            <if test="bhj != null "> and bhj = #{bhj}</if>
            <if test="bhfx != null "> and bhfx = #{bhfx}</if>
            <if test="bbj != null "> and bbj = #{bbj}</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="selectSjJygjInfoById" parameterType="Long" resultMap="SjJygjInfoResult">
        <include refid="selectSjJygjInfoVo"/>
        where id = #{id}
    </select>

    <insert id="insertSjJygjInfo" parameterType="SjJygjInfo" useGeneratedKeys="true" keyProperty="id">
        insert into sj_jygj_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="gdlx != null">gdlx,</if>
            <if test="jkhzb != null">jkhzb,</if>
            <if test="jkzzb != null">jkzzb,</if>
            <if test="bdhzb != null">bdhzb,</if>
            <if test="bdzzb != null">bdzzb,</if>
            <if test="cs != null">cs,</if>
            <if test="bhj != null">bhj,</if>
            <if test="bhfx != null">bhfx,</if>
            <if test="bbj != null">bbj,</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="gdlx != null">#{gdlx},</if>
            <if test="jkhzb != null">#{jkhzb},</if>
            <if test="jkzzb != null">#{jkzzb},</if>
            <if test="bdhzb != null">#{bdhzb},</if>
            <if test="bdzzb != null">#{bdzzb},</if>
            <if test="cs != null">#{cs},</if>
            <if test="bhj != null">#{bhj},</if>
            <if test="bhfx != null">#{bhfx},</if>
            <if test="bbj != null">#{bbj},</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>

    <update id="updateSjJygjInfo" parameterType="SjJygjInfo">
        update sj_jygj_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="jh != null">jh = #{jh},</if>
            <if test="gdlx != null">gdlx = #{gdlx},</if>
            <if test="jkhzb != null">jkhzb = #{jkhzb},</if>
            <if test="jkzzb != null">jkzzb = #{jkzzb},</if>
            <if test="bdhzb != null">bdhzb = #{bdhzb},</if>
            <if test="bdzzb != null">bdzzb = #{bdzzb},</if>
            <if test="cs != null">cs = #{cs},</if>
            <if test="bhj != null">bhj = #{bhj},</if>
            <if test="bhfx != null">bhfx = #{bhfx},</if>
            <if test="bbj != null">bbj = #{bbj},</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="deleteSjJygjInfoById" parameterType="Long">
        delete from sj_jygj_info where id = #{id}
    </delete>

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