package com.xunmei.core.resumption.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xunmei.core.resumption.domain.AppRulePoint;
import com.xunmei.core.resumption.mapper.AppRulePointMapper;
import com.xunmei.core.resumption.service.IAppRulePointService;
import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
import com.xunmei.core.resumption.vo.ResumptionPointVo;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jingyuanchao
 * @since 2022-04-27
 */
@Service
public class AppRulePointServiceImpl extends ServiceImpl<AppRulePointMapper, AppRulePoint> implements IAppRulePointService {

    @Override
    public List<AppRulePointTaskVo> findPointByPlan(Long planid) {
        return baseMapper.findPointByPlan(planid);
    }

    @Override
    public List<Map<String, Object>> findAreaListPlan(Long planid) {
         return baseMapper.findAreaListPlan(planid);
    }

    @Override
    public Map<String, Object> findByName(String name,Long ruleId) {
        Map<String,Object> param = new HashMap<>();
        param.put("name",name);
        param.put("ruleId",ruleId);
         return baseMapper.findByName(param);
    }

//    @Override
//    public List<PointVo> findPointBySafetyPlan(Long planId,String taskId,int type) {
//        Map<String,Object> param = new HashMap<>();
//        param.put("taskId",taskId);
//        param.put("planId",planId);
//        param.put("type",type);
//        if(type==0){
//            return baseMapper.findPointBySafetyPlan(param);
//        }else{
//            return baseMapper.findPointBySafetyPlanb(param);
//        }
//
//    }
//
    @Override
    public List<ResumptionPointVo> findPointByRulePlan(Long planId) {
        return baseMapper.findPointByRulePlan(planId);
    }

}
