|
@@ -6,6 +6,9 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import com.github.yulichang.interfaces.MPJBaseJoin;
|
|
|
|
|
+import com.github.yulichang.toolkit.MPJWrappers;
|
|
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
@@ -18,8 +21,10 @@ import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentProjectDto;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
|
|
|
import com.xjrsoft.module.student.dto.BaseStudentAssessmentProjectListDto;
|
|
import com.xjrsoft.module.student.dto.BaseStudentAssessmentProjectListDto;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentCategory;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentAssessmentProject;
|
|
import com.xjrsoft.module.student.entity.BaseStudentAssessmentProject;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentCadre;
|
|
import com.xjrsoft.module.student.entity.BaseStudentCadre;
|
|
|
|
|
+import com.xjrsoft.module.student.entity.BaseStudentUser;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentAssessmentProjectService;
|
|
import com.xjrsoft.module.student.service.IBaseStudentAssessmentProjectService;
|
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentProjectListVo;
|
|
import com.xjrsoft.module.student.vo.BaseStudentAssessmentProjectListVo;
|
|
|
|
|
|
|
@@ -50,16 +55,20 @@ public class BaseStudentAssessmentProjectController {
|
|
|
private final IBaseStudentAssessmentProjectService baseStudentAssessmentProjectService;
|
|
private final IBaseStudentAssessmentProjectService baseStudentAssessmentProjectService;
|
|
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
@GetMapping(value = "/page")
|
|
|
- @ApiOperation(value="学生考核项目列表(分页)")
|
|
|
|
|
|
|
+ @ApiOperation(value = "学生考核项目列表(分页)")
|
|
|
@SaCheckPermission("basestudentassessmentproject:detail")
|
|
@SaCheckPermission("basestudentassessmentproject:detail")
|
|
|
- public RT<PageOutput<BaseStudentAssessmentProjectPageVo>> page(@Valid BaseStudentAssessmentProjectPageDto dto){
|
|
|
|
|
|
|
+ public RT<PageOutput<BaseStudentAssessmentProjectPageVo>> page(@Valid BaseStudentAssessmentProjectPageDto dto) {
|
|
|
|
|
|
|
|
- LambdaQueryWrapper<BaseStudentAssessmentProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- queryWrapper
|
|
|
|
|
|
|
+ MPJBaseJoin<BaseStudentAssessmentProject> queryWrapper = MPJWrappers.<BaseStudentAssessmentProject>lambdaJoin()
|
|
|
|
|
+ .disableSubLogicDel()
|
|
|
.orderByDesc(BaseStudentAssessmentProject::getId)
|
|
.orderByDesc(BaseStudentAssessmentProject::getId)
|
|
|
.eq(ObjectUtil.isNotEmpty(dto.getBaseStudentAssessmentCategoryId()), BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId, dto.getBaseStudentAssessmentCategoryId())
|
|
.eq(ObjectUtil.isNotEmpty(dto.getBaseStudentAssessmentCategoryId()), BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId, dto.getBaseStudentAssessmentCategoryId())
|
|
|
- .select(BaseStudentAssessmentProject.class,x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentProjectPageVo.class).contains(x.getProperty()));
|
|
|
|
|
- IPage<BaseStudentAssessmentProject> page = baseStudentAssessmentProjectService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
|
|
|
|
+ .select(BaseStudentAssessmentProject.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentAssessmentProjectPageVo.class).contains(x.getProperty()))
|
|
|
|
|
+ .leftJoin(BaseStudentAssessmentCategory.class, BaseStudentAssessmentCategory::getId, BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId)
|
|
|
|
|
+ .select(BaseStudentAssessmentProject::getId)
|
|
|
|
|
+ .selectAs(BaseStudentAssessmentCategory::getName,BaseStudentAssessmentProjectPageVo::getBaseStudentAssessmentCategoryName);
|
|
|
|
|
+
|
|
|
|
|
+ IPage<BaseStudentAssessmentProjectPageVo> page = baseStudentAssessmentProjectService.selectJoinListPage(ConventPage.getPage(dto),BaseStudentAssessmentProjectPageVo.class,queryWrapper);
|
|
|
PageOutput<BaseStudentAssessmentProjectPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentAssessmentProjectPageVo.class);
|
|
PageOutput<BaseStudentAssessmentProjectPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentAssessmentProjectPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
}
|