package com.srs.comprehensive.service.impl;

import com.srs.common.annotation.DataSource;
import com.srs.common.enums.DataSourceType;
import com.srs.comprehensive.domain.Dto.CphClassTbsj;
import com.srs.comprehensive.domain.Dto.PageDto;
import com.srs.comprehensive.mapper.CphSqlServerDataMapper;
import com.srs.comprehensive.service.CphSqlServerDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public  class CphSqlServerDataServiceImpl implements CphSqlServerDataService {

    @Autowired
    CphSqlServerDataMapper sqlServerDataMapper;

    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getStudentInfoList(int page, int pageSize,String stuNo) {
        return sqlServerDataMapper.getStudentInfoList(page,pageSize,stuNo);
    }

    //统计学生数量
    @Override
    @DataSource(DataSourceType.DATABASE)
    public int getStudentInfoNumber() {
        return sqlServerDataMapper.selectNumber();
    }

    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getClassInfoListPage(PageDto param) {
        param.pageNum=(param.pageNum-1)*param.pageSize;
        return sqlServerDataMapper.getClassInfoListPage(param);
    }

    //班级数据
    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getClassInfoList() {
        return sqlServerDataMapper.getClassInfoList();
    }

    //通过班级代码查询
    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<CphClassTbsj> getClassInfodm(String bjdm){return sqlServerDataMapper.getClassInfodm(bjdm);};

    //年级
    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getGradeInfoList() {
        return sqlServerDataMapper.getGradeInfoList();
    }

    @Override
    @DataSource(DataSourceType.DATABASE)
    public String gets(Long njid) {
        return sqlServerDataMapper.getnjid(njid);
    }


    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getSpecialtyInfoListPage(PageDto param) {
        param.pageNum=(param.pageNum-1)*param.pageSize;
        return sqlServerDataMapper.getSpecialtyInfoListPage(param);
    }
    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getSpecialtyzydm(String zydm){return  sqlServerDataMapper.getSpecialtyzydm(zydm);}
    //专业
    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getSpecialtyInfoList() {
        return sqlServerDataMapper.getSpecialtyInfoList();
    }

    //班级邦辅导员
    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getBZRClassInfoList() {
        return sqlServerDataMapper.getBZRClassInfoList();
    }

    @Override
    @DataSource(DataSourceType.DATABASE)
    public List<Map> getEmployEEInfoList() {
        return sqlServerDataMapper.getEmployEEInfoList();
    }


    @Override
    @DataSource(DataSourceType.DATABASE)
    public String getfdy(String bjdm) {
        return sqlServerDataMapper.selectClassBZR(bjdm);
    }

    @Override
    @DataSource(DataSourceType.DATABASE)
    public String getzydm(Long zyid) {
        return sqlServerDataMapper.getzydm(zyid);
    }
}
