package com.unis.reserveLayout.modular.keepWork.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.unis.reserveLayout.modular.keepWork.entity.TFumigationTask;
import com.unis.reserveLayout.modular.keepWork.mapper.TFumigationTaskMapper;
import com.unis.reserveLayout.modular.keepWork.param.TFumigationTaskPageParam;
import com.unis.reserveLayout.modular.keepWork.service.TFumigationTaskService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 熏蒸作业 服务实现类
 * </p>
 *
 * @author root
 * @since 2024-05-10
 */
@Service
public class TFumigationTaskServiceImpl extends ServiceImpl<TFumigationTaskMapper, TFumigationTask> implements TFumigationTaskService {
    @Resource
    private TFumigationTaskMapper tFumigationTaskMapper;

    @Override
    public Page<TFumigationTask> getList(TFumigationTaskPageParam pageParam) {
        LambdaQueryWrapper<TFumigationTask> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(TFumigationTask::getOrgId, pageParam.getOrgId());
        if (StringUtils.isNotEmpty(pageParam.getOrderNumber())) {
            wrapper.like(TFumigationTask::getOrderNumber, pageParam.getOrderNumber());
        }
        return tFumigationTaskMapper.selectPage(new Page<>(pageParam.getCurrent(), pageParam.getSize()), wrapper);
    }
}
