package com.jiayue.insu.inclientqn.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiayue.insu.inclientqn.entity.BJZYYJYSDCorrfore;
import com.jiayue.insu.inclientqn.entity.SHKJLNCorrfore;
import com.jiayue.insu.inclientqn.mapper.BJZYYJYSDCorrforeMapper;
import com.jiayue.insu.inclientqn.mapper.SHKJLNCorrforeMapper;
import com.jiayue.insu.inclientqn.service.BJZYYJYSDCorrforeService;
import com.jiayue.insu.inclientqn.service.SHKJLNCorrforeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 修正数据业务实现(飔合科技（辽宁）)
 *
 * @author yh
 * @version 1.0
 * @since 2022/5/22 11:29
 */
@Service
@Slf4j
public class SHKJLNCorrforeServiceImpl extends ServiceImpl<SHKJLNCorrforeMapper, SHKJLNCorrfore> implements SHKJLNCorrforeService {


    @Override
    public boolean updateBetweenForecastTime(LocalDateTime statTime, LocalDateTime endTime, List<SHKJLNCorrfore> list) {

        try {
            LambdaQueryWrapper<SHKJLNCorrfore> remove = new LambdaQueryWrapper<>();
            remove.between(SHKJLNCorrfore::getTimeFormat,statTime,endTime);
            this.remove(remove);
            this.saveBatch(list);
            log.info("========== 数据入库成功");
        }catch (Exception e){
            e.printStackTrace();
        }
        return Boolean.TRUE;

    }
}
