|
@@ -49,10 +49,58 @@
|
|
|
<result column="filing_unit" property="filingUnit"/>
|
|
|
<result column="file_size" property="fileSize"/>
|
|
|
<result column="is_reviewed" property="isReviewed"/>
|
|
|
- <collection property="approvalFileList" javaType="java.util.List"
|
|
|
- select="approvalFile"
|
|
|
- column="{archiveId=id}">
|
|
|
- </collection>
|
|
|
+ </resultMap>
|
|
|
+<!-- 带文件子查询的-->
|
|
|
+ <resultMap id="archivesAutoResultMap2" type="org.springblade.archive.vo.ArchivesAutoVO">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="create_user" property="createUser"/>
|
|
|
+ <result column="create_dept" property="createDept"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_user" property="updateUser"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="project_id" property="projectId"/>
|
|
|
+ <result column="contract_id" property="contractId"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="file_number" property="fileNumber"/>
|
|
|
+ <result column="micron" property="micron"/>
|
|
|
+ <result column="unit" property="unit"/>
|
|
|
+ <result column="quantity" property="quantity"/>
|
|
|
+ <result column="specification" property="specification"/>
|
|
|
+ <result column="start_date" property="startDate"/>
|
|
|
+ <result column="end_date" property="endDate"/>
|
|
|
+ <result column="storage_time" property="storageTime"/>
|
|
|
+ <result column="secret_level" property="secretLevel"/>
|
|
|
+ <result column="carrier_type" property="carrierType"/>
|
|
|
+ <result column="keywords" property="keywords"/>
|
|
|
+ <result column="reviewer" property="reviewer"/>
|
|
|
+ <result column="review_date" property="reviewDate"/>
|
|
|
+ <result column="storage_location" property="storageLocation"/>
|
|
|
+ <result column="is_archive" property="isArchive"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ <result column="roll_date" property="rollDate"/>
|
|
|
+ <result column="rollor" property="rollor"/>
|
|
|
+ <result column="node_id" property="nodeId"/>
|
|
|
+ <result column="out_url" property="outUrl"/>
|
|
|
+ <result column="cd_id" property="cdId"/>
|
|
|
+ <result column="file_n" property="fileN"/>
|
|
|
+ <result column="page_n" property="pageN"/>
|
|
|
+ <result column="mileage" property="mileage"/>
|
|
|
+ <result column="file_type" property="fileType"/>
|
|
|
+ <result column="size" property="size"/>
|
|
|
+ <result column="tree_sort" property="treeSort"/>
|
|
|
+ <result column="is_open" property="isOpen"/>
|
|
|
+ <result column="ischeck" property="ischeck"/>
|
|
|
+ <result column="is_auto_file" property="isAutoFile"/>
|
|
|
+ <result column="auto_file_sort" property="autoFileSort"/>
|
|
|
+ <result column="filing_unit" property="filingUnit"/>
|
|
|
+ <result column="file_size" property="fileSize"/>
|
|
|
+ <result column="is_reviewed" property="isReviewed"/>
|
|
|
+ <collection property="approvalFileList" javaType="java.util.List"
|
|
|
+ select="approvalFile"
|
|
|
+ column="{archiveId=id}">
|
|
|
+ </collection>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="approvalFile" resultType="org.springblade.archive.vo.ArchivesAutoVO$ApprovalFile">
|
|
@@ -373,7 +421,7 @@
|
|
|
where project_id = #{projectId};
|
|
|
</select>
|
|
|
<select id="pageByArchivesAuto" resultMap="archivesAutoResultMap">
|
|
|
- select uaa.*,(select COUNT(1) from u_archive_file af WHERE af.archive_id = uaa.id AND af.is_element = 0 and af.is_deleted = 0) as pageNumber
|
|
|
+ select uaa.*
|
|
|
from m_archive_tree_contract matc left join u_archives_auto uaa on matc.id = uaa.node_id left join
|
|
|
u_archive_file uaf on uaa.id = uaf.archive_id
|
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
@@ -423,8 +471,52 @@
|
|
|
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="pageByArchivesAuto11" resultMap="archivesAutoResultMap">
|
|
|
+ select uaa.*
|
|
|
+ from m_archive_tree_contract matc left join u_archives_auto uaa on matc.id = uaa.node_id
|
|
|
+ where uaa.is_deleted = 0 and uaa.is_archive = 1 and uaa.name like concat('%',#{vo.queryValue},'%')
|
|
|
+ <if test="vo.projectId != null and vo.projectId != ''">
|
|
|
+ and matc.project_id = #{vo.projectId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.contractId != null and vo.contractId != ''">
|
|
|
+ and uaa.contract_id = #{vo.contractId} and matc.contract_id = #{vo.contractId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.storageTimes != null and vo.storageTimes != ''">
|
|
|
+ and uaa.storage_time in
|
|
|
+ <foreach collection="vo.storageTimes" item="storageTime" open="(" separator="," close=")">
|
|
|
+ #{storageTime}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.secretLevels != null and vo.secretLevels != ''">
|
|
|
+ and uaa.secret_level in
|
|
|
+ <foreach collection="vo.secretLevels" item="secretLevel" open="(" separator="," close=")">
|
|
|
+ #{secretLevel}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.carrierTypes != null and vo.carrierTypes != ''">
|
|
|
+ and uaa.carrier_type in
|
|
|
+ <foreach collection="vo.carrierTypes" item="carrierType" open="(" separator="," close=")">
|
|
|
+ #{carrierType}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.years != null and vo.years != ''">
|
|
|
+ and
|
|
|
+ <foreach collection="vo.years" item="year" separator=" or" open="(" close=")">
|
|
|
+ #{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.months != null and vo.months != ''">
|
|
|
+ and
|
|
|
+ <foreach collection="vo.months" item="month" separator=" or" open="(" close=")">
|
|
|
+ #{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ GROUP BY uaa.id
|
|
|
+ order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="pageByArchivesAuto2" resultMap="archivesAutoResultMap">
|
|
|
- select uaa.*,(select COUNT(1) from u_archive_file af WHERE af.archive_id = uaa.id AND af.is_element = 0 and af.is_deleted = 0) as pageNumber from
|
|
|
+ select uaa.* from
|
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
|
and 1=2
|
|
|
<foreach collection="vo.nodeIdArray" item="nodeId">
|
|
@@ -476,8 +568,54 @@
|
|
|
order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="pageByArchivesAuto22" resultMap="archivesAutoResultMap">
|
|
|
+ select uaa.* from
|
|
|
+ (SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
|
+ and 1=2
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId">
|
|
|
+ or ancestors like concat('%',#{nodeId},'%') or id = #{nodeId}
|
|
|
+ </foreach>
|
|
|
+ ) matc left join u_archives_auto uaa on matc.id = uaa.node_id
|
|
|
+ where uaa.is_deleted = 0 and uaa.is_archive = 1 and uaa.name like concat('%',#{vo.queryValue},'%')
|
|
|
+ <if test="vo.contractId != null and vo.contractId != ''">
|
|
|
+ and uaa.contract_id = #{vo.contractId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.storageTimes != null and vo.storageTimes != ''">
|
|
|
+ and uaa.storage_time in
|
|
|
+ <foreach collection="vo.storageTimes" item="storageTime" open="(" separator="," close=")">
|
|
|
+ #{storageTime}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.secretLevels != null and vo.secretLevels != ''">
|
|
|
+ and uaa.secret_level in
|
|
|
+ <foreach collection="vo.secretLevels" item="secretLevel" open="(" separator="," close=")">
|
|
|
+ #{secretLevel}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.carrierTypes != null and vo.carrierTypes != ''">
|
|
|
+ and uaa.carrier_type in
|
|
|
+ <foreach collection="vo.carrierTypes" item="carrierType" open="(" separator="," close=")">
|
|
|
+ #{carrierType}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.years != null and vo.years != ''">
|
|
|
+ and
|
|
|
+ <foreach collection="vo.years" item="year" separator=" or" open="(" close=")">
|
|
|
+ #{year} BETWEEN DATE_FORMAT(uaa.start_date,'%Y') and DATE_FORMAT(uaa.end_date ,'%Y')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="vo.months != null and vo.months != ''">
|
|
|
+ and
|
|
|
+ <foreach collection="vo.months" item="month" separator=" or" open="(" close=")">
|
|
|
+ #{month} BETWEEN DATE_FORMAT(uaa.start_date,'%c') and DATE_FORMAT(uaa.end_date ,'%c')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ GROUP BY uaa.id
|
|
|
+ order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="pageByArchivesAuto3" resultMap="archivesAutoResultMap">
|
|
|
- select uaa.*,(select COUNT(1) from u_archive_file af WHERE af.archive_id = uaa.id AND af.is_element = 0 and af.is_deleted = 0) as pageNumber
|
|
|
+ select uaa.*
|
|
|
from
|
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
@@ -704,6 +842,10 @@
|
|
|
<select id="getAllArchiveFileSize" resultType="java.lang.Long">
|
|
|
select sum(uaa.file_size) from u_archives_auto uaa WHERE uaa.project_id = #{projectId} and is_deleted = 0
|
|
|
</select>
|
|
|
+ <select id="getArchiveFileList" resultMap="archivesAutoResultMap2">
|
|
|
+ select *
|
|
|
+ from u_archives_auto uaa WHERE uaa.id = #{id} and is_deleted = 0
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
<update id="splitFiles">
|