<?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.system.mapper.projectV2.ZsyzShqxPzMapper">
    
    <resultMap type="ZsyzShqxPz" id="ZsyzShqxPzResult">
        <result property="id"    column="id"    />
        <result property="stshqx"    column="stshqx"    />
        <result property="ysbmshqx"    column="ysbmshqx"    />
        <result property="cjdcjqx"    column="cjdcjqx"    />
        <result property="qylrqx"    column="qylrqx"    />
        <result property="qyshqx"    column="qyshqx"    />
        <result property="kglrqx"    column="kglrqx"    />
        <result property="kgshqx"    column="kgshqx"    />
        <result property="tclrqx"    column="tclrqx"    />
        <result property="tcshqx"    column="tcshqx"    />
        <result property="type"    column="type"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectZsyzShqxPzVo">
        select id, stshqx, ysbmshqx, cjdcjqx, qylrqx, qyshqx, kglrqx, kgshqx, tclrqx, tcshqx, type, create_by, create_time, update_by, update_time, remark from zsyz_shqx_pz
    </sql>

    <select id="selectZsyzShqxPzList" parameterType="ZsyzShqxPz" resultMap="ZsyzShqxPzResult">
        <include refid="selectZsyzShqxPzVo"/>
        <where>  
            <if test="stshqx != null  and stshqx != ''"> and stshqx = #{stshqx}</if>
            <if test="ysbmshqx != null  and ysbmshqx != ''"> and ysbmshqx = #{ysbmshqx}</if>
            <if test="cjdcjqx != null  and cjdcjqx != ''"> and cjdcjqx = #{cjdcjqx}</if>
            <if test="qylrqx != null  and qylrqx != ''"> and qylrqx = #{qylrqx}</if>
            <if test="qyshqx != null  and qyshqx != ''"> and qyshqx = #{qyshqx}</if>
            <if test="kglrqx != null  and kglrqx != ''"> and kglrqx = #{kglrqx}</if>
            <if test="kgshqx != null  and kgshqx != ''"> and kgshqx = #{kgshqx}</if>
            <if test="tclrqx != null  and tclrqx != ''"> and tclrqx = #{tclrqx}</if>
            <if test="tcshqx != null  and tcshqx != ''"> and tcshqx = #{tcshqx}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
        </where>
    </select>
    
    <select id="selectZsyzShqxPzById" parameterType="Long" resultMap="ZsyzShqxPzResult">
        <include refid="selectZsyzShqxPzVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertZsyzShqxPz" parameterType="ZsyzShqxPz" useGeneratedKeys="true" keyProperty="id">
        insert into zsyz_shqx_pz
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="stshqx != null and stshqx != ''">stshqx,</if>
            <if test="ysbmshqx != null and ysbmshqx != ''">ysbmshqx,</if>
            <if test="cjdcjqx != null and cjdcjqx != ''">cjdcjqx,</if>
            <if test="qylrqx != null and qylrqx != ''">qylrqx,</if>
            <if test="qyshqx != null and qyshqx != ''">qyshqx,</if>
            <if test="kglrqx != null and kglrqx != ''">kglrqx,</if>
            <if test="kgshqx != null and kgshqx != ''">kgshqx,</if>
            <if test="tclrqx != null and tclrqx != ''">tclrqx,</if>
            <if test="tcshqx != null and tcshqx != ''">tcshqx,</if>
            <if test="type != null and type != ''">type,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="stshqx != null and stshqx != ''">#{stshqx},</if>
            <if test="ysbmshqx != null and ysbmshqx != ''">#{ysbmshqx},</if>
            <if test="cjdcjqx != null and cjdcjqx != ''">#{cjdcjqx},</if>
            <if test="qylrqx != null and qylrqx != ''">#{qylrqx},</if>
            <if test="qyshqx != null and qyshqx != ''">#{qyshqx},</if>
            <if test="kglrqx != null and kglrqx != ''">#{kglrqx},</if>
            <if test="kgshqx != null and kgshqx != ''">#{kgshqx},</if>
            <if test="tclrqx != null and tclrqx != ''">#{tclrqx},</if>
            <if test="tcshqx != null and tcshqx != ''">#{tcshqx},</if>
            <if test="type != null and type != ''">#{type},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>

    <update id="updateZsyzShqxPz" parameterType="ZsyzShqxPz">
        update zsyz_shqx_pz
        <trim prefix="SET" suffixOverrides=",">
            <if test="stshqx != null and stshqx != ''">stshqx = #{stshqx},</if>
            <if test="ysbmshqx != null and ysbmshqx != ''">ysbmshqx = #{ysbmshqx},</if>
            <if test="cjdcjqx != null and cjdcjqx != ''">cjdcjqx = #{cjdcjqx},</if>
            <if test="qylrqx != null and qylrqx != ''">qylrqx = #{qylrqx},</if>
            <if test="qyshqx != null and qyshqx != ''">qyshqx = #{qyshqx},</if>
            <if test="kglrqx != null and kglrqx != ''">kglrqx = #{kglrqx},</if>
            <if test="kgshqx != null and kgshqx != ''">kgshqx = #{kgshqx},</if>
            <if test="tclrqx != null and tclrqx != ''">tclrqx = #{tclrqx},</if>
            <if test="tcshqx != null and tcshqx != ''">tcshqx = #{tcshqx},</if>
            <if test="type != null and type != ''">type = #{type},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteZsyzShqxPzById" parameterType="Long">
        delete from zsyz_shqx_pz where id = #{id}
    </delete>

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