Search in sources :

Example 1 with Scoreline

use of shu.java.csky.entity.Scoreline in project CSKY by SHU-Silence.

the class ScoreLineServiceImpl method getScorelineBySid.

@Override
public ResultVO getScorelineBySid(Integer sid) {
    QueryWrapper<Scoreline> wrapper = new QueryWrapper<>();
    wrapper.eq("school_id", sid).orderByDesc("score_21").orderByDesc("score_20").orderByDesc("score_19");
    String sname = schoolMapper.selectById(sid).getSname();
    List<Scoreline> scorelines = scorelineMapper.selectList(wrapper);
    ArrayList<ScorelineVo> scorelineVos = new ArrayList<>();
    for (Scoreline scoreline : scorelines) {
        ScorelineVo scorelineVo = new ScorelineVo();
        BeanUtils.copyProperties(scoreline, scorelineVo);
        scorelineVo.setSname(sname);
        scorelineVos.add(scorelineVo);
    }
    return new ResultVO(ResStatus.OK, "由sid查询学校分数线成功", scorelineVos);
}
Also used : ResultVO(shu.java.csky.vo.ResultVO) Scoreline(shu.java.csky.entity.Scoreline) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) ScorelineVo(shu.java.csky.vo.ScorelineVo) ArrayList(java.util.ArrayList)

Example 2 with Scoreline

use of shu.java.csky.entity.Scoreline in project CSKY by SHU-Silence.

the class ScoreLineServiceImpl method getScorelinePage.

@Override
public ResultVO getScorelinePage(Page<Scoreline> scorelineIPage) {
    QueryWrapper<Scoreline> wrapper = new QueryWrapper<>();
    wrapper.orderByDesc("score_21").orderByDesc("score_20").orderByDesc("score_19");
    scorelineMapper.selectPage(scorelineIPage, wrapper);
    ScorelinePageVo scorelinePageVo = new ScorelinePageVo();
    BeanUtils.copyProperties(scorelineIPage, scorelinePageVo);
    List<Scoreline> records = scorelineIPage.getRecords();
    ArrayList<ScorelineVo> scorelineVos = new ArrayList<>();
    for (Scoreline record : records) {
        ScorelineVo scorelineVo = new ScorelineVo();
        BeanUtils.copyProperties(record, scorelineVo);
        School school = schoolMapper.selectById(record.getSchoolId());
        scorelineVo.setSname(school.getSname());
        scorelineVos.add(scorelineVo);
    }
    scorelinePageVo.setScorelineVoList(scorelineVos);
    return new ResultVO(ResStatus.OK, "分数线分页信息查询成功", scorelinePageVo);
}
Also used : ResultVO(shu.java.csky.vo.ResultVO) School(shu.java.csky.entity.School) ScorelinePageVo(shu.java.csky.vo.page.ScorelinePageVo) Scoreline(shu.java.csky.entity.Scoreline) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) ScorelineVo(shu.java.csky.vo.ScorelineVo) ArrayList(java.util.ArrayList)

Aggregations

QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)2 ArrayList (java.util.ArrayList)2 Scoreline (shu.java.csky.entity.Scoreline)2 ResultVO (shu.java.csky.vo.ResultVO)2 ScorelineVo (shu.java.csky.vo.ScorelineVo)2 School (shu.java.csky.entity.School)1 ScorelinePageVo (shu.java.csky.vo.page.ScorelinePageVo)1