<?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.LjZtdfzhMapper">
    
    <resultMap type="LjZtdfzh" id="LjZtdfzhResult">
        <result property="id"    column="id"    />
        <result property="kc"    column="kc"    />
        <result property="ztxh"    column="ztxh"    />
        <result property="cc"    column="cc"    />
        <result property="jcdf"    column="jcdf"    />
        <result property="jsdf"    column="jsdf"    />
        <result property="zhdf"    column="zhdf"    />
    </resultMap>

    <sql id="selectLjZtdfzhVo">
        select id, kc, ztxh, cc, jcdf, jsdf, zhdf from lj_ztdfzh
    </sql>

    <select id="selectLjZtdfzhList" parameterType="LjZtdfzh" resultMap="LjZtdfzhResult">
        <include refid="selectLjZtdfzhVo"/>
        <where>  
            <if test="kc != null  and kc != ''"> and kc = #{kc}</if>
            <if test="ztxh != null  and ztxh != ''"> and ztxh = #{ztxh}</if>
            <if test="cc != null "> and cc = #{cc}</if>
            <if test="jcdf != null "> and jcdf = #{jcdf}</if>
            <if test="jsdf != null "> and jsdf = #{jsdf}</if>
            <if test="zhdf != null "> and zhdf = #{zhdf}</if>
        </where>
    </select>
    
    <select id="selectLjZtdfzhById" parameterType="Long" resultMap="LjZtdfzhResult">
        <include refid="selectLjZtdfzhVo"/>
        where id = #{id}
    </select>
    <select id="getZtzhzzdfList" resultType="com.ruoyi.project.zt.domain.LjZtdfzh">
        <include refid="selectLjZtdfzhVo"/>
        <where>
            <if test="kc != null  and kc != ''"> and kc = #{kc}</if>
            <if test="ztxh != null  and ztxh != ''"> and ztxh = #{ztxh}</if>
            <if test="cc != null "> and cc = #{cc}</if>
            <if test="jcdf != null "> and jcdf = #{jcdf}</if>
            <if test="jsdf != null "> and jsdf = #{jsdf}</if>
            <if test="zhdf != null "> and zhdf = #{zhdf}</if>
        </where>
    </select>

    <insert id="insertLjZtdfzh" parameterType="LjZtdfzh" useGeneratedKeys="true" keyProperty="id">
        insert into lj_ztdfzh
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="kc != null">kc,</if>
            <if test="ztxh != null">ztxh,</if>
            <if test="cc != null">cc,</if>
            <if test="jcdf != null">jcdf,</if>
            <if test="jsdf != null">jsdf,</if>
            <if test="zhdf != null">zhdf,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="kc != null">#{kc},</if>
            <if test="ztxh != null">#{ztxh},</if>
            <if test="cc != null">#{cc},</if>
            <if test="jcdf != null">#{jcdf},</if>
            <if test="jsdf != null">#{jsdf},</if>
            <if test="zhdf != null">#{zhdf},</if>
         </trim>
    </insert>

    <update id="updateLjZtdfzh" parameterType="LjZtdfzh">
        update lj_ztdfzh
        <trim prefix="SET" suffixOverrides=",">
            <if test="kc != null">kc = #{kc},</if>
            <if test="ztxh != null">ztxh = #{ztxh},</if>
            <if test="cc != null">cc = #{cc},</if>
            <if test="jcdf != null">jcdf = #{jcdf},</if>
            <if test="jsdf != null">jsdf = #{jsdf},</if>
            <if test="zhdf != null">zhdf = #{zhdf},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteLjZtdfzhById" parameterType="Long">
        delete from lj_ztdfzh where id = #{id}
    </delete>

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