<?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.JcxxJkzpMapper">
    
    <resultMap type="JcxxJkzp" id="JcxxJkzpResult">
        <result property="id"    column="id"    />
        <result property="zjkzz"    column="zjkzz"    />
        <result property="jlgh"    column="jlgh"    />
        <result property="syyq"    column="syyq"    />
        <result property="clcb"    column="clcb"    />
        <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="qk"    column="qk"    />
        <result property="mc"    column="mc"    />
    </resultMap>

    <sql id="selectJcxxJkzpVo">
        select id, qk,mc, zjkzz, jlgh, syyq, clcb, created_by, created_time, update_by, update_time from jcxx_jkzp
    </sql>

    <select id="selectJcxxJkzpList" parameterType="JcxxJkzp" resultMap="JcxxJkzpResult">
        <include refid="selectJcxxJkzpVo"/>
        <where>  
            <if test="qk != null  and qk != ''"> and qk = #{qk}</if>
            <if test="mc != null  and mc != ''"> and mc like  concat('%', #{mc}, '%')</if>
            <if test="zjkzz != null  and zjkzz != ''"> and zjkzz = #{zjkzz}</if>
            <if test="jlgh != null  and jlgh != ''"> and jlgh = #{jlgh}</if>
            <if test="syyq != null  and syyq != ''"> and syyq = #{syyq}</if>
            <if test="clcb != null  and clcb != ''"> and clcb = #{clcb}</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="selectJcxxJkzpById" parameterType="Long" resultMap="JcxxJkzpResult">
        <include refid="selectJcxxJkzpVo"/>
        where id = #{id}
    </select>

    <insert id="insertJcxxJkzp" parameterType="JcxxJkzp" useGeneratedKeys="true" keyProperty="id">
        insert into jcxx_jkzp
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="zjkzz != null">zjkzz,</if>
            <if test="jlgh != null">jlgh,</if>
            <if test="syyq != null">syyq,</if>
            <if test="clcb != null">clcb,</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="qk != null">qk,</if>
            <if test="mc != null">mc,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="zjkzz != null">#{zjkzz},</if>
            <if test="jlgh != null">#{jlgh},</if>
            <if test="syyq != null">#{syyq},</if>
            <if test="clcb != null">#{clcb},</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="qk != null">#{qk},</if>
            <if test="mc != null">#{mc},</if>
         </trim>
    </insert>

    <update id="updateJcxxJkzp" parameterType="JcxxJkzp">
        update jcxx_jkzp
        <trim prefix="SET" suffixOverrides=",">
            <if test="zjkzz != null">zjkzz = #{zjkzz},</if>
            <if test="jlgh != null">jlgh = #{jlgh},</if>
            <if test="syyq != null">syyq = #{syyq},</if>
            <if test="clcb != null">clcb = #{clcb},</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="qk != null">qk = #{qk},</if>
            <if test="mc != null">mc = #{mc},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteJcxxJkzpById" parameterType="Long">
        delete from jcxx_jkzp where id = #{id}
    </delete>

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