<?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.SjFdsgcsMapper">
    
    <resultMap type="SjFdsgcs" id="SjFdsgcsResult">
        <result property="id"    column="id"    />
        <result property="jh"    column="jh"    />
        <result property="kc"    column="kc"    />
        <result property="tzqk"    column="tzqk"    />
        <result property="jdqk"    column="jdqk"    />
        <result property="gjfx"    column="gjfx"    />
        <result property="gjyh"    column="gjyh"    />
        <result property="dcyl"    column="dcyl"    />
        <result property="zyfx"    column="zyfx"    />
        <result property="fxgkcs"    column="fxgkcs"    />
        <result property="zjycs"    column="zjycs"    />
        <result property="zjgccs"    column="zjgccs"    />
    </resultMap>

    <sql id="selectSjFdsgcsVo">
        select id, jh, kc, tzqk, jdqk, gjfx, gjyh, dcyl, zyfx, fxgkcs, zjycs, zjgccs from sj_fdsgcs
    </sql>

    <select id="selectSjFdsgcsList" parameterType="SjFdsgcs" resultMap="SjFdsgcsResult">
        <include refid="selectSjFdsgcsVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh = #{jh}</if>
            <if test="kc != null  and kc != ''"> and kc = #{kc}</if>
            <if test="tzqk != null  and tzqk != ''"> and tzqk = #{tzqk}</if>
            <if test="jdqk != null  and jdqk != ''"> and jdqk = #{jdqk}</if>
            <if test="gjfx != null  and gjfx != ''"> and gjfx = #{gjfx}</if>
            <if test="gjyh != null  and gjyh != ''"> and gjyh = #{gjyh}</if>
            <if test="dcyl != null  and dcyl != ''"> and dcyl = #{dcyl}</if>
            <if test="zyfx != null  and zyfx != ''"> and zyfx = #{zyfx}</if>
            <if test="fxgkcs != null  and fxgkcs != ''"> and fxgkcs = #{fxgkcs}</if>
        </where>
    </select>
    
    <select id="selectSjFdsgcsById" parameterType="Long" resultMap="SjFdsgcsResult">
        <include refid="selectSjFdsgcsVo"/>
        where id = #{id}
    </select>
    <select id="selectSjFdsgcsByJhAndKc" resultType="com.ruoyi.project.zjsgfa.domain.SjFdsgcs">
        select id, jh, kc, tzqk, jdqk, gjfx, gjyh, dcyl, zyfx, fxgkcs, zjycs, zjgccs from sj_fdsgcs where jh = #{jh} and kc = #{kc}
    </select>

    <insert id="insertSjFdsgcs" parameterType="SjFdsgcs" useGeneratedKeys="true" keyProperty="id">
        insert into sj_fdsgcs
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="kc != null">kc,</if>
            <if test="tzqk != null">tzqk,</if>
            <if test="jdqk != null">jdqk,</if>
            <if test="gjfx != null">gjfx,</if>
            <if test="gjyh != null">gjyh,</if>
            <if test="dcyl != null">dcyl,</if>
            <if test="zyfx != null">zyfx,</if>
            <if test="fxgkcs != null">fxgkcs,</if>
            <if test="zjycs != null">zjycs,</if>
            <if test="zjgccs != null">zjgccs,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jh != null">#{jh},</if>
            <if test="kc != null">#{kc},</if>
            <if test="tzqk != null">#{tzqk},</if>
            <if test="jdqk != null">#{jdqk},</if>
            <if test="gjfx != null">#{gjfx},</if>
            <if test="gjyh != null">#{gjyh},</if>
            <if test="dcyl != null">#{dcyl},</if>
            <if test="zyfx != null">#{zyfx},</if>
            <if test="fxgkcs != null">#{fxgkcs},</if>
            <if test="zjycs != null">#{zjycs},</if>
            <if test="zjgccs != null">#{zjgccs},</if>
         </trim>
    </insert>

    <update id="updateSjFdsgcs" parameterType="SjFdsgcs">
        update sj_fdsgcs
        <trim prefix="SET" suffixOverrides=",">
            <if test="jh != null">jh = #{jh},</if>
            <if test="kc != null">kc = #{kc},</if>
            <if test="tzqk != null">tzqk = #{tzqk},</if>
            <if test="jdqk != null">jdqk = #{jdqk},</if>
            <if test="gjfx != null">gjfx = #{gjfx},</if>
            <if test="gjyh != null">gjyh = #{gjyh},</if>
            <if test="dcyl != null">dcyl = #{dcyl},</if>
            <if test="zyfx != null">zyfx = #{zyfx},</if>
            <if test="fxgkcs != null">fxgkcs = #{fxgkcs},</if>
            <if test="zjycs != null">zjycs = #{zjycs},</if>
            <if test="zjgccs != null">zjgccs = #{zjgccs},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSjFdsgcsById" parameterType="Long">
        delete from sj_fdsgcs where id = #{id}
    </delete>

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