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

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.TVentilationOperation;
import com.unis.reserveLayout.modular.keepWork.mapper.TVentilationOperationMapper;
import com.unis.reserveLayout.modular.keepWork.param.TVentilationOperationPageParam;
import com.unis.reserveLayout.modular.keepWork.service.TVentilationOperationService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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 TVentilationOperationServiceImpl extends ServiceImpl<TVentilationOperationMapper, TVentilationOperation> implements TVentilationOperationService {
    @Resource
    private TVentilationOperationMapper tVentilationOperationMapper;

    @Override
    public Page<TVentilationOperation> getList(TVentilationOperationPageParam pageParam) {
        QueryWrapper<TVentilationOperation> wrapper = new QueryWrapper<>();
        wrapper.eq("tvo.org_id", pageParam.getOrgId());
        if (StringUtils.isNotEmpty(pageParam.getTfzydh())) {
            wrapper.like("tvo.tfzydh", pageParam.getTfzydh());
        }
        return tVentilationOperationMapper.selectPageList(new Page<>(pageParam.getCurrent(), pageParam.getSize()), wrapper);
    }

    @Override
    public TVentilationOperation getJoinById(String id) {
        return tVentilationOperationMapper.getJoinById(id);
    }
}
