package com.srs.stureg.mapper;

import com.srs.common.annotation.DataSource;
import com.srs.common.enums.DataSourceType;
import com.srs.comprehensive.domain.Vo.CphSearch;
import com.srs.comprehensive.domain.Vo.DataScreen;
import com.srs.framework.mybatisplusMapper.EasyBaseMapper;
import com.srs.stureg.domain.GxsdxySjzx009Temp2024xsxx;
import com.srs.stureg.domain.SrsStuReg;
import com.srs.stureg.domain.VO.TeacherVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

/**
 * 新生报到学生注册信息Mapper接口
 *
 * @author srs
 * @date 2023-07-24
 */
@Mapper
public interface SrsStuRegMapper extends EasyBaseMapper<SrsStuReg> {

    @DataSource(DataSourceType.SLAVE)
    public List<GxsdxySjzx009Temp2024xsxx> listXsxxTemp(GxsdxySjzx009Temp2024xsxx param);

    public List<Map<String,Object>> countRoomBed();

    public List<Map<String,Object>> countStuXb();


    public List<Map<String,Object>> listNewBaodao();


    public List<Map<String,Object>> countDeptBaodao();


    public List<DataScreen> countBaodao();

    @Select("select count(1) as `value`,XY as `name`\n" +
            "from srs_stu_reg as a\n" +
            "where a.reg_status in (1,3,4)\n" +
            "group by a.XY\n" +
            "order by `value` desc")
    public List<DataScreen> countDeptStuMoney();

    public List<Map<String,Object>> countCityStu();


    public List<SrsStuReg> listCanStu(SrsStuReg param);

    public List<Map<String,Object>> countDept();

    public List<DataScreen> countMajorTop10();

    public Map<String,Object> countNowAt();

    public List<DataScreen> countGender();

    public List<DataScreen> countArea();


    public List<SrsStuReg> listView(CphSearch param);

    public List<SrsStuReg> listFdyStu(CphSearch param);

    public List<SrsStuReg> selectIsExistKsh(String[] ksh);

    /**
     * 查询新生报到学生注册信息
     *
     * @param id 新生报到学生注册信息主键
     * @return 新生报到学生注册信息
     */
    public SrsStuReg selectSrsStuRegById(Long id);

    public SrsStuReg selectSrsStuRegByStuNo(String stuNo);


    public SrsStuReg getOwnInfoByKsh(String ksh);
    public TeacherVo getDmsClass(TeacherVo teacherVo);
    public List<TeacherVo> getDmsClassList(TeacherVo teacherVo);

    public int selectCountByRegStatus(String regStatus);


    /**
     * 查询新生报到学生注册信息列表
     *
     * @param srsStuReg 新生报到学生注册信息
     * @return 新生报到学生注册信息集合
     */
    public List<SrsStuReg> selectSrsStuRegList(SrsStuReg srsStuReg);

    /**
     * 新增新生报到学生注册信息
     *
     * @param srsStuReg 新生报到学生注册信息
     * @return 结果
     */
    public int insertSrsStuReg(SrsStuReg srsStuReg);

    /**
     * 修改新生报到学生注册信息
     *
     * @param srsStuReg 新生报到学生注册信息
     * @return 结果
     */
    public int updateSrsStuReg(SrsStuReg srsStuReg);

    public int updateSrsStuRegByKSH(SrsStuReg srsStuReg);


    /**
     * 删除新生报到学生注册信息
     *
     * @param id 新生报到学生注册信息主键
     * @return 结果
     */
    public int deleteSrsStuRegById(Long id);

    /**
     * 批量删除新生报到学生注册信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSrsStuRegByIdR(Long[] ids);

    //dbf导入动态拼接
    int insertData(@Param("tableName") String tableName, @Param("dataList") List<Map<String, Object>> dataList);

    //查询表是否存在
    Integer isTableExist(String tableName);

    void createTable(@Param("tableName") String tableName, @Param("tabList") Map<String, Object> tabList);

    //批量插入
    int insertAll(List<SrsStuReg> srsStuReg);

    int updateSrsStuRegList(@Param("srsStuReg") List<SrsStuReg> srsStuReg);

    //    @MapKey("COLUMN_NAME")
////指定键
//    Map<String, Object> selectDatabaseType(@Param("tableName") String tableName);
    @MapKey("COLUMN_NAME")
//指定存储键
    Map<String, Object> selectDatabaseType(@Param("tableName") String tableName);

    @MapKey("id")
    List<Map<String, Object>> selectTable(@Param("tableName") String tableName);//查询表

    int selectTableCount(@Param("tableName") String tableName);

    int updateMapListAll(@Param("dataList") List<Map<String, Object>> dataList, @Param("tableName") String tableName);

    @MapKey("id")
    List<Map<String, Object>> selectAll();

    @MapKey("id")
    List<Map<String, Object>> selectTJHK(@Param("dataList") List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> getStuRegWithList(@Param("dataList") List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTTDDW(@Param("dataList") List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTDKLDI(@Param("dataList") List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTTDD2020(@Param("dataList")List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTjhk2020(@Param("dataList")List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTzykmx2020(@Param("dataList")List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTDKLDM2020(@Param("dataList")List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTTDDW2020(@Param("dataList")List<Map<String, Object>> dataList);

    @MapKey("id")
    List<Map<String, Object>> selectTdzydh2020(@Param("dataList")List<Map<String, Object>> dataList);

    public int updateBathSrsStuRegs(@Param("list")List<SrsStuReg> srsStuRegs);
    public int insertBathStuRegs(@Param("list")List<SrsStuReg> srsStuRegs);
}
