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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xunmei.core.resumption.domain.AppResumptionData;
import com.xunmei.core.resumption.mapper.AppResumptionDataMapper;
import com.xunmei.core.resumption.service.AppResumptionDataService;
import com.xunmei.core.resumption.vo.ResumptionInfoVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

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

/**
 * 履职数据表服务接口实现
 *
 * @author oygj
 * @since 2022-05-05 17:35:14
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class AppResumptionDataServiceImpl extends ServiceImpl<AppResumptionDataMapper, AppResumptionData> implements AppResumptionDataService {

    @Override
    public List<Map<String, Object>> findTaskDataList(String taskid, Long areaid) {
        Map<String,Object> parmar = new HashMap<>();
        parmar.put("taskid",taskid);
        parmar.put("areaid",areaid);
        return baseMapper.findTaskDataList(parmar);
    }

    @Override
    public List<Map<String, Object>> findCheckDataList(String taskid, Long areaid,Long itemid) {
        Map<String,Object> parmar = new HashMap<>();
        parmar.put("taskid",taskid);
        parmar.put("areaid",areaid);
        parmar.put("itemid",itemid);

        return baseMapper.findCheckDataList(parmar);
    }

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

    @Override
    public List<Map<String, Object>> findTaskDataListNew(String taskid) {
        return baseMapper.findTaskDataListNew(taskid);
    }

    @Override
    public List<Map<String, Object>> findCheckDataListNew(String taskid) {
        return baseMapper.findCheckDataListNew(taskid);
    }

    @Override
    public List<ResumptionInfoVo> findDataByTaskId(String taskId) {
        return baseMapper.findDataByTaskId(taskId);
    }

    @Override
    public List<AppResumptionData> findDataByPointBusiness(Integer businessType, Date date,Long orgId) {
        Map<String,Object> parmar = new HashMap<>();
        parmar.put("businessType",businessType);
        parmar.put("date",date);
        parmar.put("orgId",orgId);

        return baseMapper.findDataByPointBusinessType(parmar);
    }

    @Override
    public void updateData(String taskId) {
        baseMapper.updateData(taskId);

    }
}