|  | @@ -10,29 +10,29 @@
 | 
	
		
			
				|  |  |          ,plan_name,plan_type,plan_cycle,plan_exec,exec_org_type,check_org_type,check_type,exec_type,plan_status,description,create_time,modified_name,update_time,modified_by
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    <resultMap id="appPlans" type="com.xunmei.core.resumption.domain.AppPlan">
 | 
	
		
			
				|  |  | +    <resultMap id="appPlans" type="com.xunmei.core.resumption.vo.appPlan.ResumptionPlanPageVo">
 | 
	
		
			
				|  |  |          <id column="id" property="id"/>
 | 
	
		
			
				|  |  |          <result column="plan_name" property="planName"/>
 | 
	
		
			
				|  |  |          <result column="plan_type" property="planType"/>
 | 
	
		
			
				|  |  |          <result column="plan_cycle" property="planCycle"/>
 | 
	
		
			
				|  |  |          <result column="plan_exec" property="planExec"/>
 | 
	
		
			
				|  |  |          <result column="exec_org_type" property="execOrgType"/>
 | 
	
		
			
				|  |  | -        <result column="check_org_type" property="checkOrgType"/>
 | 
	
		
			
				|  |  | -        <result column="check_type" property="checkType"/>
 | 
	
		
			
				|  |  | +        <!--        <result column="check_type" property="checkType"/>-->
 | 
	
		
			
				|  |  |          <result column="exec_type" property="execType"/>
 | 
	
		
			
				|  |  |          <result column="plan_status" property="planStatus"/>
 | 
	
		
			
				|  |  |          <result column="plan_status" property="planStatus"/>
 | 
	
		
			
				|  |  | -        <result column="description" property="description"/>
 | 
	
		
			
				|  |  | -        <result column="create_time" property="createTime"/>
 | 
	
		
			
				|  |  | -        <result column="modified_name" property="modifiedName"/>
 | 
	
		
			
				|  |  | -        <result column="update_time" property="updateTime"/>
 | 
	
		
			
				|  |  | -        <result column="modified_by" property="modifiedBy"/>
 | 
	
		
			
				|  |  | +        <!--        <result column="description" property="description"/>-->
 | 
	
		
			
				|  |  | +        <!--        <result column="create_time" property="createTime"/>-->
 | 
	
		
			
				|  |  | +        <!--        <result column="modified_name" property="modifiedName"/>-->
 | 
	
		
			
				|  |  | +        <!--        <result column="update_time" property="updateTime"/>-->
 | 
	
		
			
				|  |  | +        <!--        <result column="modified_by" property="modifiedBy"/>-->
 | 
	
		
			
				|  |  |          <result column="roleNames" property="roleNames"/>
 | 
	
		
			
				|  |  |          <result column="orgNames" property="orgNames"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    <select id="selectPage" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto" resultMap="appPlans">
 | 
	
		
			
				|  |  | +    <select id="selectPage" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"
 | 
	
		
			
				|  |  | +            resultMap="appPlans">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
		
			
				|  |  |          a.*,
 | 
	
		
			
				|  |  |          d.roleNames,
 | 
	
	
		
			
				|  | @@ -83,9 +83,13 @@
 | 
	
		
			
				|  |  |              <if test="info.orgType != null">
 | 
	
		
			
				|  |  |                  and a.exec_org_type = #{info.orgType}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | -            <if test="info.orgId != null">
 | 
	
		
			
				|  |  | +            <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=")">
 | 
	
	
		
			
				|  | @@ -93,29 +97,98 @@
 | 
	
		
			
				|  |  |                  </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 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>-->
 | 
	
		
			
				|  |  | -            and a.id in (
 | 
	
		
			
				|  |  | -                select if(parent_id=-1,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}
 | 
	
		
			
				|  |  | +<!--            <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>-->
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +    <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"
 | 
	
		
			
				|  |  | +            resultMap="appPlans">
 | 
	
		
			
				|  |  | +        SELECT
 | 
	
		
			
				|  |  | +        a.*,
 | 
	
		
			
				|  |  | +        d.roleNames,
 | 
	
		
			
				|  |  | +        b.orgId,
 | 
	
		
			
				|  |  | +        b.orgNames,
 | 
	
		
			
				|  |  | +        o.name as plan_of_org_name,
 | 
	
		
			
				|  |  | +        g.name as plan_create_org_name
 | 
	
		
			
				|  |  | +        FROM
 | 
	
		
			
				|  |  | +        core_resumption_plan a
 | 
	
		
			
				|  |  | +        LEFT JOIN (
 | 
	
		
			
				|  |  | +        SELECT
 | 
	
		
			
				|  |  | +        m.plan_id,
 | 
	
		
			
				|  |  | +        GROUP_CONCAT( n.`name` ) orgNames,
 | 
	
		
			
				|  |  | +        GROUP_CONCAT( n.id ) orgId
 | 
	
		
			
				|  |  | +        FROM
 | 
	
		
			
				|  |  | +        core_resumption_plan_to_exec_org m
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_org n ON m.org_id = n.id
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        GROUP BY
 | 
	
		
			
				|  |  | +        m.plan_id
 | 
	
		
			
				|  |  | +        ) b ON a.id = b.plan_id
 | 
	
		
			
				|  |  | +        LEFT JOIN (
 | 
	
		
			
				|  |  | +        SELECT
 | 
	
		
			
				|  |  | +        r.plan_id,
 | 
	
		
			
				|  |  | +        group_concat( t.`role_name` ) roleNames
 | 
	
		
			
				|  |  | +        FROM
 | 
	
		
			
				|  |  | +        core_resumption_plan_to_role r
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_role t ON r.role_id = t.id
 | 
	
		
			
				|  |  | +        GROUP BY
 | 
	
		
			
				|  |  | +        r.plan_id
 | 
	
		
			
				|  |  | +        ) d ON a.id = d.plan_id
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_org o ON a.plan_of_org_id = o.id
 | 
	
		
			
				|  |  | +        LEFT JOIN sys_org g ON a.plan_create_org_id = g.id
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            a.deleted=0
 | 
	
		
			
				|  |  | +            <if test="info.planName != '' and info.planName != null">
 | 
	
		
			
				|  |  | +                and a.plan_name LIKE CONCAT('%', #{info.planName}, '%' )
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="info.planStatus != null">
 | 
	
		
			
				|  |  | +                and a.plan_status = #{info.planStatus}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="info.planCycle != null">
 | 
	
		
			
				|  |  | +                and a.plan_cycle = #{info.planCycle}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="info.planExec != null">
 | 
	
		
			
				|  |  | +                and a.plan_exec = #{info.planExec}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="info.orgType != null">
 | 
	
		
			
				|  |  | +                and a.exec_org_type = #{info.orgType}
 | 
	
		
			
				|  |  | +            </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=")">
 | 
	
		
			
				|  |  | +                    #{roleId}
 | 
	
		
			
				|  |  |                  </foreach>
 | 
	
		
			
				|  |  | +                )
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | +            and a.parent_id in
 | 
	
		
			
				|  |  | +            <foreach collection="info.parentId" item="id" open="(" close=")" separator=",">
 | 
	
		
			
				|  |  | +                #{id}
 | 
	
		
			
				|  |  | +            </foreach>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="selectItemPage" parameterType="com.xunmei.core.resumption.vo.appPlan.RuleItemVo"
 | 
	
	
		
			
				|  | @@ -325,6 +398,5 @@
 | 
	
		
			
				|  |  |                  </foreach>
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  </mapper>
 |