|
@@ -3,6 +3,7 @@ package com.xjrsoft.module.student.controller;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.yulichang.toolkit.MPJWrappers;
|
|
import com.github.yulichang.toolkit.MPJWrappers;
|
|
@@ -11,6 +12,7 @@ import com.xjrsoft.common.model.result.R;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
|
|
+import com.xjrsoft.module.base.entity.BaseClass;
|
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
|
|
import com.xjrsoft.module.student.dto.AddBaseStudentUserDto;
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
|
|
import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
|
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
|
|
import com.xjrsoft.module.student.dto.UpdateBaseStudentUserDto;
|
|
@@ -73,18 +75,19 @@ public class StudentManagerController {
|
|
|
.like(StrUtil.isNotBlank(dto.getMobile()), BaseStudentUser::getMobile, dto.getMobile())
|
|
.like(StrUtil.isNotBlank(dto.getMobile()), BaseStudentUser::getMobile, dto.getMobile())
|
|
|
.like(StrUtil.isNotBlank(dto.getName()), BaseStudentUser::getName, dto.getName())
|
|
.like(StrUtil.isNotBlank(dto.getName()), BaseStudentUser::getName, dto.getName())
|
|
|
.like(StrUtil.isNotBlank(dto.getEmail()), BaseStudentUser::getEmail, dto.getEmail())
|
|
.like(StrUtil.isNotBlank(dto.getEmail()), BaseStudentUser::getEmail, dto.getEmail())
|
|
|
|
|
+ .in((ObjectUtil.isNotNull(dto.getTokenType()) && dto.getTokenType() == 1), BaseClass::getTeacherId, StpUtil.getLoginIdAsLong())
|
|
|
.orderByDesc(BaseStudentUser::getId)
|
|
.orderByDesc(BaseStudentUser::getId)
|
|
|
.select(BaseStudentUser::getId)
|
|
.select(BaseStudentUser::getId)
|
|
|
.select(BaseStudentUser.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentUserPageVo.class).contains(x.getProperty()))
|
|
.select(BaseStudentUser.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentUserPageVo.class).contains(x.getProperty()))
|
|
|
.select(BaseStudentSchoolRoll::getStudyYear)
|
|
.select(BaseStudentSchoolRoll::getStudyYear)
|
|
|
.select("a.`name` as grade_id")
|
|
.select("a.`name` as grade_id")
|
|
|
.select("b.`name` as major_set_id")
|
|
.select("b.`name` as major_set_id")
|
|
|
- .select("c.`name` as class_id")
|
|
|
|
|
|
|
+ .selectAs(BaseClass::getName, BaseStudentUserPageVo::getClassId)
|
|
|
.innerJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentUser::getId)
|
|
.innerJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentUser::getId)
|
|
|
.leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BaseStudentUser::getId)
|
|
.leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BaseStudentUser::getId)
|
|
|
.leftJoin("base_grade a on a.id = t2.grade_id")
|
|
.leftJoin("base_grade a on a.id = t2.grade_id")
|
|
|
.leftJoin("base_major_set b on b.id = t2.major_set_id")
|
|
.leftJoin("base_major_set b on b.id = t2.major_set_id")
|
|
|
- .leftJoin("base_class c on c.id = t2.class_id"));
|
|
|
|
|
|
|
+ .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId));
|
|
|
|
|
|
|
|
PageOutput<BaseStudentUserPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentUserPageVo.class);
|
|
PageOutput<BaseStudentUserPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentUserPageVo.class);
|
|
|
return R.ok(pageOutput);
|
|
return R.ok(pageOutput);
|