|
@@ -67,84 +67,102 @@
|
|
|
</update>
|
|
|
|
|
|
<select id="selectArchiveFileCount" resultType="java.lang.Integer">
|
|
|
- select count(id) from u_archive_file where is_deleted = 0
|
|
|
+ select count(u.id) from u_archive_file u
|
|
|
+ <if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
+ left join m_archive_tree_contract t on t.id = u.node_id
|
|
|
+ </if>
|
|
|
+ where u.is_deleted = 0
|
|
|
<if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
|
|
|
- and status = #{vo.isApprovalValue}
|
|
|
+ and u.status = #{vo.isApprovalValue}
|
|
|
</if>
|
|
|
<if test="vo.isCertificationValue != null and vo.isCertificationValue != ''">
|
|
|
- and is_certification = #{vo.isCertificationValue}
|
|
|
+ and u.is_certification = #{vo.isCertificationValue}
|
|
|
</if>
|
|
|
<if test="vo.projectId != null and vo.projectId != ''">
|
|
|
- and project_id = #{vo.projectId}
|
|
|
+ and u.project_id = #{vo.projectId}
|
|
|
</if>
|
|
|
<if test="vo.archiveId != null and vo.archiveId != ''">
|
|
|
- and archive_id = #{vo.archiveId}
|
|
|
+ and u.archive_id = #{vo.archiveId}
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="vo.isArchive != null and vo.isArchive != ''">
|
|
|
- and is_auto_file = #{vo.isArchive}
|
|
|
+ and u.is_auto_file = #{vo.isArchive}
|
|
|
+ </when>
|
|
|
+ <when test="vo.archiveId != null and vo.archiveId != ''">
|
|
|
+ and 1=1
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- and (is_auto_file is null or is_auto_file != 1)
|
|
|
+ and (u.is_auto_file is null or u.is_auto_file != 1)
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
- and node_id in
|
|
|
+ and u.node_id in
|
|
|
<foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
#{nodeId}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="vo.queryValue != null and vo.queryValue != ''">
|
|
|
and (
|
|
|
- file_name like concat('%',#{vo.queryValue},'%') or
|
|
|
- file_number like concat('%',#{vo.queryValue},'%') or
|
|
|
- duty_user like concat('%',#{vo.queryValue},'%') or
|
|
|
- sheet_source like concat('%',#{vo.queryValue},'%') or
|
|
|
- drawing_no like concat('%',#{vo.queryValue},'%') or
|
|
|
- cite_change_number like concat('%',#{vo.queryValue},'%')
|
|
|
+ u.file_name like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.file_number like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.duty_user like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.sheet_source like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.drawing_no like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.cite_change_number like concat('%',#{vo.queryValue},'%')
|
|
|
)
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectArchiveFilePage" resultMap="archiveFileResultMap">
|
|
|
- select * from u_archive_file where is_deleted = 0
|
|
|
+ select u.* from u_archive_file u
|
|
|
+ <if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
+ left join m_archive_tree_contract t on t.id = u.node_id
|
|
|
+ </if>
|
|
|
+ where u.is_deleted = 0
|
|
|
<if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
|
|
|
- and status = #{vo.isApprovalValue}
|
|
|
+ and u.status = #{vo.isApprovalValue}
|
|
|
</if>
|
|
|
<if test="vo.isCertificationValue != null and vo.isCertificationValue != ''">
|
|
|
- and is_certification = #{vo.isCertificationValue}
|
|
|
+ and u.is_certification = #{vo.isCertificationValue}
|
|
|
</if>
|
|
|
<if test="vo.projectId != null and vo.projectId != ''">
|
|
|
- and project_id = #{vo.projectId}
|
|
|
+ and u.project_id = #{vo.projectId}
|
|
|
</if>
|
|
|
<if test="vo.archiveId != null and vo.archiveId != ''">
|
|
|
- and archive_id = #{vo.archiveId}
|
|
|
+ and u.archive_id = #{vo.archiveId}
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="vo.isArchive != null and vo.isArchive != ''">
|
|
|
- and is_auto_file = #{vo.isArchive}
|
|
|
+ and u.is_auto_file = #{vo.isArchive}
|
|
|
+ </when>
|
|
|
+ <when test="vo.archiveId != null and vo.archiveId != ''">
|
|
|
+ and 1=1
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- and (is_auto_file is null or is_auto_file != 1)
|
|
|
+ and (u.is_auto_file is null or u.is_auto_file != 1)
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
<if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
- and node_id in
|
|
|
+ and u.node_id in
|
|
|
<foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
#{nodeId}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="vo.queryValue != null and vo.queryValue != ''">
|
|
|
and (
|
|
|
- file_name like concat('%',#{vo.queryValue},'%') or
|
|
|
- file_number like concat('%',#{vo.queryValue},'%') or
|
|
|
- duty_user like concat('%',#{vo.queryValue},'%') or
|
|
|
- sheet_source like concat('%',#{vo.queryValue},'%') or
|
|
|
- drawing_no like concat('%',#{vo.queryValue},'%') or
|
|
|
- cite_change_number like concat('%',#{vo.queryValue},'%')
|
|
|
+ u.file_name like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.file_number like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.duty_user like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.sheet_source like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.drawing_no like concat('%',#{vo.queryValue},'%') or
|
|
|
+ u.cite_change_number like concat('%',#{vo.queryValue},'%')
|
|
|
)
|
|
|
</if>
|
|
|
- order by sort,create_time DESC
|
|
|
+ order by
|
|
|
+ <if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
+ t.tree_sort,
|
|
|
+ </if>
|
|
|
+ u.sort,u.create_time
|
|
|
limit #{current}, #{size}
|
|
|
</select>
|
|
|
|
|
@@ -185,7 +203,7 @@
|
|
|
cite_change_number like concat('%',#{vo.queryValue},'%')
|
|
|
)
|
|
|
</if>
|
|
|
- order by box_number,sort,create_time DESC
|
|
|
+ order by box_number,sort,create_time
|
|
|
|
|
|
</select>
|
|
|
<select id="selectArchiveFilePageByBoxName" resultMap="archiveFileResultMap">
|
|
@@ -225,7 +243,7 @@
|
|
|
cite_change_number like concat('%',#{vo.queryValue},'%')
|
|
|
)
|
|
|
</if>
|
|
|
- order by box_number,sort,create_time DESC
|
|
|
+ order by box_number,sort,create_time
|
|
|
limit #{current}, #{size}
|
|
|
</select>
|
|
|
<select id="getDeleteDataByIds" resultType="org.springblade.business.entity.ArchiveFile">
|
|
@@ -253,7 +271,7 @@
|
|
|
|
|
|
<select id="selectBoxNameAndBoxNumber" resultType="java.util.Map">
|
|
|
select box_name as boxName,box_number as boxNumber,group_concat(DISTINCT id ORDER BY id ASC SEPARATOR ',') as ids
|
|
|
- from u_archive_file where node_id = #{nodeId} and box_number is not null
|
|
|
+ from u_archive_file where node_id = #{nodeId} and (box_number is not null or box_number != '')
|
|
|
group by box_name order by box_number asc
|
|
|
</select>
|
|
|
|
|
@@ -274,7 +292,7 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- order by sort,create_time DESC
|
|
|
+ order by sort,create_time
|
|
|
</select>
|
|
|
<select id="getArchiveFileByFileIds" resultMap="archiveFileResultMap">
|
|
|
select * from u_archive_file where is_deleted = 0
|
|
@@ -284,7 +302,7 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- order by sort,create_time DESC
|
|
|
+ order by sort,create_time
|
|
|
</select>
|
|
|
<select id="getListByProjectId" resultType="org.springblade.business.entity.ArchiveFile">
|
|
|
select id,project_id as projectId,node_id as nodeId,file_number as fileNumber,file_name as fileName,file_time as fileTime,file_url as fileUrl,pdf_file_url as pdfFileUrl,archive_id as archiveId,status,is_deleted as isDeleted,create_time as createTime
|