package com.srs.comprehensive.mapper;

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

import com.srs.comprehensive.domain.CphGoodApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.srs.comprehensive.domain.CphTerm;
import com.srs.comprehensive.domain.Vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.MapKey;

/**
 * 评优申请Mapper接口
 *
 * @author srs
 * @date 2023-09-12
 */
public interface CphGoodApplyMapper extends BaseMapper<CphGoodApply> {



    public List<CphBiyeApplyVo> countBiyeYearDept();


    public List<String> countJwcUnDo();
    public List<String> countXwUnDo(Long id);
    public List<String> countFdyUnDo(String tNo);

    public List<String> countStuUnDo(String stuNo);

    public List<String> countSjUnDo(Long id);

    public CphGoodApplyVo lookDetail(Long id);

    public List<CphGoodAuditFdyVo> listFdyAudit(CphSearch param);

    public List<CphGoodAuditFdyVo> listXwAudit(CphSearch param);

    public List<CphGoodApplyVo> importXyjxj(CphSearch param);

    public List<CphGoodApplyVo> importShxs(CphSearch param);

    public List<CphGoodApplyVo> importYxbg(CphSearch param);


    public List<CphGoodTypeCode> listXyjxjCanType();

    public List<CphTerm> listTermByYear(Long id);

    public List<CphGoodApplyVo> listOwnXyjxjApply(String stuNo);

    public List<CphClassRankScore> listOwnScoreClassRank(String stuNo);

    /**
     * 获取某学生指定学年的班级排名,是由前端查询的学年标签对应的学年
     * @param stuNo
     * @param tag
     * @return
     */
    public List<CphClassRankScore> listOwnScoreClassRankByTag(@Param("stuNo") String stuNo,@Param("tag") String tag);

    public List<CphCourseNameScore> listOwnYearCourseScore(String stuNo);

    public List<CphCoursePassCount> countOwnPass(String stuNo);

    public List<CphIamSitCount> countOwnIam(String stuNo);

    public CphCoursePassCount getOwnPassCountByCode(@Param("stuNo")String stuNo,@Param("code") String code);

    public CphIamSitCount getOwnIamCountByCode(@Param("stuNo")String stuNo,@Param("code") String code);

    public CphClassRankScore getOwnRankByCode(CphSearch param);



    /**
     * 查询评优申请
     *
     * @param id 评优申请主键
     * @return 评优申请
     */
    public CphGoodApply selectCphGoodApplyById(Long id);


    public List<CphGoodApply> selectByOnlyCodeStuNo(@Param("code") String code,@Param("stuNo")String stuNo);


    /**
     * 查询评优申请列表
     *
     * @param cphGoodApply 评优申请
     * @return 评优申请集合
     */
    List<CphGoodApply> selectCphGoodApplyList(CphGoodApply cphGoodApply);

    /**
     * 新增评优申请
     *
     * @param cphGoodApply 评优申请
     * @return 结果
     */
    int insertCphGoodApply(CphGoodApply cphGoodApply);

    /**
     * 修改评优申请
     *
     * @param cphGoodApply 评优申请
     * @return 结果
     */
    int updateCphGoodApply(CphGoodApply cphGoodApply);

    /**
     * 删除评优申请
     *
     * @param id 评优申请主键
     * @return 结果
     */
    int deleteCphGoodApplyById(Long id);

    /**
     * 批量删除评优申请
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteCphGoodApplyByIds(Long[] ids);

    @MapKey("id")
    List<Map<String,Object>> getGrades(CphGoodApply cphGoodApply);

    List<ApplyYxgbVo> getMyApply(@Param("username") String username);
}
