<?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.SjFdsgcsTsgjMapper">
    
    <resultMap type="SjFdsgcsTsgj" id="SjFdsgcsTsgjResult">
        <result property="id"    column="id"    />
        <result property="jh"    column="jh"    />
        <result property="kc"    column="kc"    />
        <result property="gjmc"    column="gjmc"    />
        <result property="ggxh"    column="ggxh"    />
        <result property="sl"    column="sl"    />
        <result property="xnzb"    column="xnzb"    />
        <result property="yjazwz"    column="yjazwz"    />
        <result property="yqxg"    column="yqxg"    />
    </resultMap>

    <sql id="selectSjFdsgcsTsgjVo">
        select id, jh, kc, gjmc, ggxh, sl, xnzb, yjazwz, yqxg from sj_fdsgcs_tsgj
    </sql>

    <select id="selectSjFdsgcsTsgjList" parameterType="SjFdsgcsTsgj" resultMap="SjFdsgcsTsgjResult">
        <include refid="selectSjFdsgcsTsgjVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh = #{jh}</if>
            <if test="kc != null  and kc != ''"> and kc = #{kc}</if>
            <if test="gjmc != null  and gjmc != ''"> and gjmc = #{gjmc}</if>
            <if test="ggxh != null  and ggxh != ''"> and ggxh = #{ggxh}</if>
            <if test="sl != null "> and sl = #{sl}</if>
            <if test="xnzb != null  and xnzb != ''"> and xnzb = #{xnzb}</if>
            <if test="yjazwz != null  and yjazwz != ''"> and yjazwz = #{yjazwz}</if>
            <if test="yqxg != null  and yqxg != ''"> and yqxg = #{yqxg}</if>
        </where>
    </select>
    
    <select id="selectSjFdsgcsTsgjById" parameterType="Long" resultMap="SjFdsgcsTsgjResult">
        <include refid="selectSjFdsgcsTsgjVo"/>
        where id = #{id}
    </select>

    <insert id="insertSjFdsgcsTsgj" parameterType="SjFdsgcsTsgj" useGeneratedKeys="true" keyProperty="id">
        insert into sj_fdsgcs_tsgj
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="kc != null">kc,</if>
            <if test="gjmc != null">gjmc,</if>
            <if test="ggxh != null">ggxh,</if>
            <if test="sl != null">sl,</if>
            <if test="xnzb != null">xnzb,</if>
            <if test="yjazwz != null">yjazwz,</if>
            <if test="yqxg != null">yqxg,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jh != null">#{jh},</if>
            <if test="kc != null">#{kc},</if>
            <if test="gjmc != null">#{gjmc},</if>
            <if test="ggxh != null">#{ggxh},</if>
            <if test="sl != null">#{sl},</if>
            <if test="xnzb != null">#{xnzb},</if>
            <if test="yjazwz != null">#{yjazwz},</if>
            <if test="yqxg != null">#{yqxg},</if>
         </trim>
    </insert>

    <update id="updateSjFdsgcsTsgj" parameterType="SjFdsgcsTsgj">
        update sj_fdsgcs_tsgj
        <trim prefix="SET" suffixOverrides=",">
            <if test="jh != null">jh = #{jh},</if>
            <if test="kc != null">kc = #{kc},</if>
            <if test="gjmc != null">gjmc = #{gjmc},</if>
            <if test="ggxh != null">ggxh = #{ggxh},</if>
            <if test="sl != null">sl = #{sl},</if>
            <if test="xnzb != null">xnzb = #{xnzb},</if>
            <if test="yjazwz != null">yjazwz = #{yjazwz},</if>
            <if test="yqxg != null">yqxg = #{yqxg},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSjFdsgcsTsgjById" parameterType="Long">
        delete from sj_fdsgcs_tsgj where id = #{id}
    </delete>

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