<?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.SjZlyqXxMapper">
    
    <resultMap type="SjZlyqXx" id="SjZlyqXxResult">
        <result property="id"    column="id"    />
        <result property="jh"    column="jh"    />
        <result property="dxjzlyq"    column="dxjzlyq"    />
        <result property="gjzlyq"    column="gjzlyq"    />
        <result property="wcjjkzlyq"    column="wcjjkzlyq"    />
        <result property="yqcwrpdyq"    column="yqcwrpdyq"    />
        <result property="bz"    column="bz"    />
        <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="selectSjZlyqXxVo">
        select id, jh, dxjzlyq, gjzlyq, wcjjkzlyq, yqcwrpdyq, bz, created_by, created_time, update_by, update_time from sj_zlyq_xx
    </sql>

    <select id="selectSjZlyqXxList" parameterType="SjZlyqXx" resultMap="SjZlyqXxResult">
        <include refid="selectSjZlyqXxVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh = #{jh}</if>
            <if test="dxjzlyq != null  and dxjzlyq != ''"> and dxjzlyq = #{dxjzlyq}</if>
            <if test="gjzlyq != null  and gjzlyq != ''"> and gjzlyq = #{gjzlyq}</if>
            <if test="wcjjkzlyq != null  and wcjjkzlyq != ''"> and wcjjkzlyq = #{wcjjkzlyq}</if>
            <if test="yqcwrpdyq != null  and yqcwrpdyq != ''"> and yqcwrpdyq = #{yqcwrpdyq}</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</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="selectSjZlyqXxById" parameterType="Long" resultMap="SjZlyqXxResult">
        <include refid="selectSjZlyqXxVo"/>
        where id = #{id}
    </select>

    <insert id="insertSjZlyqXx" parameterType="SjZlyqXx" useGeneratedKeys="true" keyProperty="id">
        insert into sj_zlyq_xx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="dxjzlyq != null">dxjzlyq,</if>
            <if test="gjzlyq != null">gjzlyq,</if>
            <if test="wcjjkzlyq != null">wcjjkzlyq,</if>
            <if test="yqcwrpdyq != null">yqcwrpdyq,</if>
            <if test="bz != null">bz,</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="jh != null">#{jh},</if>
            <if test="dxjzlyq != null">#{dxjzlyq},</if>
            <if test="gjzlyq != null">#{gjzlyq},</if>
            <if test="wcjjkzlyq != null">#{wcjjkzlyq},</if>
            <if test="yqcwrpdyq != null">#{yqcwrpdyq},</if>
            <if test="bz != null">#{bz},</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="insertSjZlyqXxBatch">
        INSERT INTO sj_zlyq_xx
        (jh, dxjzlyq, gjzlyq, wcjjkzlyq, yqcwrpdyq, bz)
        VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.jh},
            #{item.dxjzlyq},
            #{item.gjzlyq},
            #{item.wcjjkzlyq},
            #{item.yqcwrpdyq},
            #{item.bz}
            )
        </foreach>
    </insert>

    <update id="updateSjZlyqXx" parameterType="SjZlyqXx">
        update sj_zlyq_xx
        <trim prefix="SET" suffixOverrides=",">
            <if test="jh != null">jh = #{jh},</if>
            <if test="dxjzlyq != null">dxjzlyq = #{dxjzlyq},</if>
            <if test="gjzlyq != null">gjzlyq = #{gjzlyq},</if>
            <if test="wcjjkzlyq != null">wcjjkzlyq = #{wcjjkzlyq},</if>
            <if test="yqcwrpdyq != null">yqcwrpdyq = #{yqcwrpdyq},</if>
            <if test="bz != null">bz = #{bz},</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="deleteSjZlyqXxById" parameterType="Long">
        delete from sj_zlyq_xx where id = #{id}
    </delete>

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