ArchivesCollectBoxMapper.xml 15.1 KB
<?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.mapper.ArchivesCollectBoxMapper">
    
    <resultMap type="ArchivesCollectBox" id="ArchivesCollectBoxResult">
        <result property="id"    column="id"    />
        <result property="boxId"    column="box_id"    />
        <result property="general"    column="general"    />
        <result property="year"    column="year"    />
        <result property="title"    column="title"    />
        <result property="sort"    column="sort"    />
        <result property="safekeepingDate"    column="safekeeping_date"    />
        <result property="secretLevel"    column="secret_level"    />
        <result property="pages"    column="pages"    />
        <result property="filingNumber"    column="filing_number"    />
        <result property="zkNumber"    column="zk_number"    />
        <result property="locationCode"    column="location_code"    />
        <result property="filingDept"    column="filing_dept"    />
        <result property="archivalCode"    column="archival_code"    />
        <result property="responsibilityName"    column="responsibility_name"    />
        <result property="serialMark"    column="serial_mark"    />
        <result property="pieceMark"    column="piece_mark"    />
        <result property="registerMark"    column="register_mark"    />
        <result property="counsellors"    column="counsellors"    />
        <result property="filingName"    column="filing_name"    />
        <result property="summaryName"    column="summary_name"    />
        <result property="recordType"    column="record_type"    />
        <result property="carrierType"    column="carrier_type"    />
        <result property="draftName"    column="draft_name"    />
        <result property="page"    column="page"    />
        <result property="documentMark"    column="document_mark"    />
        <result property="text"    column="text"    />
        <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="status"    column="status"    />
        <result property="apprvoal"    column="apprvoal"    />
        <result property="belongRole"    column="belong_role"    />
        <result property="boxMark"    column="box_mark"    />
    </resultMap>

    <sql id="selectArchivesCollectBoxVo">
        select id,box_id, general, year, title, sort, safekeeping_date, secret_level, pages, filing_number, zk_number, location_code, filing_dept, archival_code, responsibility_name, serial_mark, piece_mark, register_mark, counsellors, filing_name, summary_name, record_type, carrier_type, draft_name, page, document_mark, text, create_by, create_time, update_by, update_time, status, apprvoal, belong_role, box_mark from archives_collect_box
    </sql>

    <select id="selectArchivesCollectBoxList" parameterType="ArchivesCollectBox" resultMap="ArchivesCollectBoxResult">
        <include refid="selectArchivesCollectBoxVo"/>
        <where>
            <if test="boxId != null "> and box_id = #{boxId}</if>
            <if test="general != null  and general != ''"> and general = #{general}</if>
            <if test="year != null  and year != ''"> and year = #{year}</if>
            <if test="title != null  and title != ''"> and title = #{title}</if>
            <if test="sort != null  and sort != ''"> and sort = #{sort}</if>
            <if test="safekeepingDate != null "> and safekeeping_date = #{safekeepingDate}</if>
            <if test="secretLevel != null  and secretLevel != ''"> and secret_level = #{secretLevel}</if>
            <if test="pages != null  and pages != ''"> and pages = #{pages}</if>
            <if test="filingNumber != null  and filingNumber != ''"> and filing_number = #{filingNumber}</if>
            <if test="zkNumber != null  and zkNumber != ''"> and zk_number = #{zkNumber}</if>
            <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
            <if test="filingDept != null  and filingDept != ''"> and filing_dept = #{filingDept}</if>
            <if test="archivalCode != null  and archivalCode != ''"> and archival_code = #{archivalCode}</if>
            <if test="responsibilityName != null  and responsibilityName != ''"> and responsibility_name like concat('%', #{responsibilityName}, '%')</if>
            <if test="serialMark != null  and serialMark != ''"> and serial_mark = #{serialMark}</if>
            <if test="pieceMark != null  and pieceMark != ''"> and piece_mark = #{pieceMark}</if>
            <if test="registerMark != null  and registerMark != ''"> and register_mark = #{registerMark}</if>
            <if test="counsellors != null  and counsellors != ''"> and counsellors = #{counsellors}</if>
            <if test="filingName != null  and filingName != ''"> and filing_name like concat('%', #{filingName}, '%')</if>
            <if test="summaryName != null  and summaryName != ''"> and summary_name like concat('%', #{summaryName}, '%')</if>
            <if test="recordType != null  and recordType != ''"> and record_type = #{recordType}</if>
            <if test="carrierType != null  and carrierType != ''"> and carrier_type = #{carrierType}</if>
            <if test="draftName != null  and draftName != ''"> and draft_name like concat('%', #{draftName}, '%')</if>
            <if test="page != null  and page != ''"> and page = #{page}</if>
            <if test="documentMark != null  and documentMark != ''"> and document_mark = #{documentMark}</if>
            <if test="text != null  and text != ''"> and text = #{text}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="apprvoal != null  and apprvoal != ''"> and apprvoal = #{apprvoal}</if>
            <if test="belongRole != null  and belongRole != ''"> and belong_role = #{belongRole}</if>
            <if test="boxMark != null  and boxMark != ''"> and box_mark = #{boxMark}</if>
        </where>
    </select>
    
    <select id="selectArchivesCollectBoxById" parameterType="Long" resultMap="ArchivesCollectBoxResult">
        <include refid="selectArchivesCollectBoxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertArchivesCollectBox" parameterType="ArchivesCollectBox" useGeneratedKeys="true" keyProperty="id">
        insert into archives_collect_box
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="boxId != null">box_id,</if>
            <if test="general != null">general,</if>
            <if test="year != null">year,</if>
            <if test="title != null">title,</if>
            <if test="sort != null">sort,</if>
            <if test="safekeepingDate != null">safekeeping_date,</if>
            <if test="secretLevel != null">secret_level,</if>
            <if test="pages != null">pages,</if>
            <if test="filingNumber != null">filing_number,</if>
            <if test="zkNumber != null">zk_number,</if>
            <if test="locationCode != null">location_code,</if>
            <if test="filingDept != null">filing_dept,</if>
            <if test="archivalCode != null">archival_code,</if>
            <if test="responsibilityName != null">responsibility_name,</if>
            <if test="serialMark != null">serial_mark,</if>
            <if test="pieceMark != null">piece_mark,</if>
            <if test="registerMark != null">register_mark,</if>
            <if test="counsellors != null">counsellors,</if>
            <if test="filingName != null">filing_name,</if>
            <if test="summaryName != null">summary_name,</if>
            <if test="recordType != null">record_type,</if>
            <if test="carrierType != null">carrier_type,</if>
            <if test="draftName != null">draft_name,</if>
            <if test="page != null">page,</if>
            <if test="documentMark != null">document_mark,</if>
            <if test="text != null">text,</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="status != null">status,</if>
            <if test="apprvoal != null">apprvoal,</if>
            <if test="belongRole != null">belong_role,</if>
            <if test="boxMark != null">box_mark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="boxId != null">#{boxId},</if>
            <if test="general != null">#{general},</if>
            <if test="year != null">#{year},</if>
            <if test="title != null">#{title},</if>
            <if test="sort != null">#{sort},</if>
            <if test="safekeepingDate != null">#{safekeepingDate},</if>
            <if test="secretLevel != null">#{secretLevel},</if>
            <if test="pages != null">#{pages},</if>
            <if test="filingNumber != null">#{filingNumber},</if>
            <if test="zkNumber != null">#{zkNumber},</if>
            <if test="locationCode != null">#{locationCode},</if>
            <if test="filingDept != null">#{filingDept},</if>
            <if test="archivalCode != null">#{archivalCode},</if>
            <if test="responsibilityName != null">#{responsibilityName},</if>
            <if test="serialMark != null">#{serialMark},</if>
            <if test="pieceMark != null">#{pieceMark},</if>
            <if test="registerMark != null">#{registerMark},</if>
            <if test="counsellors != null">#{counsellors},</if>
            <if test="filingName != null">#{filingName},</if>
            <if test="summaryName != null">#{summaryName},</if>
            <if test="recordType != null">#{recordType},</if>
            <if test="carrierType != null">#{carrierType},</if>
            <if test="draftName != null">#{draftName},</if>
            <if test="page != null">#{page},</if>
            <if test="documentMark != null">#{documentMark},</if>
            <if test="text != null">#{text},</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="status != null">#{status},</if>
            <if test="apprvoal != null">#{apprvoal},</if>
            <if test="belongRole != null">#{belongRole},</if>
            <if test="boxMark != null">#{boxMark},</if>
         </trim>
    </insert>

    <update id="updateArchivesCollectBox" parameterType="ArchivesCollectBox">
        update archives_collect_box
        <trim prefix="SET" suffixOverrides=",">
            <if test="boxId != null">box_id = #{boxId},</if>
            <if test="general != null">general = #{general},</if>
            <if test="year != null">year = #{year},</if>
            <if test="title != null">title = #{title},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="safekeepingDate != null">safekeeping_date = #{safekeepingDate},</if>
            <if test="secretLevel != null">secret_level = #{secretLevel},</if>
            <if test="pages != null">pages = #{pages},</if>
            <if test="filingNumber != null">filing_number = #{filingNumber},</if>
            <if test="zkNumber != null">zk_number = #{zkNumber},</if>
            <if test="locationCode != null">location_code = #{locationCode},</if>
            <if test="filingDept != null">filing_dept = #{filingDept},</if>
            <if test="archivalCode != null">archival_code = #{archivalCode},</if>
            <if test="responsibilityName != null">responsibility_name = #{responsibilityName},</if>
            <if test="serialMark != null">serial_mark = #{serialMark},</if>
            <if test="pieceMark != null">piece_mark = #{pieceMark},</if>
            <if test="registerMark != null">register_mark = #{registerMark},</if>
            <if test="counsellors != null">counsellors = #{counsellors},</if>
            <if test="filingName != null">filing_name = #{filingName},</if>
            <if test="summaryName != null">summary_name = #{summaryName},</if>
            <if test="recordType != null">record_type = #{recordType},</if>
            <if test="carrierType != null">carrier_type = #{carrierType},</if>
            <if test="draftName != null">draft_name = #{draftName},</if>
            <if test="page != null">page = #{page},</if>
            <if test="documentMark != null">document_mark = #{documentMark},</if>
            <if test="text != null">text = #{text},</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="status != null">status = #{status},</if>
            <if test="apprvoal != null">apprvoal = #{apprvoal},</if>
            <if test="belongRole != null">belong_role = #{belongRole},</if>
            <if test="boxMark != null">box_mark = #{boxMark},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteArchivesCollectBoxById" parameterType="Long">
        delete from archives_collect_box where id = #{id}
    </delete>

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


    <delete id="UpdateremoveTypeArchivesCollectBoxByIds">
        update  archives_collect_box set remove =#{remove} where id in
        <foreach item="id" collection="ids" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
    
    <update id="Scatter" >
        update archives_collect_box set
        <if test="boxId != null">box_id =Null , status = #{status} ,apprvoal= #{apprvoal} where box_id = #{boxId}</if>
    </update>

    <update id="updateArchivesCollectBoxByIds" parameterType="ArchivesCollectBox">
        update archives_collect_box
        <trim prefix="SET" suffixOverrides=",">
            <if test="archivesCollectBox.borrowStatus != null">borrow_status = #{archivesCollectBox.borrowStatus},</if>
            <if test="archivesCollectBox.deportNodeId != null">deport_node_id = #{archivesCollectBox.deportNodeId},</if>
        </trim>
        where id in
        <foreach collection="ids" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>

    <update id="updateArchivesCollectBoxByBoxId" parameterType="ArchivesCollectBox">
        update archives_collect_box
        <trim prefix="SET" suffixOverrides=",">
            <if test="deportNodeId != null and deportNodeId != 'isNull'">deport_node_id = #{deportNodeId},</if>
            <if test="borrowStatus != null ">borrow_status = #{borrowStatus},</if>
            <if test="deportNodeId == 'isNull'">deport_node_id = NULL,</if>
        </trim>
        where box_id = #{boxId}
    </update>
    
</mapper>