<?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.zt.mapper.LjSzfxjgMapper">
    
    <resultMap type="LjSzfxjg" id="LjSzfxjgResult">
        <result property="id"    column="id"    />
        <result property="gnmk"    column="gnmk"    />
        <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="xxcs"    column="xxcs"    />
        <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="selectLjSzfxjgVo">
        select id, gnmk, fxfw, fxdx, fxxy, fxjl, scfx, yxyj, zyjy, qcyj, tjpf, xxcs, created_by, created_time, update_by, update_time from lj_szfxjg
    </sql>

    <select id="selectLjSzfxjgList" parameterType="LjSzfxjg" resultMap="LjSzfxjgResult">
        <include refid="selectLjSzfxjgVo"/>
        <where>  
            <if test="gnmk != null  and gnmk != ''"> and gnmk = #{gnmk}</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="xxcs != null  and xxcs != ''"> and xxcs = #{xxcs}</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="selectLjSzfxjgById" parameterType="Long" resultMap="LjSzfxjgResult">
        <include refid="selectLjSzfxjgVo"/>
        where id = #{id}
    </select>
    <select id="getszfxjgList" resultType="com.ruoyi.project.zt.domain.LjSzfxjg">
        <include refid="selectLjSzfxjgVo"/>
        <where>
            <if test="gnmk != null  and gnmk != ''"> and gnmk = #{gnmk}</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="xxcs != null  and xxcs != ''"> and xxcs = #{xxcs}</if>
            <if test="createdBy != null  and createdBy != ''"> and created_by = #{createdBy}</if>
            <if test="createdTime != null "> and created_time = #{createdTime}</if>
        </where>
    </select>

    <insert id="insertLjSzfxjg" parameterType="LjSzfxjg" useGeneratedKeys="true" keyProperty="id">
        insert into lj_szfxjg
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="gnmk != null">gnmk,</if>
            <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="xxcs != null">xxcs,</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="gnmk != null">#{gnmk},</if>
            <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="xxcs != null">#{xxcs},</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>


    <insert id="batchLjSzfxjg">
        insert into lj_szfxjg(  gnmk, fxfw, fxdx, fxxy, fxjl, scfx, yxyj, zyjy, qcyj, tjpf, xxcs, created_by, created_time, update_by, update_time) values
        <foreach item="item" index="index" collection="list" separator=",">
            (  #{item.gnmk}, #{item.fxfw}, #{item.fxdx}, #{item.fxxy}, #{item.fxjl}, #{item.scfx}, #{item.yxyj}, #{item.zyjy}, #{item.qcyj}, #{item.tjpf}, #{item.xxcs}, #{item.createdBy}, #{item.createdTime}, #{item.updateBy}, #{item.updateTime})
        </foreach>
    </insert>

    <update id="updateLjSzfxjg" parameterType="LjSzfxjg">
        update lj_szfxjg
        <trim prefix="SET" suffixOverrides=",">
            <if test="gnmk != null">gnmk = #{gnmk},</if>
            <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="xxcs != null">xxcs = #{xxcs},</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="deleteLjSzfxjgById" parameterType="Long">
        delete from lj_szfxjg where id = #{id}
    </delete>

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