package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.domain.Tender;
import com.ruoyi.system.domain.TenderLog;
import com.ruoyi.system.mapper.TenderLogMapper;
import com.ruoyi.system.mapper.TenderMapper;
import com.ruoyi.system.service.ITenderLogService;
import com.ruoyi.system.service.ITenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * 参数配置 服务层实现
 *
 * @author ruoyi
 */
@Service
/*@DataSource(value = DataSourceType.SLAVE)*/
public class TenderLogServiceImpl extends ServiceImpl<TenderLogMapper, TenderLog> implements ITenderLogService {
    @Autowired
    private TenderLogMapper tenderLogMapper;

    @Override
    public List<TenderLog> listTask() {
        return tenderLogMapper.selectList(new LambdaQueryWrapper<TenderLog>().eq(TenderLog::getIsHandle, "1").or().isNull(TenderLog::getIsHandle));
    }

    @Override
    @DataSource(value = DataSourceType.SLAVE)
    public boolean saveOrUpdateSlave(TenderLog entity) {
        boolean b = super.saveOrUpdate(entity);
        return b;
    }

}
