|
@@ -74,11 +74,8 @@
|
|
|
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 test="vo.extType != null">
|
|
|
- or t.id = u.node_ext_id
|
|
|
- </if>
|
|
|
</if>
|
|
|
- where u.is_deleted = 0 and t.is_deleted = 0
|
|
|
+ where u.is_deleted = 0
|
|
|
<if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
|
|
|
and u.status = #{vo.isApprovalValue}
|
|
|
</if>
|
|
@@ -110,22 +107,39 @@
|
|
|
<if test="vo.rectification == null and vo.archiveId == null">
|
|
|
and (u.is_auto_file is null or u.is_auto_file != 1)
|
|
|
</if>
|
|
|
-<!-- <choose>-->
|
|
|
-<!-- <when test="vo.isArchive != null and vo.isArchive != ''">-->
|
|
|
-<!-- and u.is_auto_file = #{vo.isArchive}-->
|
|
|
-<!-- </when>-->
|
|
|
-<!-- <when test="vo.archiveId != null and vo.archiveId != ''">-->
|
|
|
-<!-- and 1=1-->
|
|
|
-<!-- </when>-->
|
|
|
-<!-- <otherwise>-->
|
|
|
-<!-- and (u.is_auto_file is null or u.is_auto_file != 1)-->
|
|
|
-<!-- </otherwise>-->
|
|
|
-<!-- </choose>-->
|
|
|
+ <!-- <choose>-->
|
|
|
+ <!-- <when test="vo.isArchive != null and vo.isArchive != ''">-->
|
|
|
+ <!-- and u.is_auto_file = #{vo.isArchive}-->
|
|
|
+ <!-- </when>-->
|
|
|
+ <!-- <when test="vo.archiveId != null and vo.archiveId != ''">-->
|
|
|
+ <!-- and 1=1-->
|
|
|
+ <!-- </when>-->
|
|
|
+ <!-- <otherwise>-->
|
|
|
+ <!-- and (u.is_auto_file is null or u.is_auto_file != 1)-->
|
|
|
+ <!-- </otherwise>-->
|
|
|
+ <!-- </choose>-->
|
|
|
<if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
- and (find_in_set(#{vo.nodeIds},t.ancestors) or t.id = #{vo.nodeIds})
|
|
|
- </if>
|
|
|
- <if test="vo.authCode != null and vo.authCode != ''">
|
|
|
- AND (t.tree_code = #{authCode} or t.tree_code = #{contractId} or t.parent_id = 0)
|
|
|
+ and
|
|
|
+ <choose>
|
|
|
+ <!-- 当存在扩展类型时,同时查 node_id 和 node_ext_id -->
|
|
|
+ <when test="vo.extType != null">
|
|
|
+ (u.node_id in
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
+ #{nodeId}
|
|
|
+ </foreach>
|
|
|
+ OR u.node_ext_id in
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
+ #{nodeId}
|
|
|
+ </foreach>)
|
|
|
+ </when>
|
|
|
+ <!-- 默认只查 node_id -->
|
|
|
+ <otherwise>
|
|
|
+ u.node_id in
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
+ #{nodeId}
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
<if test="vo.queryValue != null and vo.queryValue != ''">
|
|
|
and (
|
|
@@ -143,11 +157,8 @@
|
|
|
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 test="vo.extType != null">
|
|
|
- or t.id = u.node_ext_id
|
|
|
- </if>
|
|
|
</if>
|
|
|
- where u.is_deleted = 0 and t.is_deleted = 0
|
|
|
+ where u.is_deleted = 0
|
|
|
<if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
|
|
|
and u.status = #{vo.isApprovalValue}
|
|
|
</if>
|
|
@@ -179,22 +190,39 @@
|
|
|
<if test="vo.rectification == null and vo.archiveId == null">
|
|
|
and (u.is_auto_file is null or u.is_auto_file != 1)
|
|
|
</if>
|
|
|
-<!-- <choose>-->
|
|
|
-<!-- <when test="vo.isArchive != null and vo.isArchive != ''">-->
|
|
|
-<!-- and u.is_auto_file = #{vo.isArchive}-->
|
|
|
-<!-- </when>-->
|
|
|
-<!-- <when test="vo.archiveId != null and vo.archiveId != ''">-->
|
|
|
-<!-- and 1=1-->
|
|
|
-<!-- </when>-->
|
|
|
-<!-- <otherwise>-->
|
|
|
-<!-- and (u.is_auto_file is null or u.is_auto_file != 1)-->
|
|
|
-<!-- </otherwise>-->
|
|
|
-<!-- </choose>-->
|
|
|
+ <!-- <choose>-->
|
|
|
+ <!-- <when test="vo.isArchive != null and vo.isArchive != ''">-->
|
|
|
+ <!-- and u.is_auto_file = #{vo.isArchive}-->
|
|
|
+ <!-- </when>-->
|
|
|
+ <!-- <when test="vo.archiveId != null and vo.archiveId != ''">-->
|
|
|
+ <!-- and 1=1-->
|
|
|
+ <!-- </when>-->
|
|
|
+ <!-- <otherwise>-->
|
|
|
+ <!-- and (u.is_auto_file is null or u.is_auto_file != 1)-->
|
|
|
+ <!-- </otherwise>-->
|
|
|
+ <!-- </choose>-->
|
|
|
<if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
- and (find_in_set(#{vo.nodeIds},t.ancestors) or t.id = #{vo.nodeIds})
|
|
|
- </if>
|
|
|
- <if test="vo.authCode != null and vo.authCode != ''">
|
|
|
- AND (t.tree_code = #{authCode} or t.tree_code = #{contractId} or t.parent_id = 0)
|
|
|
+ and
|
|
|
+ <choose>
|
|
|
+ <!-- 当存在扩展类型时,同时查 node_id 和 node_ext_id -->
|
|
|
+ <when test="vo.extType != null">
|
|
|
+ (u.node_id in
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
+ #{nodeId}
|
|
|
+ </foreach>
|
|
|
+ OR u.node_ext_id in
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
+ #{nodeId}
|
|
|
+ </foreach>)
|
|
|
+ </when>
|
|
|
+ <!-- 默认只查 node_id -->
|
|
|
+ <otherwise>
|
|
|
+ u.node_id in
|
|
|
+ <foreach collection="vo.nodeIdArray" item="nodeId" open="(" separator="," close=")">
|
|
|
+ #{nodeId}
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</if>
|
|
|
<if test="vo.queryValue != null and vo.queryValue != ''">
|
|
|
and (
|