Explorar el Código

履职计划树查询

jiawuxian hace 2 años
padre
commit
f71649c58d

+ 20 - 30
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -83,13 +83,6 @@
             <if test="info.orgType != null">
                 and a.exec_org_type = #{info.orgType}
             </if>
-            <if test="info.checkSub==false">
-                and a.plan_of_org_id = #{info.orgId}
-            </if>
-            <if test="info.checkSub==true">
-                and a.plan_of_org_id in (select id from sys_org where path like concat( (select path from sys_org where
-                id =#{info.orgId}),'%'))
-            </if>
             <if test="info.roleList != null and info.roleList.size > 0">
                 and a.id in (select plan_id from core_resumption_plan_to_role where role_id in
                 <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">
@@ -97,29 +90,26 @@
                 </foreach>
                 )
             </if>
-            <!--            <if test="info.orgList != null and info.orgList.size > 0">-->
-            <!--                and a.id in (select plan_id from core_resumption_plan_to_exec_org where org_id in-->
-            <!--                (select id from sys_org-->
-            <!--                where path like concat((select path from sys_org where id=#{info.orgId}),'%')-->
-            <!--                )-->
-            <!--            </if>-->
-<!--            and a.id in (-->
-<!--            select if(plan_of_org_id=plan_create_org_id,id,parent_id ) as id from core_resumption_plan-->
-<!--            where 1=1-->
-<!--            <if test="info.checkSub==false">-->
-<!--                and plan_of_org_id=#{info.orgId}-->
-<!--            </if>-->
-<!--            <if test="info.checkSub==true">-->
-<!--                and plan_of_org_id in (select id from sys_org-->
-<!--                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))-->
-<!--            </if>-->
-<!--            )-->
-            <!--            <if test="info.ids!=null and info.ids.size > 0">-->
-            <!--                and a.plan_of_org_id in-->
-            <!--                <foreach collection="info.ids" item="orgId" index="index" open="(" separator="," close=")">-->
-            <!--                    #{orgId}-->
-            <!--                </foreach>-->
-            <!--            </if>-->
+            and a.id in (
+            select id from core_resumption_plan
+            where 1=1
+            <if test="info.checkSub==false">
+                and plan_of_org_id=#{info.orgId}
+            </if>
+            <if test="info.checkSub==true">
+                and plan_of_org_id in (select id from sys_org
+                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))
+            </if>
+            and parent_id not in (select id from core_resumption_plan
+            where 1=1
+            <if test="info.checkSub==false">
+                and plan_of_org_id=#{info.orgId}
+            </if>
+            <if test="info.checkSub==true">
+                and plan_of_org_id in (select id from sys_org
+                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))
+            </if>)
+            )
         </where>
     </select>
     <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"