package com.muyu.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.system.domain.SysFirmDatasource;
import com.muyu.system.mapper.SysFirmDatasourceMapper;
import com.muyu.system.service.SysDeptService;
import com.muyu.system.service.SysFirmDatasourceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author WangXin
 * @Data 2024/10/2
 * @Description
 * @Version 1.0.0
 */
@Service
public class SysFirmDatasourceServiceImpl
        extends ServiceImpl<SysFirmDatasourceMapper, SysFirmDatasource>
        implements SysFirmDatasourceService {

    @Resource
    private SysDeptService sysDeptService;


    /**
     * saas数据源
     * @return 公司数据源
     */
    @Override
    public List<SysFirmDatasource> firmDatasourceList() {
        LambdaQueryWrapper<SysFirmDatasource> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.ne(SysFirmDatasource::getDatabaseName,"-");
        return this.list(lambdaQueryWrapper);
    }
}
