<?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.SjJsjgtMapper">
    
    <resultMap type="SjJsjgt" id="SjJsjgtResult">
        <result property="id"    column="id"    />
        <result property="zbid"    column="zbid"    />
        <result property="jsjgt"    column="jsjgt"    />
    </resultMap>

    <sql id="selectSjJsjgtVo">
        select id, zbid, jsjgt from sj_jsjgt
    </sql>

    <select id="selectSjJsjgtList" parameterType="SjJsjgt" resultMap="SjJsjgtResult">
        <include refid="selectSjJsjgtVo"/>
        <where>  
            <if test="zbid != null  and zbid != ''"> and zbid = #{zbid}</if>
            <if test="jsjgt != null  and jsjgt != ''"> and jsjgt = #{jsjgt}</if>
        </where>
    </select>
    
    <select id="selectSjJsjgtById" parameterType="Long" resultMap="SjJsjgtResult">
        <include refid="selectSjJsjgtVo"/>
        where id = #{id}
    </select>

    <insert id="insertSjJsjgt" parameterType="SjJsjgt" useGeneratedKeys="true" keyProperty="id">
        insert into sj_jsjgt
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="zbid != null">zbid,</if>
            <if test="jsjgt != null">jsjgt,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="zbid != null">#{zbid},</if>
            <if test="jsjgt != null">#{jsjgt},</if>
         </trim>
    </insert>

    <update id="updateSjJsjgt" parameterType="SjJsjgt">
        update sj_jsjgt
        <trim prefix="SET" suffixOverrides=",">
            <if test="zbid != null">zbid = #{zbid},</if>
            <if test="jsjgt != null">jsjgt = #{jsjgt},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSjJsjgtById" parameterType="Long">
        delete from sj_jsjgt where id = #{id}
    </delete>

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