<?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.ZsyzSkxmMapper">
    
    <resultMap type="ZsyzSkxm" id="ZsyzSkxmResult">
        <result property="id"    column="id"    />
        <result property="isHs"    column="is_hs"    />
        <result property="xmmc"    column="xmmc"    />
        <result property="pzwh"    column="pzwh"    />
        <result property="yyzz"    column="yyzz"    />
        <result property="szdqId"    column="szdq_id"    />
        <result property="szdqName"    column="szdq_name"    />
        <result property="sscy"    column="sscy"    />
        <result property="xxcy"    column="xxcy"    />
        <result property="zdcy"    column="zdcy"    />
        <result property="isLt"    column="is_lt"    />
        <result property="isFzzlfdcy"    column="is_fzzlfdcy"    />
        <result property="tzfs"    column="tzfs"    />
        <result property="rkTime"    column="rk_time"    />
        <result property="kgjsTime"    column="kgjs_time"    />
        <result property="jswcTime"    column="jswc_time"    />
        <result property="ztze"    column="ztze"    />
        <result property="swzj"    column="swzj"    />
        <result property="jsjd"    column="jsjd"    />
        <result property="xmnr"    column="xmnr"    />
        <result property="czwt"    column="czwt"    />
        <result property="isSh"    column="is_sh"    />
        <result property="shName"    column="sh_name"    />
        <result property="shTime"    column="sh_time"    />
        <result property="shJy"    column="sh_jy"    />
        <result property="deptId"    column="dept_id"    />
        <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="selectZsyzSkxmVo">
        select z.id, z.is_hs, z.xmmc, z.pzwh, z.yyzz, z.szdq_id, z.szdq_name, z.sscy, z.xxcy, z.zdcy, z.is_lt, z.is_fzzlfdcy, z.tzfs, z.rk_time, z.kgjs_time, z.jswc_time, z.ztze, z.swzj, z.jsjd, z.xmnr, z.czwt, z.is_sh, z.sh_name, z.sh_time, z.sh_jy, z.dept_id, z.create_by, z.create_time, z.update_by, z.update_time, z.remark from zsyz_skxm z
    </sql>

    <select id="selectZsyzSkxmList" parameterType="ZsyzSkxm" resultMap="ZsyzSkxmResult">
        <include refid="selectZsyzSkxmVo"/>
        where 1=1
            <if test="isHs != null  and isHs != ''"> and z.is_hs = #{isHs}</if>
            <if test="xmmc != null  and xmmc != ''"> and z.xmmc = #{xmmc}</if>
            <if test="pzwh != null  and pzwh != ''"> and z.pzwh = #{pzwh}</if>
            <if test="yyzz != null  and yyzz != ''"> and z.yyzz = #{yyzz}</if>
            <if test="szdqId != null  and szdqId != ''"> and z.szdq_id = #{szdqId}</if>
            <if test="szdqName != null  and szdqName != ''"> and z.szdq_name like concat('%', #{szdqName}, '%')</if>
            <if test="sscy != null  and sscy != ''"> and z.sscy = #{sscy}</if>
            <if test="xxcy != null  and xxcy != ''"> and z.xxcy = #{xxcy}</if>
            <if test="zdcy != null  and zdcy != ''"> and z.zdcy = #{zdcy}</if>
            <if test="isLt != null  and isLt != ''"> and z.is_lt = #{isLt}</if>
            <if test="isFzzlfdcy != null  and isFzzlfdcy != ''"> and z.is_fzzlfdcy = #{isFzzlfdcy}</if>
            <if test="tzfs != null  and tzfs != ''"> and z.tzfs = #{tzfs}</if>
            <if test="rkTime != null "> and z.rk_time = #{rkTime}</if>
            <if test="kgjsTime != null "> and z.kgjs_time = #{kgjsTime}</if>
            <if test="jswcTime != null "> and z.jswc_time = #{jswcTime}</if>
            <if test="ztze != null  and ztze != ''"> and z.ztze = #{ztze}</if>
            <if test="swzj != null  and swzj != ''"> and z.swzj = #{swzj}</if>
            <if test="jsjd != null  and jsjd != ''"> and z.jsjd = #{jsjd}</if>
            <if test="xmnr != null  and xmnr != ''"> and z.xmnr = #{xmnr}</if>
            <if test="czwt != null  and czwt != ''"> and z.czwt = #{czwt}</if>
            <if test="isSh != null  and isSh != ''"> and z.is_sh = #{isSh}</if>
            <if test="shName != null  and shName != ''"> and z.sh_name like concat('%', #{shName}, '%')</if>
            <if test="shTime != null "> and z.sh_time = #{shTime}</if>
            <if test="shJy != null  and shJy != ''"> and z.sh_jy = #{shJy}</if>

        <!-- 数据范围过滤 -->
        ${params.dataScope}
        order by create_time DESC
    </select>
    
    <select id="selectZsyzSkxmById" parameterType="Long" resultMap="ZsyzSkxmResult">
        <include refid="selectZsyzSkxmVo"/>
        where z.id = #{id}
    </select>
        
    <insert id="insertZsyzSkxm" parameterType="ZsyzSkxm" useGeneratedKeys="true" keyProperty="id">
        insert into zsyz_skxm
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="isHs != null and isHs != ''">is_hs,</if>
            <if test="xmmc != null">xmmc,</if>
            <if test="pzwh != null">pzwh,</if>
            <if test="yyzz != null">yyzz,</if>
            <if test="szdqId != null">szdq_id,</if>
            <if test="szdqName != null">szdq_name,</if>
            <if test="sscy != null">sscy,</if>
            <if test="xxcy != null">xxcy,</if>
            <if test="zdcy != null">zdcy,</if>
            <if test="isLt != null">is_lt,</if>
            <if test="isFzzlfdcy != null">is_fzzlfdcy,</if>
            <if test="tzfs != null">tzfs,</if>
            <if test="rkTime != null">rk_time,</if>
            <if test="kgjsTime != null">kgjs_time,</if>
            <if test="jswcTime != null">jswc_time,</if>
            <if test="ztze != null">ztze,</if>
            <if test="swzj != null">swzj,</if>
            <if test="jsjd != null">jsjd,</if>
            <if test="xmnr != null">xmnr,</if>
            <if test="czwt != null">czwt,</if>
            <if test="isSh != null">is_sh,</if>
            <if test="shName != null">sh_name,</if>
            <if test="shTime != null">sh_time,</if>
            <if test="shJy != null">sh_jy,</if>
            <if test="deptId != null">dept_id,</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="isHs != null and isHs != ''">#{isHs},</if>
            <if test="xmmc != null">#{xmmc},</if>
            <if test="pzwh != null">#{pzwh},</if>
            <if test="yyzz != null">#{yyzz},</if>
            <if test="szdqId != null">#{szdqId},</if>
            <if test="szdqName != null">#{szdqName},</if>
            <if test="sscy != null">#{sscy},</if>
            <if test="xxcy != null">#{xxcy},</if>
            <if test="zdcy != null">#{zdcy},</if>
            <if test="isLt != null">#{isLt},</if>
            <if test="isFzzlfdcy != null">#{isFzzlfdcy},</if>
            <if test="tzfs != null">#{tzfs},</if>
            <if test="rkTime != null">#{rkTime},</if>
            <if test="kgjsTime != null">#{kgjsTime},</if>
            <if test="jswcTime != null">#{jswcTime},</if>
            <if test="ztze != null">#{ztze},</if>
            <if test="swzj != null">#{swzj},</if>
            <if test="jsjd != null">#{jsjd},</if>
            <if test="xmnr != null">#{xmnr},</if>
            <if test="czwt != null">#{czwt},</if>
            <if test="isSh != null">#{isSh},</if>
            <if test="shName != null">#{shName},</if>
            <if test="shTime != null">#{shTime},</if>
            <if test="shJy != null">#{shJy},</if>
            <if test="deptId != null">#{deptId},</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="updateZsyzSkxm" parameterType="ZsyzSkxm">
        update zsyz_skxm
        <trim prefix="SET" suffixOverrides=",">
            <if test="isHs != null and isHs != ''">is_hs = #{isHs},</if>
            <if test="xmmc != null">xmmc = #{xmmc},</if>
            <if test="pzwh != null">pzwh = #{pzwh},</if>
            <if test="yyzz != null">yyzz = #{yyzz},</if>
            <if test="szdqId != null">szdq_id = #{szdqId},</if>
            <if test="szdqName != null">szdq_name = #{szdqName},</if>
            <if test="sscy != null">sscy = #{sscy},</if>
            <if test="xxcy != null">xxcy = #{xxcy},</if>
            <if test="zdcy != null">zdcy = #{zdcy},</if>
            <if test="isLt != null">is_lt = #{isLt},</if>
            <if test="isFzzlfdcy != null">is_fzzlfdcy = #{isFzzlfdcy},</if>
            <if test="tzfs != null">tzfs = #{tzfs},</if>
            <if test="rkTime != null">rk_time = #{rkTime},</if>
            <if test="kgjsTime != null">kgjs_time = #{kgjsTime},</if>
            <if test="jswcTime != null">jswc_time = #{jswcTime},</if>
            <if test="ztze != null">ztze = #{ztze},</if>
            <if test="swzj != null">swzj = #{swzj},</if>
            <if test="jsjd != null">jsjd = #{jsjd},</if>
            <if test="xmnr != null">xmnr = #{xmnr},</if>
            <if test="czwt != null">czwt = #{czwt},</if>
            <if test="isSh != null">is_sh = #{isSh},</if>
            <if test="shName != null">sh_name = #{shName},</if>
            <if test="shTime != null">sh_time = #{shTime},</if>
            <if test="shJy != null">sh_jy = #{shJy},</if>
            <if test="deptId != null">dept_id = #{deptId},</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="deleteZsyzSkxmById" parameterType="Long">
        delete from zsyz_skxm where id = #{id}
    </delete>

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