@AutoLog(value = "通过id 或者学号 获得学生")
@ApiOperation(value="通过id 或者学号 获得学生", notes="通过id 或者学号 获得学生")
@GetMapping(value = "/getStudentByStuIdOrId")
public Result<?> getStudentByStuIdOrId(String keyword,String key,String fieldTwo,String nationality,String face,
String punish,String graduation,String single,String difficult,String psychological,String academicWarning,String delayedGraduation,String departId,
HttpServletRequest req) {
if(keyword==null){
keyword=key;
}
QueryWrapper<StStudent> stStudentWrapper=new QueryWrapper<>();
if(StringUtils.isNotBlank(keyword)){
stStudentWrapper.like("student_id",keyword).or().like("st_name",keyword).or().like("id",keyword);
}
stStudentWrapper.eq("deleted","0");
stStudentWrapper.eq("field_one","0");
if(StringUtils.isNotBlank(departId)){
stStudentWrapper.eq("college",departId);
}
if(StringUtils.isNotBlank(fieldTwo)){
stStudentWrapper.in("field_two", fieldTwo.split(","));
}
if(StringUtils.isNotBlank(nationality)){
stStudentWrapper.in("nationality", nationality.split(","));
}
if(StringUtils.isNotBlank(face)){
stStudentWrapper.in("face", face.split(","));
}
if(StringUtils.isNotBlank(punish)){
stStudentWrapper.in("punish", punish.split(","));
}
if(StringUtils.isNotBlank(graduation)){
stStudentWrapper.in("graduation", graduation.split(","));
}
if(StringUtils.isNotBlank(single)){
stStudentWrapper.in("single", single.split(","));
}
if(StringUtils.isNotBlank(difficult)){
stStudentWrapper.in("difficult", difficult.split(","));
}
if(StringUtils.isNotBlank(psychological)){
stStudentWrapper.in("psychological", psychological.split(","));
}
if(StringUtils.isNotBlank(academicWarning)){
stStudentWrapper.in("academic_warning", academicWarning.split(","));
}
if(StringUtils.isNotBlank(delayedGraduation)){
stStudentWrapper.in("delayed_graduation", delayedGraduation.split(","));
}
List<StStudent> stStudents = stStudentService.list(stStudentWrapper);
Result result=new Result();
List<DictModel> models=new ArrayList<>();
for (StStudent stStudent : stStudents) {
DictModel dictModel=new DictModel();
dictModel.setValue(stStudent.getId());
dictModel.setText(stStudent.getStName()+"("+stStudent.getStudentId()+")");
dictModel.setPhone(stStudent.getStPhoto());
dictModel.setStName(stStudent.getStName());
dictModel.setStId(stStudent.getStudentId());
models.add(dictModel);
}
result.setResult(models);
return result;
}