|
@@ -615,12 +615,11 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="pageByArchivesAuto3" resultMap="archivesAutoResultMap">
|
|
<select id="pageByArchivesAuto3" resultMap="archivesAutoResultMap">
|
|
- select uaa.*
|
|
|
|
|
|
+ select uaa.id,uaa.name,uaa.file_number,uaa.unit,uaa.storage_time,uaa.secret_level
|
|
from
|
|
from
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
- ) 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
|
|
|
|
|
|
+ ) matc left join u_archives_auto uaa on matc.id = uaa.node_id
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
<if test="vo.contractId != null and vo.contractId != ''">
|
|
<if test="vo.contractId != null and vo.contractId != ''">
|
|
and uaa.contract_id = #{vo.contractId}
|
|
and uaa.contract_id = #{vo.contractId}
|
|
@@ -633,8 +632,7 @@
|
|
select uaa.id from
|
|
select uaa.id from
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
- ) 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
|
|
|
|
|
|
+ ) matc left join u_archives_auto uaa on matc.id = uaa.node_id
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
<if test="vo.contractId != null and vo.contractId != ''">
|
|
<if test="vo.contractId != null and vo.contractId != ''">
|
|
and uaa.contract_id = #{vo.contractId}
|
|
and uaa.contract_id = #{vo.contractId}
|
|
@@ -642,6 +640,50 @@
|
|
<if test="vo.searchType == 1 and vo.queryValue != null and vo.queryValue != ''">
|
|
<if test="vo.searchType == 1 and vo.queryValue != null and vo.queryValue != ''">
|
|
and uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%')
|
|
and uaa.name like concat('%',#{vo.queryValue},'%') or uaa.file_number like concat('%',#{vo.queryValue},'%')
|
|
</if>
|
|
</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="pageByArchivesAuto5" resultMap="archivesAutoResultMap">
|
|
|
|
+ select uaa.id from
|
|
|
|
+ (SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
|
|
+ and ancestors like concat('%',#{vo.nodeId},'%')
|
|
|
|
+ ) 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
|
|
|
|
+ <if test="vo.contractId != null and vo.contractId != ''">
|
|
|
|
+ and uaa.contract_id = #{vo.contractId}
|
|
|
|
+ </if>
|
|
<if test="vo.searchType == 2 and vo.queryValue != null and vo.queryValue != ''">
|
|
<if test="vo.searchType == 2 and vo.queryValue != null and vo.queryValue != ''">
|
|
and uaf.file_name like concat('%',#{vo.queryValue},'%')
|
|
and uaf.file_name like concat('%',#{vo.queryValue},'%')
|
|
</if>
|
|
</if>
|
|
@@ -680,11 +722,10 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getArchivesCabinet" resultMap="archivesAutoResultMap">
|
|
<select id="getArchivesCabinet" resultMap="archivesAutoResultMap">
|
|
- select uaa.* from
|
|
|
|
|
|
+ select uaa.id,uaa.name,uaa.file_number,uaa.unit from
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
- ) 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
|
|
|
|
|
|
+ ) matc left join u_archives_auto uaa on matc.id = uaa.node_id
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
<if test="vo.contractId != null and vo.contractId != ''">
|
|
<if test="vo.contractId != null and vo.contractId != ''">
|
|
and uaa.contract_id = #{vo.contractId}
|
|
and uaa.contract_id = #{vo.contractId}
|
|
@@ -695,6 +736,53 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getArchivesCabinet2" resultMap="archivesAutoResultMap">
|
|
<select id="getArchivesCabinet2" resultMap="archivesAutoResultMap">
|
|
|
|
+ select uaa.id from
|
|
|
|
+ (SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
|
|
+ and ancestors like concat('%',#{vo.nodeId},'%')
|
|
|
|
+ ) matc left join u_archives_auto uaa on matc.id = uaa.node_id
|
|
|
|
+ where uaa.is_deleted = 0 and uaa.is_archive = 1
|
|
|
|
+ <if test="vo.contractId != null and vo.contractId != ''">
|
|
|
|
+ and uaa.contract_id = #{vo.contractId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="vo.searchType == 1 and vo.queryValue != null and vo.queryValue != ''">
|
|
|
|
+ and uaa.name like concat('%',#{vo.queryValue},'%')
|
|
|
|
+ </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
|
|
|
|
+-- order by uaa.id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getArchivesCabinet22" resultMap="archivesAutoResultMap">
|
|
select uaa.id from
|
|
select uaa.id from
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
(SELECT id FROM m_archive_tree_contract WHERE project_id =#{vo.projectId}
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
and ancestors like concat('%',#{vo.nodeId},'%')
|
|
@@ -741,8 +829,8 @@
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
GROUP BY uaa.id
|
|
GROUP BY uaa.id
|
|
- order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
|
|
|
|
--- order by uaa.id
|
|
|
|
|
|
+ order by uaa.tree_sort,uaa.auto_file_sort,uaa.file_number asc
|
|
|
|
+ -- order by uaa.id
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getAllArchiveByContractType" resultType="org.springblade.archive.vo.ArchivesAutoVO">
|
|
<select id="getAllArchiveByContractType" resultType="org.springblade.archive.vo.ArchivesAutoVO">
|