|  | @@ -2,7 +2,7 @@
 | 
	
		
			
				|  |  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
	
		
			
				|  |  |  <mapper namespace="com.xunmei.resumption.mapper.AppPlanMapper">
 | 
	
		
			
				|  |  |      <sql id="tableName">
 | 
	
		
			
				|  |  | -        t_app_plan
 | 
	
		
			
				|  |  | +        sys_plan
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <sql id="baseColumn">
 | 
	
	
		
			
				|  | @@ -38,14 +38,14 @@
 | 
	
		
			
				|  |  |          b.orgId,
 | 
	
		
			
				|  |  |          b.orgNames
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  | -        t_app_plan a
 | 
	
		
			
				|  |  | +        sys_plan a
 | 
	
		
			
				|  |  |          LEFT JOIN (
 | 
	
		
			
				|  |  |          SELECT
 | 
	
		
			
				|  |  |          m.plan_id,
 | 
	
		
			
				|  |  |          GROUP_CONCAT( n.`name` ) orgNames,
 | 
	
		
			
				|  |  |          GROUP_CONCAT( n.id ) orgId
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  | -        t_app_plan_to_exec_org m
 | 
	
		
			
				|  |  | +        sys_plan_to_exec_org m
 | 
	
		
			
				|  |  |          LEFT JOIN t_org n ON m.org_id = n.id
 | 
	
		
			
				|  |  |          GROUP BY
 | 
	
		
			
				|  |  |          m.plan_id
 | 
	
	
		
			
				|  | @@ -55,7 +55,7 @@
 | 
	
		
			
				|  |  |          r.plan_id,
 | 
	
		
			
				|  |  |          group_concat( t.`name` ) roleNames
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  | -        t_app_plan_to_role r
 | 
	
		
			
				|  |  | +        sys_plan_to_role r
 | 
	
		
			
				|  |  |          LEFT JOIN t_role t ON r.role_id = t.id
 | 
	
		
			
				|  |  |          GROUP BY
 | 
	
		
			
				|  |  |          r.plan_id
 | 
	
	
		
			
				|  | @@ -78,14 +78,14 @@
 | 
	
		
			
				|  |  |                  and a.exec_org_type = #{info.orgType}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="info.roleList != null and info.roleList.size > 0">
 | 
	
		
			
				|  |  | -                and a.id in (select plan_id from t_app_plan_to_role where role_id in
 | 
	
		
			
				|  |  | +                and a.id in (select plan_id from sys_plan_to_role where role_id in
 | 
	
		
			
				|  |  |                  <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">
 | 
	
		
			
				|  |  |                      #{roleId}
 | 
	
		
			
				|  |  |                  </foreach>
 | 
	
		
			
				|  |  |                  )
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="info.orgList != null and info.orgList.size > 0">
 | 
	
		
			
				|  |  | -                and a.id in (select plan_id from t_app_plan_to_exec_org where org_id in
 | 
	
		
			
				|  |  | +                and a.id in (select plan_id from sys_plan_to_exec_org where org_id in
 | 
	
		
			
				|  |  |                  <foreach collection="info.orgList" item="orgId" index="index" open="(" separator="," close=")">
 | 
	
		
			
				|  |  |                      #{orgId}
 | 
	
		
			
				|  |  |                  </foreach>
 | 
	
	
		
			
				|  | @@ -109,10 +109,10 @@
 | 
	
		
			
				|  |  |          d.id as ruleId,
 | 
	
		
			
				|  |  |          d.rule_name as ruleName,
 | 
	
		
			
				|  |  |          a.business_type as businessType
 | 
	
		
			
				|  |  | -        from t_app_rule_point a
 | 
	
		
			
				|  |  | -        inner JOIN t_app_rule_item b on a.item_id = b.id
 | 
	
		
			
				|  |  | +        from sys_rule_point a
 | 
	
		
			
				|  |  | +        inner JOIN sys_rule_item b on a.item_id = b.id
 | 
	
		
			
				|  |  |          inner JOIN t_area c on a.area_id = c.id
 | 
	
		
			
				|  |  | -        inner JOIN t_app_rule d on b.rule_id = d.id
 | 
	
		
			
				|  |  | +        inner JOIN sys_rule d on b.rule_id = d.id
 | 
	
		
			
				|  |  |          where 1=1
 | 
	
		
			
				|  |  |          <if test="info.ruleId != null">
 | 
	
		
			
				|  |  |              and a.rule_id = #{info.ruleId}
 | 
	
	
		
			
				|  | @@ -138,29 +138,29 @@
 | 
	
		
			
				|  |  |                 h.required,
 | 
	
		
			
				|  |  |                 d.rule_name     as ruleName,
 | 
	
		
			
				|  |  |                 a.business_type as businessType
 | 
	
		
			
				|  |  | -        FROM (SELECT item_id, point_scan, required FROM t_app_plan_to_item WHERE plan_id = #{planId}) h
 | 
	
		
			
				|  |  | -                 LEFT JOIN t_app_rule_point a ON h.item_id = a.id
 | 
	
		
			
				|  |  | -                 LEFT JOIN t_app_rule_item b ON a.item_id = b.id
 | 
	
		
			
				|  |  | +        FROM (SELECT item_id, point_scan, required FROM sys_plan_to_item WHERE plan_id = #{planId}) h
 | 
	
		
			
				|  |  | +                 LEFT JOIN sys_rule_point a ON h.item_id = a.id
 | 
	
		
			
				|  |  | +                 LEFT JOIN sys_rule_item b ON a.item_id = b.id
 | 
	
		
			
				|  |  |                   LEFT JOIN t_area c ON a.area_id = c.id
 | 
	
		
			
				|  |  | -                 LEFT JOIN t_app_rule d on b.rule_id = d.id
 | 
	
		
			
				|  |  | +                 LEFT JOIN sys_rule d on b.rule_id = d.id
 | 
	
		
			
				|  |  |          order by b.item_num, a.point_num
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="findExecOrgByPlan" parameterType="Long" resultType="Long">
 | 
	
		
			
				|  |  |          select org_id
 | 
	
		
			
				|  |  | -        from t_app_plan_to_exec_org a
 | 
	
		
			
				|  |  | +        from sys_plan_to_exec_org a
 | 
	
		
			
				|  |  |          INNER JOIN t_org o on a.org_id=o.id and o.deleted=0 and o.is_lock=0 and o.temporarily_closed=0
 | 
	
		
			
				|  |  |          where a.plan_id = #{plan_id}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="findRoleByPlan" parameterType="Long" resultType="Long">
 | 
	
		
			
				|  |  |          select role_id
 | 
	
		
			
				|  |  | -        from t_app_plan_to_role a
 | 
	
		
			
				|  |  | +        from sys_plan_to_role a
 | 
	
		
			
				|  |  |          where a.plan_id = #{plan_id}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectPlanList" resultType="com.xunmei.resumption.vo.appPlan.ObjectDataClass">
 | 
	
		
			
				|  |  |          select id as id, plan_name as name
 | 
	
		
			
				|  |  | -        from t_app_plan
 | 
	
		
			
				|  |  | +        from sys_plan
 | 
	
		
			
				|  |  |          where plan_status = 0 and exec_type = 0
 | 
	
		
			
				|  |  |          <if test="orgType != null">
 | 
	
		
			
				|  |  |              and exec_org_type = #{orgType}
 | 
	
	
		
			
				|  | @@ -176,7 +176,7 @@
 | 
	
		
			
				|  |  |          8.30以后不再需要此类计划
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          (select id, plan_name as name
 | 
	
		
			
				|  |  | -        from t_app_plan
 | 
	
		
			
				|  |  | +        from sys_plan
 | 
	
		
			
				|  |  |          where plan_status = 0 and exec_type = 0
 | 
	
		
			
				|  |  |          <if test="orgType != null">
 | 
	
		
			
				|  |  |              and exec_org_type = #{orgType}
 | 
	
	
		
			
				|  | @@ -189,9 +189,9 @@
 | 
	
		
			
				|  |  |          UNION ALL
 | 
	
		
			
				|  |  |          (SELECT p.id,
 | 
	
		
			
				|  |  |          p.plan_name as name
 | 
	
		
			
				|  |  | -        FROM t_app_plan_to_exec_org tapo
 | 
	
		
			
				|  |  | +        FROM sys_plan_to_exec_org tapo
 | 
	
		
			
				|  |  |          INNER JOIN t_org o ON tapo.org_id = o.id
 | 
	
		
			
				|  |  | -        INNER JOIN t_app_plan p ON tapo.plan_id = p.id
 | 
	
		
			
				|  |  | +        INNER JOIN sys_plan p ON tapo.plan_id = p.id
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          where p.plan_status = 0
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -206,11 +206,11 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectPlanByName" resultMap="appPlans">
 | 
	
		
			
				|  |  |          select *
 | 
	
		
			
				|  |  | -        from t_app_plan
 | 
	
		
			
				|  |  | +        from sys_plan
 | 
	
		
			
				|  |  |          where plan_name like CONCAT('%', #{planName}, '%')
 | 
	
		
			
				|  |  |          limit 1
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="selectPlanNameById" resultType="java.lang.String">
 | 
	
		
			
				|  |  | -        select plan_name from t_app_plan where id = #{planId}
 | 
	
		
			
				|  |  | +        select plan_name from sys_plan where id = #{planId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  </mapper>
 |