package com.xunmei.core.resumption.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xunmei.common.core.vo.IdNameVo;
import com.xunmei.core.resumption.domain.AppPlan;
import com.xunmei.core.resumption.vo.appPlan.AppPlanVo;
import com.xunmei.core.resumption.vo.appPlan.ObjectDataClass;
import com.xunmei.core.resumption.vo.appPlan.RuleItemVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 履职，安全检查计划表(core_resumption_plan)数据Mapper
 *
 * @author 高雄
 * @since 2022-04-27 16:38:43
 * @description 由 Mybatisplus Code Generator 创建
*/
@Repository
@Mapper
public interface AppPlanMapper extends BaseMapper<AppPlan> {

    /**
     * 自定义分页查询
     * @param page
     * @param plan
     * @return
     */
    Page<AppPlan> selectPage(Page<AppPlan> page, @Param("info") AppPlanVo plan);

    /**
     *通过履职计划id获取履职任务执行机构
     * @param plan_id
     * @return
     */
    List<Long> findExecOrgByPlan(Long plan_id);
    /**
     * 获取检查要点分页查询
     * @param page
     * @param item
     * @return
     */
    Page<RuleItemVo> selectItemPage(Page<RuleItemVo> page, @Param("info")  RuleItemVo item);

    /**
     * 获取计划下的履职要点
     * @param id
     * @return List<com.isp.plan.vo.RuleItemVo>
     * @author 高雄
     * @time 2022/5/5 17:46
     */
    List<RuleItemVo> selectByPlanId(@Param("planId") Long id);

    List<Long> findRoleByPlan(Long plan_id);

    List<ObjectDataClass> selectPlanList(@Param("orgType") Integer orgType, @Param("execTime") Integer execTime, @Param("planCycle") Integer planCycle);

    AppPlan selectPlanByName(String planName);

    String selectPlanNameById(@Param("planId") Long planId);

    List<IdNameVo> selectPlanNames(@Param("ids") List<Long> ids);
}
