|
@@ -74,8 +74,11 @@
|
|
|
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
|
|
|
+ where u.is_deleted = 0 and t.is_deleted = 0
|
|
|
<if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
|
|
|
and u.status = #{vo.isApprovalValue}
|
|
|
</if>
|
|
@@ -119,27 +122,10 @@
|
|
|
<!-- </otherwise>-->
|
|
|
<!-- </choose>-->
|
|
|
<if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
- 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>
|
|
|
+ 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)
|
|
|
</if>
|
|
|
<if test="vo.queryValue != null and vo.queryValue != ''">
|
|
|
and (
|
|
@@ -157,8 +143,11 @@
|
|
|
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
|
|
|
+ where u.is_deleted = 0 and t.is_deleted = 0
|
|
|
<if test="vo.isApprovalValue != null and vo.isApprovalValue != ''">
|
|
|
and u.status = #{vo.isApprovalValue}
|
|
|
</if>
|
|
@@ -202,27 +191,10 @@
|
|
|
<!-- </otherwise>-->
|
|
|
<!-- </choose>-->
|
|
|
<if test="vo.nodeIds != null and vo.nodeIds != ''">
|
|
|
- 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>
|
|
|
+ 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)
|
|
|
</if>
|
|
|
<if test="vo.queryValue != null and vo.queryValue != ''">
|
|
|
and (
|