package org.stm.audit.service.impl;

import org.stm.audit.entity.AuditProject;
import org.stm.audit.mapper.AuditProjectMapper;
import org.stm.audit.service.IAuditProjectService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Description: 项目
 * @Author: jeecg-boot
 * @Date:   2025-01-07
 * @Version: V1.0
 */
@Service
public class AuditProjectServiceImpl extends ServiceImpl<AuditProjectMapper, AuditProject> implements IAuditProjectService {

    @Override
    public List<Map<String,Object>> getProjectAllTask(String userid,Integer projectid){
        List<Map<String,Object>> list = this.baseMapper.getProjectAllTask(userid,projectid);
        List<Map<String,Object>> innerOrderList = this.baseMapper.getProjectAllTaskForInnerOrder(userid,projectid);
        if(list==null) list = new ArrayList<>();
        if(innerOrderList!=null&&innerOrderList.size()>0){
            list.addAll(innerOrderList);
        }
        return list;
    }

    @Override
    public List<Map<String,Object>> getProjectAllTaskForInnerOrder(String userid,Integer projectid){
        return this.baseMapper.getProjectAllTaskForInnerOrder(userid,projectid);
    }


}
