package com.srs.routine.mapper;

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

import com.srs.common.core.domain.entity.SysDept;
import com.srs.comprehensive.domain.SrsClass;
import com.srs.comprehensive.domain.SrsMajors;
import com.srs.routine.domain.RtClassMeetingClass;
import com.srs.routine.domain.RtClassMettingTheme;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.srs.routine.domain.vo.ClassMettingThemeSumitListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 班会主题Mapper接口
 *
 * @author deng
 * @date 2024-05-18
 */
@Mapper
public interface RtClassMettingThemeMapper extends BaseMapper<RtClassMettingTheme> {


    public List<Map<String, Object>> selectClassFile(String cmNo);

    public List<ClassMettingThemeSumitListVo> selectSubmit(RtClassMeetingClass dto);

    public List<Map<String, Object>> listClassCmNo(RtClassMeetingClass dto);

    @Select("select a.*\n" +
            "from srs_class as a\n" +
            "left join cph_teacher as b on a.teacher_id = b.teacher_id\n" +
            "left join srs_grade as c on a.grade_id = c.grade_id\n" +
            "where c.grade_status in (1,3) and b.employee_id = #{tNo}")
    public List<SrsClass> listClassByTNo(String tNo);


    public List<Map<String, Object>> listClassByMajorId(RtClassMettingTheme params);


    @Select("select a.old_dept_id as dept_id , b.dept_name\n" +
            "from sys_dept_map as a\n" +
            "left join sys_dept as b on a.old_dept_id = b.dept_id")
    public List<SysDept> listDept();


    /**
     * 查询班会主题
     *
     * @param cmId 班会主题主键
     * @return 班会主题
     */
    public RtClassMettingTheme selectRtClassMettingThemeByCmId(Long cmId);

    /**
     * 查询班会主题列表
     *
     * @param rtClassMettingTheme 班会主题
     * @return 班会主题集合
     */
    List<RtClassMettingTheme> selectRtClassMettingThemeList(RtClassMettingTheme rtClassMettingTheme);

    List<RtClassMettingTheme> completeStuList(RtClassMettingTheme rtClassMettingTheme);

    /**
     * 查询老师班会主题列表是否完成
     * @param rtClassMettingTheme
     * @return
     */
    List<RtClassMettingTheme> selectCurrentThemeComplateList(RtClassMettingTheme rtClassMettingTheme);

    /**
     * 新增班会主题
     *
     * @param rtClassMettingTheme 班会主题
     * @return 结果
     */
    int insertRtClassMettingTheme(RtClassMettingTheme rtClassMettingTheme);

    /**
     * 修改班会主题
     *
     * @param rtClassMettingTheme 班会主题
     * @return 结果
     */
    int updateRtClassMettingTheme(RtClassMettingTheme rtClassMettingTheme);

    /**
     * 删除班会主题
     *
     * @param cmId 班会主题主键
     * @return 结果
     */
    int deleteRtClassMettingThemeByCmId(Long cmId);

    /**
     * 批量删除班会主题
     *
     * @param cmIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteRtClassMettingThemeByCmIds(Long[] cmIds);
}
