package com.srs.stureg.service.impl;

import java.util.List;

import com.srs.stureg.domain.SrsStuReg;
import com.srs.stureg.service.ISrsStuRegService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.srs.stureg.mapper.SrsDormSelectMapper;
import com.srs.stureg.domain.SrsDormSelect;
import com.srs.stureg.service.ISrsDormSelectService;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author srs
 * @date 2023-07-24
 */
@Service
public class SrsDormSelectServiceImpl implements ISrsDormSelectService 
{
    @Autowired
    private SrsDormSelectMapper srsDormSelectMapper;
    @Autowired
    private ISrsStuRegService srsStuRegService;

    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public SrsDormSelect selectSrsDormSelectById(Long id)
    {
        return srsDormSelectMapper.selectSrsDormSelectById(id);
    }

    /**
     * 根据登录账号查询可选的宿舍
     */
    @Override
    public  List<SrsDormSelect> selectSrsDormSelectBystuNo(String stuNo){
        SrsStuReg srsStuReg = srsStuRegService.selectSrsStuRegByStuNo(stuNo);
        SrsDormSelect srsDormSelect = new SrsDormSelect();
        srsDormSelect.setClassCode(srsStuReg.getBJDM());
        return srsDormSelectMapper.selectSrsDormSelectList(srsDormSelect);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param srsDormSelect 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<SrsDormSelect> selectSrsDormSelectList(SrsDormSelect srsDormSelect)
    {
        return srsDormSelectMapper.selectSrsDormSelectList(srsDormSelect);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param srsDormSelect 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertSrsDormSelect(SrsDormSelect srsDormSelect)
    {
        return srsDormSelectMapper.insertSrsDormSelect(srsDormSelect);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param srsDormSelect 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateSrsDormSelect(SrsDormSelect srsDormSelect)
    {
        return srsDormSelectMapper.updateSrsDormSelect(srsDormSelect);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteSrsDormSelectByIds(Long[] ids)
    {
        return srsDormSelectMapper.deleteSrsDormSelectByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteSrsDormSelectById(Long id)
    {
        return srsDormSelectMapper.deleteSrsDormSelectById(id);
    }
}
