|
|
@@ -5,6 +5,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.model.result.R;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
@@ -20,6 +21,7 @@ import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentUserVo;
|
|
|
import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
+import com.xjrsoft.module.system.entity.Menu;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -42,9 +44,31 @@ public class StudentManagerController {
|
|
|
@SaCheckPermission("studentmanager:detail")
|
|
|
public R page(@Valid BaseStudentUserPageDto dto) {
|
|
|
|
|
|
- MPJLambdaWrapper<BaseStudentUser> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
- queryWrapper
|
|
|
- .disableSubLogicDel()
|
|
|
+// MPJLambdaWrapper<BaseStudentUser> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
+// queryWrapper
|
|
|
+// .disableSubLogicDel()
|
|
|
+// .like(StrUtil.isNotBlank(dto.getUserName()), BaseStudentUser::getUserName, dto.getUserName())
|
|
|
+// .like(StrUtil.isNotBlank(dto.getMobile()), BaseStudentUser::getMobile, dto.getMobile())
|
|
|
+// .like(StrUtil.isNotBlank(dto.getName()), BaseStudentUser::getName, dto.getName())
|
|
|
+// .like(StrUtil.isNotBlank(dto.getEmail()), BaseStudentUser::getEmail, dto.getEmail())
|
|
|
+// .orderByDesc(BaseStudentUser::getId)
|
|
|
+// .select(BaseStudentUser::getId)
|
|
|
+// .select(BaseStudentUser.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentUserPageVo.class).contains(x.getProperty()))
|
|
|
+// .select(BaseStudentSchoolRoll::getStudyYear)
|
|
|
+// .select("a.`name` as grade_id")
|
|
|
+// .select("b.`name` as major_set_id")
|
|
|
+// .select("c.`name` as class_id")
|
|
|
+// .innerJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentUser::getId)
|
|
|
+// .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BaseStudentUser::getId)
|
|
|
+// .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentSchoolRoll::getArchivesStatus, ext -> ext.selectAs(DictionaryDetail::getName, BaseStudentUserPageVo::getArchivesStatus))
|
|
|
+// .leftJoin("base_grade a on a.id = t2.grade_id")
|
|
|
+// .leftJoin("base_major_set b on b.id = t2.major_set_id")
|
|
|
+// .leftJoin("base_class c on c.id = t2.class_id")
|
|
|
+//
|
|
|
+// .selectAsClass(BaseStudent.class, BaseStudentUserPageVo.class);
|
|
|
+
|
|
|
+ IPage<BaseStudentUserPageVo> page = studentManagerService.selectJoinListPage(ConventPage.getPage(dto),BaseStudentUserPageVo.class,
|
|
|
+ MPJWrappers.<BaseStudentUser>lambdaJoin()
|
|
|
.like(StrUtil.isNotBlank(dto.getUserName()), BaseStudentUser::getUserName, dto.getUserName())
|
|
|
.like(StrUtil.isNotBlank(dto.getMobile()), BaseStudentUser::getMobile, dto.getMobile())
|
|
|
.like(StrUtil.isNotBlank(dto.getName()), BaseStudentUser::getName, dto.getName())
|
|
|
@@ -58,14 +82,10 @@ public class StudentManagerController {
|
|
|
.select("c.`name` as class_id")
|
|
|
.innerJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentUser::getId)
|
|
|
.leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BaseStudentUser::getId)
|
|
|
- .leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, BaseStudentSchoolRoll::getArchivesStatus, ext -> ext.selectAs(DictionaryDetail::getName, BaseStudentUserPageVo::getArchivesStatus))
|
|
|
.leftJoin("base_grade a on a.id = t2.grade_id")
|
|
|
.leftJoin("base_major_set b on b.id = t2.major_set_id")
|
|
|
- .leftJoin("base_class c on c.id = t2.class_id")
|
|
|
+ .leftJoin("base_class c on c.id = t2.class_id"));
|
|
|
|
|
|
- .selectAsClass(BaseStudent.class, BaseStudentUserPageVo.class);
|
|
|
-
|
|
|
- IPage<BaseStudentUser> page = studentManagerService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
PageOutput<BaseStudentUserPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentUserPageVo.class);
|
|
|
return R.ok(pageOutput);
|
|
|
}
|