<?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.SjSzfxjgMapper">
    
    <resultMap type="SjSzfxjg" id="SjSzfxjgResult">
        <result property="id"    column="id"    />
        <result property="fxfw"    column="fxfw"    />
        <result property="fxdx"    column="fxdx"    />
        <result property="fxxy"    column="fxxy"    />
        <result property="fxjl"    column="fxjl"    />
        <result property="scfx"    column="scfx"    />
        <result property="yxyj"    column="yxyj"    />
        <result property="zyjy"    column="zyjy"    />
        <result property="qcyj"    column="qcyj"    />
        <result property="tjpf"    column="tjpf"    />
        <result property="createdBy"    column="created_by"    />
        <result property="createdTime"    column="created_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="jh"    column="jh"    />
    </resultMap>

    <sql id="selectSjSzfxjgVo">
        select id, jh,fxfw, fxdx, fxxy, fxjl, scfx, yxyj, zyjy, qcyj, tjpf, created_by, created_time, update_by, update_time from sj_szfxjg
    </sql>

    <select id="selectSjSzfxjgList" parameterType="SjSzfxjg" resultMap="SjSzfxjgResult">
        <include refid="selectSjSzfxjgVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh = #{jh}</if>
            <if test="fxfw != null  and fxfw != ''"> and fxfw = #{fxfw}</if>
            <if test="fxdx != null  and fxdx != ''"> and fxdx = #{fxdx}</if>
            <if test="fxxy != null  and fxxy != ''"> and fxxy = #{fxxy}</if>
            <if test="fxjl != null  and fxjl != ''"> and fxjl = #{fxjl}</if>
            <if test="scfx != null  and scfx != ''"> and scfx = #{scfx}</if>
            <if test="yxyj != null  and yxyj != ''"> and yxyj = #{yxyj}</if>
            <if test="zyjy != null  and zyjy != ''"> and zyjy = #{zyjy}</if>
            <if test="qcyj != null  and qcyj != ''"> and qcyj = #{qcyj}</if>
            <if test="tjpf != null "> and tjpf = #{tjpf}</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="selectSjSzfxjgById" parameterType="Long" resultMap="SjSzfxjgResult">
        <include refid="selectSjSzfxjgVo"/>
        where id = #{id}
    </select>

    <insert id="insertSjSzfxjg" parameterType="SjSzfxjg" useGeneratedKeys="true" keyProperty="id">
        insert into sj_szfxjg
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fxfw != null">fxfw,</if>
            <if test="fxdx != null">fxdx,</if>
            <if test="fxxy != null">fxxy,</if>
            <if test="fxjl != null">fxjl,</if>
            <if test="scfx != null">scfx,</if>
            <if test="yxyj != null">yxyj,</if>
            <if test="zyjy != null">zyjy,</if>
            <if test="qcyj != null">qcyj,</if>
            <if test="tjpf != null">tjpf,</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>
            <if test="jh != null">jh,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fxfw != null">#{fxfw},</if>
            <if test="fxdx != null">#{fxdx},</if>
            <if test="fxxy != null">#{fxxy},</if>
            <if test="fxjl != null">#{fxjl},</if>
            <if test="scfx != null">#{scfx},</if>
            <if test="yxyj != null">#{yxyj},</if>
            <if test="zyjy != null">#{zyjy},</if>
            <if test="qcyj != null">#{qcyj},</if>
            <if test="tjpf != null">#{tjpf},</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>
            <if test="jh != null">#{jh},</if>
         </trim>
    </insert>
    <insert id="insertSjSzfxjgBatch">
        INSERT INTO sj_szfxjg
        (
        jh,fxfw, fxdx, fxxy, fxjl, scfx,
        yxyj, zyjy, qcyj, tjpf,
        created_by, created_time, update_by, update_time
        )
        VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.jh},
            #{item.fxfw},
            #{item.fxdx},
            #{item.fxxy},
            #{item.fxjl},
            #{item.scfx},
            #{item.yxyj},
            #{item.zyjy},
            #{item.qcyj},
            #{item.tjpf},
            #{item.createdBy},
            #{item.createdTime},
            #{item.updateBy},
            #{item.updateTime}
            )
        </foreach>

    </insert>

    <update id="updateSjSzfxjg" parameterType="SjSzfxjg">
        update sj_szfxjg
        <trim prefix="SET" suffixOverrides=",">
            <if test="fxfw != null">fxfw = #{fxfw},</if>
            <if test="fxdx != null">fxdx = #{fxdx},</if>
            <if test="fxxy != null">fxxy = #{fxxy},</if>
            <if test="fxjl != null">fxjl = #{fxjl},</if>
            <if test="scfx != null">scfx = #{scfx},</if>
            <if test="yxyj != null">yxyj = #{yxyj},</if>
            <if test="zyjy != null">zyjy = #{zyjy},</if>
            <if test="qcyj != null">qcyj = #{qcyj},</if>
            <if test="tjpf != null">tjpf = #{tjpf},</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>
            <if test="jh != null">jh = #{jh},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteSjSzfxjgById" parameterType="Long">
        delete from sj_szfxjg where id = #{id}
    </delete>

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