package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.SubPreLog;
import com.ruoyi.system.domain.Tender;
import com.ruoyi.system.mapper.SubPreLogMapper;
import com.ruoyi.system.service.ISubPreLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 参数配置 服务层实现
 *
 * @author ruoyi
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class SubPreLogServiceImpl extends ServiceImpl<SubPreLogMapper, SubPreLog> implements ISubPreLogService
{
    @Autowired
    private SubPreLogMapper subPreLogMapper;
    public List<Tender> listS() {
        List lst= subPreLogMapper.selectList(new QueryWrapper<SubPreLog>());
        return lst;
    }

    @Override
    public SubPreLog findOne(LambdaQueryWrapper<SubPreLog> eq) {
        return subPreLogMapper.selectOne(eq);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void Save(SubPreLog vo) {
        subPreLogMapper.insert(vo);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean saveOrUpdate(SubPreLog entity) {
        return super.saveOrUpdate(entity);
    }

}
