<?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.SjDjjcMapper">
    
    <resultMap type="SjDjjc" id="SjDjjcResult">
        <result property="id"    column="id"    />
        <result property="jh"    column="jh"    />
        <result property="jb"    column="jb"    />
        <result property="jx"    column="jx"    />
        <result property="jkhzb"    column="jkhzb"    />
        <result property="jkzzb"    column="jkzzb"    />
        <result property="gzwz"    column="gzwz"    />
        <result property="wzcw"    column="wzcw"    />
        <result property="ztmd"    column="ztmd"    />
        <result property="wzyz"    column="wzyz"    />
        <result property="wjfa"    column="wjfa"    />
        <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="zjgs"    column="zjgs"    />
        <result property="zjd"    column="zjd"    />
        <result property="jdhzb"    column="jdhzb"    />
        <result property="jdzzb"    column="jdzzb"    />
        <result property="zt"    column="zt"    />
        <result property="qk"    column="qk"    />
        <result property="sjzt"    column="sjzt"    />
        <result property="ljzlzt"    column="ljzlzt"    />
        <result property="dzfxzt"    column="dzfxzt"    />
        <result property="fxtszt"    column="fxtszt"    />
        <result property="sggyzt"    column="sggyzt"    />
        <result property="fdsgzt"    column="fdsgzt"    />
        <result property="jkzt"    column="jkzt"    />
        <result property="hsezt"    column="hsezt"    />
        <result property="jhjdzt"    column="jhjdzt"    />
        <result property="flzt"    column="flzt"    />
    </resultMap>

    <sql id="selectSjDjjcVo">
        select id, jh, jb, jx, jkhzb, jkzzb, gzwz, wzcw, ztmd, wzyz, wjfa, created_by, created_time, update_by, update_time, zjgs, zjd, jdhzb, jdzzb, zt, qk, sjzt, ljzlzt, dzfxzt, fxtszt, sggyzt, fdsgzt, jkzt, hsezt, jhjdzt, flzt from sj_djjc
    </sql>

    <select id="selectSjDjjcList" parameterType="SjDjjc" resultMap="SjDjjcResult">
        <include refid="selectSjDjjcVo"/>
        <where>  
            <if test="jh != null  and jh != ''"> and jh like  concat('%', #{jh}, '%')</if>
            <if test="jb != null  and jb != ''"> and jb like  concat('%', #{jb}, '%')</if>
            <if test="jx != null  and jx != ''"> and jx like  concat('%', #{jx}, '%')</if>
            <if test="qk != null  and qk != ''"> and qk like  concat('%', #{qk}, '%')</if>
            <if test="jkhzb != null "> and jkhzb >= #{jkhzb}</if>
            <if test="jkzzb != null "> and jkzzb &lt;= #{jkzzb}</if>
            <if test="gzwz != null  and gzwz != ''"> and gzwz = #{gzwz}</if>
            <if test="wzcw != null  and wzcw != ''"> and wzcw = #{wzcw}</if>
            <if test="ztmd != null  and ztmd != ''"> and ztmd = #{ztmd}</if>
            <if test="wzyz != null  and wzyz != ''"> and wzyz = #{wzyz}</if>
            <if test="wjfa != null  and wjfa != ''"> and wjfa = #{wjfa}</if>
            <if test="createdBy != null  and createdBy != ''"> and created_by = #{createdBy}</if>
            <if test="createdTime != null "> and created_time = #{createdTime}</if>
            <if test="zjgs != null  and zjgs != ''"> and zjgs = #{zjgs}</if>
            <if test="zjd != null  and zjd != ''"> and zjd = #{zjd}</if>
            <if test="jdhzb != null "> and jdhzb = #{jdhzb}</if>
            <if test="jdzzb != null "> and jdzzb = #{jdzzb}</if>
            <if test="zt != null  and zt != ''"> and zt = #{zt}</if>
            <if test="sjzt != null  and sjzt != ''"> and sjzt = #{sjzt}</if>
            <if test="ljzlzt != null  and ljzlzt != ''"> and ljzlzt = #{ljzlzt}</if>
            <if test="dzfxzt != null  and dzfxzt != ''"> and dzfxzt = #{dzfxzt}</if>
            <if test="fxtszt != null  and fxtszt != ''"> and fxtszt = #{fxtszt}</if>
            <if test="sggyzt != null  and sggyzt != ''"> and sggyzt = #{sggyzt}</if>
            <if test="fdsgzt != null  and fdsgzt != ''"> and fdsgzt = #{fdsgzt}</if>
            <if test="jkzt != null  and jkzt != ''"> and jkzt = #{jkzt}</if>
            <if test="hsezt != null  and hsezt != ''"> and hsezt = #{hsezt}</if>
            <if test="jhjdzt != null  and jhjdzt != ''"> and jhjdzt = #{jhjdzt}</if>
            <if test="flzt != null  and flzt != ''"> and flzt = #{flzt}</if>
        </where>
    </select>
    
    <select id="selectSjDjjcById" parameterType="Long" resultMap="SjDjjcResult">
        <include refid="selectSjDjjcVo"/>
        where id = #{id}
    </select>
    <select id="selectSjDjjcByJh" resultType="com.ruoyi.project.zjsgfa.domain.SjDjjc">
        <include refid="selectSjDjjcVo"/>
        where jh = #{jh}
    </select>

    <insert id="insertSjDjjc" parameterType="SjDjjc" useGeneratedKeys="true" keyProperty="id">
        insert into sj_djjc
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">jh,</if>
            <if test="jb != null">jb,</if>
            <if test="jx != null">jx,</if>
            <if test="jkhzb != null">jkhzb,</if>
            <if test="jkzzb != null">jkzzb,</if>
            <if test="gzwz != null">gzwz,</if>
            <if test="wzcw != null">wzcw,</if>
            <if test="ztmd != null">ztmd,</if>
            <if test="wzyz != null">wzyz,</if>
            <if test="wjfa != null">wjfa,</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="zjgs != null">zjgs,</if>
            <if test="zjd != null">zjd,</if>
            <if test="jdhzb != null">jdhzb,</if>
            <if test="jdzzb != null">jdzzb,</if>
            <if test="zt != null">zt,</if>
            <if test="qk != null">qk,</if>
            <if test="sjzt != null">sjzt,</if>
            <if test="ljzlzt != null">ljzlzt,</if>
            <if test="dzfxzt != null">dzfxzt,</if>
            <if test="fxtszt != null">fxtszt,</if>
            <if test="sggyzt != null">sggyzt,</if>
            <if test="fdsgzt != null">fdsgzt,</if>
            <if test="jkzt != null">jkzt,</if>
            <if test="hsezt != null">hsezt,</if>
            <if test="jhjdzt != null">jhjdzt,</if>
            <if test="flzt != null">flzt,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jh != null">#{jh},</if>
            <if test="jb != null">#{jb},</if>
            <if test="jx != null">#{jx},</if>
            <if test="jkhzb != null">#{jkhzb},</if>
            <if test="jkzzb != null">#{jkzzb},</if>
            <if test="gzwz != null">#{gzwz},</if>
            <if test="wzcw != null">#{wzcw},</if>
            <if test="ztmd != null">#{ztmd},</if>
            <if test="wzyz != null">#{wzyz},</if>
            <if test="wjfa != null">#{wjfa},</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="zjgs != null">#{zjgs},</if>
            <if test="zjd != null">#{zjd},</if>
            <if test="jdhzb != null">#{jdhzb},</if>
            <if test="jdzzb != null">#{jdzzb},</if>
            <if test="zt != null">#{zt},</if>
            <if test="qk != null">#{qk},</if>
            <if test="sjzt != null">#{sjzt},</if>
            <if test="ljzlzt != null">#{ljzlzt},</if>
            <if test="dzfxzt != null">#{dzfxzt},</if>
            <if test="fxtszt != null">#{fxtszt},</if>
            <if test="sggyzt != null">#{sggyzt},</if>
            <if test="fdsgzt != null">#{fdsgzt},</if>
            <if test="jkzt != null">#{jkzt},</if>
            <if test="hsezt != null">#{hsezt},</if>
            <if test="jhjdzt != null">#{jhjdzt},</if>
            <if test="flzt != null">#{flzt},</if>
         </trim>
    </insert>

    <update id="updateSjDjjc" parameterType="SjDjjc">
        update sj_djjc
        <trim prefix="SET" suffixOverrides=",">
            <if test="jb != null">jb = #{jb},</if>
            <if test="jx != null">jx = #{jx},</if>
            <if test="jkhzb != null">jkhzb = #{jkhzb},</if>
            <if test="jkzzb != null">jkzzb = #{jkzzb},</if>
            <if test="gzwz != null">gzwz = #{gzwz},</if>
            <if test="wzcw != null">wzcw = #{wzcw},</if>
            <if test="ztmd != null">ztmd = #{ztmd},</if>
            <if test="wzyz != null">wzyz = #{wzyz},</if>
            <if test="wjfa != null">wjfa = #{wjfa},</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="zjgs != null">zjgs = #{zjgs},</if>
            <if test="zjd != null">zjd = #{zjd},</if>
            <if test="jdhzb != null">jdhzb = #{jdhzb},</if>
            <if test="jdzzb != null">jdzzb = #{jdzzb},</if>
            <if test="zt != null">zt = #{zt},</if>
            <if test="qk != null">qk = #{qk},</if>
            <if test="sjzt != null">sjzt = #{sjzt},</if>
            <if test="ljzlzt != null">ljzlzt = #{ljzlzt},</if>
            <if test="dzfxzt != null">dzfxzt = #{dzfxzt},</if>
            <if test="fxtszt != null">fxtszt = #{fxtszt},</if>
            <if test="sggyzt != null">sggyzt = #{sggyzt},</if>
            <if test="fdsgzt != null">fdsgzt = #{fdsgzt},</if>
            <if test="jkzt != null">jkzt = #{jkzt},</if>
            <if test="hsezt != null">hsezt = #{hsezt},</if>
            <if test="jhjdzt != null">jhjdzt = #{jhjdzt},</if>
            <if test="flzt != null">flzt = #{flzt},</if>
        </trim>
        where jh = #{jh}
    </update>

    <delete id="deleteSjDjjcById" parameterType="Long">
        delete from sj_djjc where id = #{id}
    </delete>

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