Commit c1be1ad5 by xuwenhao

8.3新增选课功能

parent a631a3c5
...@@ -30,6 +30,16 @@ public class CurriCulaVariableController extends BaseController { ...@@ -30,6 +30,16 @@ public class CurriCulaVariableController extends BaseController {
} }
/** /**
* 获取选课任务详细信息
* @param id
* @return
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id){
return AjaxResult.success(curriculaVariableService.selectCurriculaVariableById(id));
}
/**
* 新增选课任务 * 新增选课任务
* @param curriculaVariable * @param curriculaVariable
* @return * @return
...@@ -38,4 +48,23 @@ public class CurriCulaVariableController extends BaseController { ...@@ -38,4 +48,23 @@ public class CurriCulaVariableController extends BaseController {
public AjaxResult add(@RequestBody CurriculaVariable curriculaVariable){ public AjaxResult add(@RequestBody CurriculaVariable curriculaVariable){
return toAjax(curriculaVariableService.insertCurriculaVariable(curriculaVariable)); return toAjax(curriculaVariableService.insertCurriculaVariable(curriculaVariable));
} }
}
/**
* 修改选课任务
* @param curriculaVariable
* @return
*/
@PostMapping("/edit")
public AjaxResult edit(@RequestBody CurriculaVariable curriculaVariable){
return toAjax(curriculaVariableService.updateById(curriculaVariable));
}
/**
* 获取当前最新级部
* @return
*/
@GetMapping("/getNewGrade")
public AjaxResult getNewGrade(){
return AjaxResult.success(curriculaVariableService.getNewGrade());
}
}
\ No newline at end of file
package yangtz.cs.liu.campus.controller.curricula;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 学生选课情况
*/
@RestController
@RequestMapping("/curricula/student")
public class CurriculaStudentController extends BaseController {
@Autowired
private ICurriculaStudentService curriculaStudentService;
/**
* 查看选课情况列表
* @param curriculaStudentVo
* @return
*/
@GetMapping("/list")
public TableDataInfo list(CurriculaStudentVo curriculaStudentVo){
startPage();
return getDataTable(curriculaStudentService.selectCurriculaStudentList(curriculaStudentVo));
}
/**
* 导出选课情况列表
*/
@Log(title = "选课情况", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CurriculaStudentVo curriculaStudentVo)
{
List<CurriculaStudentVo> list = curriculaStudentService.selectCurriculaStudentList(curriculaStudentVo);
list.forEach(curriculaStudentVo1 -> {
if (null != curriculaStudentVo1.getSelectedMajor() && "".equals(curriculaStudentVo1.getSelectedMajor())){
String[] split = curriculaStudentVo1.getSelectedMajor().split(",");
String selectedMajorName = "";
for (int i=0;i<split.length;i++) {
if (i == split.length - 1){
selectedMajorName += curriculaStudentService.selectZyZd(split[i]) + ",";
}else {
selectedMajorName += curriculaStudentService.selectZyZd(split[i]);
}
}
curriculaStudentVo1.setSelectedMajorName(selectedMajorName);
}
});
ExcelUtil<CurriculaStudentVo> util = new ExcelUtil<CurriculaStudentVo>(CurriculaStudentVo.class);
util.exportExcel(response, list, "选课情况数据");
}
}
package yangtz.cs.liu.campus.controller.curricula;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.service.curricula.IStudentScoreService;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 选课-学生成绩管理
*/
@RestController
@RequestMapping("/curricula/studentScore")
public class StudentScoreController extends BaseController {
@Autowired
private IStudentScoreService studentScoreService;
@GetMapping("/list")
public TableDataInfo list(SchoolStudentScoreVo schoolStudentScoreVo){
startPage();
return getDataTable(studentScoreService.selectStudentScoreList(schoolStudentScoreVo));
}
/**
* 下载模板
*
* @return
*/
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<SchoolStudentScoreVo> util = new ExcelUtil<>(SchoolStudentScoreVo.class);
util.importTemplateExcel(response, "学生成绩表");
}
/**
* 导入
*
* @param file
* @return
* @throws Exception
*/
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception {
ExcelUtil<SchoolStudentScoreVo> util = new ExcelUtil<SchoolStudentScoreVo>(SchoolStudentScoreVo.class);
List<SchoolStudentScoreVo> list = util.importExcel(file.getInputStream());
//校验
studentScoreService.checkImport(list);
//导入
String message = studentScoreService.importExamDetail(list);
return AjaxResult.success(message);
}
}
...@@ -24,8 +24,12 @@ public class CurriculaStudent { ...@@ -24,8 +24,12 @@ public class CurriculaStudent {
private Date curriculaTime; private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */ /** 选课状态(1-未选课,2-已选课) */
private String curriculaState; private String curriculaState;
/** 已选专业/课程 */ /** 已选课程 */
private String selectedCourse; private Integer selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 所选科目 */
private Integer selectedSubject;
/** 是否删除 */ /** 是否删除 */
private String delFalg; private String delFalg;
} }
package yangtz.cs.liu.campus.domain.student;
import com.core.domain.OurBaseEntity;
import lombok.Data;
/**
* 学生成绩对象
*/
@Data
public class SchoolStudentScore extends OurBaseEntity {
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 考试类型 */
private String examType;
/** 语文 */
private Integer language;
/** 数学 */
private Integer math;
/** 英语 */
private Integer english;
/** 政治 */
private Integer politics;
/** 地理 */
private Integer geography;
/** 历史 */
private Integer history;
/** 物理 */
private Integer physics;
/** 化学 */
private Integer chemistry;
/** 生物 */
private Integer biology;
}
...@@ -3,7 +3,9 @@ package yangtz.cs.liu.campus.mapper.curricula; ...@@ -3,7 +3,9 @@ package yangtz.cs.liu.campus.mapper.curricula;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import java.util.List;
import java.util.Map; import java.util.Map;
public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> { public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
...@@ -15,4 +17,17 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> { ...@@ -15,4 +17,17 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
*/ */
Map<String,Long> countNum(@Param("curriculaId") Long curriculaId); Map<String,Long> countNum(@Param("curriculaId") Long curriculaId);
/**
* 查看选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/**
* 查询专业字典
* @param dictValue
* @return
*/
String selectZyZd(@Param("dictValue") String dictValue);
} }
package yangtz.cs.liu.campus.mapper.curricula;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
import java.util.List;
public interface StudentScoreMapper extends BaseMapper<SchoolStudentScore> {
/**
* 查询学生成绩列表
* @param schoolStudentScoreVo
* @return
*/
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
}
package yangtz.cs.liu.campus.service.curricula; package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import java.util.List;
public interface ICurriculaStudentService extends IService<CurriculaStudent> { public interface ICurriculaStudentService extends IService<CurriculaStudent> {
/**
* 查看选课情况列表
* @param curriculaStudentVo
* @return
*/
List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo);
/**
* 查询专业字典
* @param dictValue
* @return
*/
String selectZyZd(String dictValue);
} }
...@@ -5,6 +5,7 @@ import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable; ...@@ -5,6 +5,7 @@ import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo; import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo;
import java.util.List; import java.util.List;
import java.util.Map;
public interface ICurriculaVariableService extends IService<CurriculaVariable> { public interface ICurriculaVariableService extends IService<CurriculaVariable> {
/** /**
...@@ -21,4 +22,17 @@ public interface ICurriculaVariableService extends IService<CurriculaVariable> { ...@@ -21,4 +22,17 @@ public interface ICurriculaVariableService extends IService<CurriculaVariable> {
*/ */
int insertCurriculaVariable(CurriculaVariable curriculaVariable); int insertCurriculaVariable(CurriculaVariable curriculaVariable);
/**
* 获取选课任务详细信息
* @param id
* @return
*/
CurriculaVariableVo selectCurriculaVariableById(Long id);
/**
* 获取当前最新级部
* @return
*/
Map<String,String> getNewGrade();
} }
package yangtz.cs.liu.campus.service.curricula;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.student.SchoolStudentScore;
import yangtz.cs.liu.campus.vo.student.SchoolStudentScoreVo;
import java.util.List;
public interface IStudentScoreService extends IService<SchoolStudentScore> {
/**
* 查询学生成绩列表
* @param schoolStudentScoreVo
* @return
*/
List<SchoolStudentScoreVo> selectStudentScoreList(SchoolStudentScoreVo schoolStudentScoreVo);
/**
* 导入
* @param list
* @return
*/
String importExamDetail(List<SchoolStudentScoreVo> list);
/**
* 校验
* @param list
*/
void checkImport(List<SchoolStudentScoreVo> list);
}
package yangtz.cs.liu.campus.service.impl.curricula; package yangtz.cs.liu.campus.service.impl.curricula;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper; import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper;
import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService; import yangtz.cs.liu.campus.service.curricula.ICurriculaStudentService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaStudentVo;
import java.util.List;
@Service @Service
public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMapper, CurriculaStudent> implements ICurriculaStudentService { public class CurriculaStudentServiceImpl extends ServiceImpl<CurriculaStudentMapper, CurriculaStudent> implements ICurriculaStudentService {
@Autowired
private CurriculaStudentMapper curriculaStudentMapper;
/**
* 查看选课情况列表
* @param curriculaStudentVo
* @return
*/
@Override
public List<CurriculaStudentVo> selectCurriculaStudentList(CurriculaStudentVo curriculaStudentVo) {
return curriculaStudentMapper.selectCurriculaStudentList(curriculaStudentVo);
}
/**
* 查询专业字典
* @param dictValue
* @return
*/
@Override
public String selectZyZd(String dictValue) {
return curriculaStudentMapper.selectZyZd(dictValue);
}
} }
...@@ -11,13 +11,17 @@ import org.springframework.stereotype.Service; ...@@ -11,13 +11,17 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent; import yangtz.cs.liu.campus.domain.curricula.CurriculaStudent;
import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable; import yangtz.cs.liu.campus.domain.curricula.CurriculaVariable;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper; import yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper;
import yangtz.cs.liu.campus.mapper.curricula.CurriculaVariableMapper; import yangtz.cs.liu.campus.mapper.curricula.CurriculaVariableMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.service.curricula.ICurriculaVariableService; import yangtz.cs.liu.campus.service.curricula.ICurriculaVariableService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo; import yangtz.cs.liu.campus.vo.curricula.CurriculaVariableVo;
import static com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank; import static com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -28,6 +32,8 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM ...@@ -28,6 +32,8 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
private CurriculaVariableMapper curriculaVariableMapper; private CurriculaVariableMapper curriculaVariableMapper;
@Autowired @Autowired
private CurriculaStudentMapper curriculaStudentMapper; private CurriculaStudentMapper curriculaStudentMapper;
@Autowired
private SchoolGradeMapper schoolGradeMapper;
/** /**
* 查询选课任务列表 * 查询选课任务列表
* @param curriculaVariable * @param curriculaVariable
...@@ -37,11 +43,12 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM ...@@ -37,11 +43,12 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
public List<CurriculaVariableVo> selectCurriculaVariableList(CurriculaVariableVo curriculaVariable) { public List<CurriculaVariableVo> selectCurriculaVariableList(CurriculaVariableVo curriculaVariable) {
List<CurriculaVariableVo> list = new ArrayList<>(); List<CurriculaVariableVo> list = new ArrayList<>();
LambdaQueryWrapper<CurriculaVariable> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CurriculaVariable> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(isNotBlank(curriculaVariable.getTaskName()),CurriculaVariable::getTaskName,curriculaVariable.getTaskName()) wrapper.like(isNotBlank(curriculaVariable.getTaskName()),CurriculaVariable::getTaskName,curriculaVariable.getTaskName())
.eq(isNotBlank(curriculaVariable.getGrade()),CurriculaVariable::getGrade,curriculaVariable.getGrade()) .eq(isNotBlank(curriculaVariable.getGrade()),CurriculaVariable::getGrade,curriculaVariable.getGrade())
.eq(CurriculaVariable::getDelFlag,"0") .eq(CurriculaVariable::getDelFlag,"0")
.orderByDesc(CurriculaVariable::getGrade); .orderByDesc(CurriculaVariable::getGrade);
List<CurriculaVariable> curriculaVariables = curriculaVariableMapper.selectList(wrapper); List<CurriculaVariable> curriculaVariables = curriculaVariableMapper.selectList(wrapper);
//循环选课任务列表,计算总人数和已选人数
curriculaVariables.forEach(curriculaVariable1 -> { curriculaVariables.forEach(curriculaVariable1 -> {
CurriculaVariableVo curriculaVariableVo = new CurriculaVariableVo(); CurriculaVariableVo curriculaVariableVo = new CurriculaVariableVo();
BeanUtils.copyProperties(curriculaVariable1,curriculaVariableVo); BeanUtils.copyProperties(curriculaVariable1,curriculaVariableVo);
...@@ -90,4 +97,40 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM ...@@ -90,4 +97,40 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
} }
return i; return i;
} }
/**
* 获取选课任务详细信息
* @param id
* @return
*/
@Override
public CurriculaVariableVo selectCurriculaVariableById(Long id) {
//通过id查询选课任务
CurriculaVariable curriculaVariable = curriculaVariableMapper.selectById(id);
//转vo
CurriculaVariableVo curriculaVariableVo = new CurriculaVariableVo();
BeanUtils.copyProperties(curriculaVariable,curriculaVariableVo);
//计算总人数和已选人数
Map<String, Long> map = curriculaStudentMapper.countNum(id);
Long zrs = map.get("zrs");
Long yxrs = map.get("yxrs");
curriculaVariableVo.setYxrs(zrs.intValue());
curriculaVariableVo.setZrs(yxrs.intValue());
return curriculaVariableVo;
}
/**
* 获取当前最新级部
* @return
*/
@Override
public Map<String, String> getNewGrade() {
LambdaQueryWrapper<SchoolGrade> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolGrade::getDelFlag,'0')
.orderByDesc(SchoolGrade::getGradeYear).last("LIMIT 1");
SchoolGrade schoolGrade = schoolGradeMapper.selectOne(wrapper);
Map<String,String> map = new HashMap<>();
map.put("grade",schoolGrade.getGradeYear());
return map;
}
} }
package yangtz.cs.liu.campus.vo.curricula; package yangtz.cs.liu.campus.vo.curricula;
public class CurriculaStudentVo { import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class CurriculaStudentVo {
/** 主键id */
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 课程类型(1-春季选课,2-夏季选课,3-艺体) */
@Excel(name = "课程类型",readConverterExp = "1=春季选课,2=夏季选课,3=艺体")
private String courseType;
/** 选课时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "选课时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date curriculaTime;
/** 选课状态(1-未选课,2-已选课) */
@Excel(name = "选课状态",readConverterExp = "1=未选课,2=已选课")
private String curriculaState;
/** 已选课程 */
@Excel(name = "已选课程",readConverterExp = "1=物理+政治+化学,2=物理+政治+生物,3=物理+政治+地理,4=物理+政治+历史,5=物理+历史+化学,6=物理+历史+生物,7=物理+地理+化学,8=物理+地理+生物" +
",9=物理+化学+生物,10=物理+历史+地理,11=化学+政治+地理,12=化学+政治+历史,13=化学+政治+生物,14=化学+历史+地理,15=化学+历史+生物,16=化学+地理+生物,17=生物+政治+地理" +
",18=生物+历史+地理,19=生物+政治+历史,20=政治+历史+地理")
private Integer selectedCourse;
/** 已选专业 */
private String selectedMajor;
/** 已选专业名称 */
@Excel(name = "已选专业")
private String selectedMajorName;
/** 所选科目 */
@Excel(name = "所选科目",readConverterExp = "1=音乐,2=美术,3=田径,4=舞蹈")
private Integer selectedSubject;
/** 所分班级 */
@Excel(name = "所分班级")
private String divisionClasses;
/** 是否删除 */
private String delFalg;
} }
package yangtz.cs.liu.campus.vo.student;
import com.core.domain.OurBaseEntity;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
/**
* 学生成绩对象vo
*/
@Data
public class SchoolStudentScoreVo extends OurBaseEntity {
private Long id;
/** 学生主键id */
private Long studentId;
/** 选课主键id */
private Long curriculaId;
/** 班级主键id */
private Long classId;
/** 学生姓名 */
@Excel(name = "学生姓名")
private String studentName;
/** 学号 */
@Excel(name = "学号")
private String studentNumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String idCard;
/** 班级 */
@Excel(name = "班级")
private String className;
/** 考试类型 */
@Excel(name = "考试类型",combo = {"一次","二次","三次","期末"},readConverterExp = "1=一次,2=二次,3=三次,4=期末")
private String examType;
/** 总成绩 */
private double totalScore;
/** 年级排名 */
private Integer ranking;
/** 班级排名 */
private Integer classRanking;
/** 语文 */
@Excel(name = "语文")
private double language;
/** 年级排名 */
private Integer ywRanking;
/** 班级排名 */
private Integer ywClassRanking;
/** 数学 */
@Excel(name = "数学")
private double math;
/** 年级排名 */
private Integer sxRanking;
/** 班级排名 */
private Integer sxClassRanking;
/** 英语 */
@Excel(name = "英语")
private double english;
/** 年级排名 */
private Integer yyRanking;
/** 班级排名 */
private Integer yyClassRanking;
/** 政治 */
@Excel(name = "政治")
private double politics;
/** 年级排名 */
private Integer zzRanking;
/** 班级排名 */
private Integer zzClassRanking;
/** 地理 */
@Excel(name = "地理")
private double geography;
/** 年级排名 */
private Integer dlRanking;
/** 班级排名 */
private Integer dlClassRanking;
/** 历史 */
@Excel(name = "历史")
private double history;
/** 年级排名 */
private Integer lsRanking;
/** 班级排名 */
private Integer lsClassRanking;
/** 物理 */
@Excel(name = "物理")
private double physics;
/** 年级排名 */
private Integer wlRanking;
/** 班级排名 */
private Integer wlClassRanking;
/** 化学 */
@Excel(name = "化学")
private double chemistry;
/** 年级排名 */
private Integer hxRanking;
/** 班级排名 */
private Integer hxClassRanking;
/** 生物 */
@Excel(name = "生物")
private double biology;
/** 年级排名 */
private Integer swRanking;
/** 班级排名 */
private Integer swClassRanking;
public double getTotalScore() {
return totalScore;
}
public void setTotalScore(double totalScore) {
this.totalScore = totalScore;
}
}
...@@ -3,14 +3,21 @@ ...@@ -3,14 +3,21 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper"> <mapper namespace="yangtz.cs.liu.campus.mapper.curricula.CurriculaStudentMapper">
<resultMap type="CurriculaStudent" id="CurriculaStudentResult"> <resultMap type="CurriculaStudentVo" id="CurriculaStudentVoResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="studentId" column="student_id" /> <result property="studentId" column="student_id" />
<result property="curriculaId" column="curricula_id" /> <result property="curriculaId" column="curricula_id" />
<result property="className" column="class_name" />
<result property="studentName" column="student_name" />
<result property="idCard" column="id_card" />
<result property="studentNumber" column="student_number" />
<result property="courseType" column="course_type" /> <result property="courseType" column="course_type" />
<result property="curriculaTime" column="curricula_time" /> <result property="curriculaTime" column="curricula_time" />
<result property="curriculaState" column="curricula_state" /> <result property="curriculaState" column="curricula_state" />
<result property="selectedCourse" column="selected_course" /> <result property="selectedCourse" column="selected_course" />
<result property="selectedMajor" column="selected_major" />
<result property="selectedSubject" column="selected_subject" />
<result property="divisionClasses" column="division_classes" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
</resultMap> </resultMap>
...@@ -18,4 +25,37 @@ ...@@ -18,4 +25,37 @@
SELECT COUNT(id) as zrs,(SELECT COUNT(id) FROM curricula_student WHERE curricula_state = '2' AND del_flag = '0') as yxrs FROM curricula_student WHERE curricula_id = #{curriculaId} AND del_flag = '0' SELECT COUNT(id) as zrs,(SELECT COUNT(id) FROM curricula_student WHERE curricula_state = '2' AND del_flag = '0') as yxrs FROM curricula_student WHERE curricula_id = #{curriculaId} AND del_flag = '0'
</select> </select>
<select id="selectCurriculaStudentList" parameterType="CurriculaStudentVo" resultMap="CurriculaStudentVoResult">
SELECT
xk.id,
xk.student_id,
xk.curricula_id,
bj.class_name,
xs.student_name,
xs.id_card,
xs.school_no AS student_number,
xk.course_type,
xk.curricula_time,
xk.curricula_state,
xk.selected_course,
xk.selected_major,
xk.selected_subject,
dc.division_classes_name
FROM
curricula_student xk
LEFT JOIN school_student xs ON xk.student_id = xs.id
LEFT JOIN school_class bj ON xs.class_id = bj.id
LEFT JOIN school_division_student ds ON xk.student_id = ds.student_id
LEFT JOIN school_division_classes dc ON ds.division_classes_id = dc.id
WHERE
xk.curricula_id = #{curriculaId} and xk.del_flag = '0'
<if test="courseType != null and courseType != ''">and xk.course_type = #{courseType}</if>
<if test="curriculaState != null and curriculaState != ''">and xk.curricula_state = #{curriculaState}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
</select>
<select id="selectZyZd" parameterType="String" resultType="String">
SELECT dict_label FROM `sys_dict_data` WHERE dict_value=#{dictValue} AND dict_type = "specialty"
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.curricula.StudentScoreMapper">
<resultMap type="SchoolStudentScoreVo" id="SchoolStudentScoreVoResult">
<result property="id" column="id" />
<result property="studentId" column="student_id" />
<result property="curriculaId" column="curricula_id" />
<result property="studentName" column="student_name" />
<result property="idCard" column="id_card" />
<result property="studentNumber" column="student_number" />
<result property="classId" column="class_id" />
<result property="className" column="class_name" />
<result property="examType" column="exam_type" />
<result property="totalScore" column="total_score" />
<result property="language" column="language" />
<result property="math" column="math" />
<result property="english" column="english" />
<result property="politics" column="politics" />
<result property="geography" column="geography" />
<result property="history" column="history" />
<result property="physics" column="physics" />
<result property="chemistry" column="chemistry" />
<result property="biology" column="biology" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<select id="selectStudentScoreList" parameterType="SchoolStudentScoreVo" resultMap="SchoolStudentScoreVoResult">
SELECT
cj.id,
cj.student_id,
cj.curricula_id,
xs.student_name,
xs.id_card,
xs.school_no as student_number,
cj.class_id,
bj.class_name,
cj.exam_type,
(cj.`language` + cj.math + cj.english + cj.politics + cj.geography + cj.history + cj.physics + cj.chemistry + cj.biology) as total_score,
cj.`language`,
cj.math,
cj.english,
cj.politics,
cj.geography,
cj.history,
cj.physics,
cj.chemistry,
cj.biology,
cj.create_by,
cj.create_time,
cj.update_by,
cj.update_time
FROM
school_student_score cj
LEFT JOIN school_student xs ON cj.student_id = xs.id
LEFT JOIN school_class bj ON cj.class_id = bj.id
WHERE
cj.curricula_id = #{curriculaId}
AND cj.del_flag = '0'
<if test="examType != null and examType != ''">and cj.exam_type = #{examType}</if>
<if test="studentName != null and studentName != ''">and xs.student_name like concat('%', #{studentName}, '%')</if>
<if test="classId != null">and cj.class_id = #{classId}</if>
<if test="className != null and className != ''">and xs.class_name like concat('%', #{className}, '%')</if>
ORDER BY
student_id,
exam_type ASC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment