dzx 4 місяців тому
батько
коміт
cca9c3ec95

+ 6 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -99,6 +99,12 @@ public class StudentManagerController {
     @ApiOperation(value = "学生列表(分页)")
     @SaCheckPermission("studentmanager:detail")
     public R page(@Valid BaseStudentUserPageDto dto) {
+        if(dto.getTreeType() != null && dto.getTreeId() != null){
+            dto.setQueryId(dto.getTreeId());
+            if(dto.getTreeType() == 3){
+                dto.setQueryId(dto.getTreeId().split("_")[1]);
+            }
+        }
 
         IPage<BaseStudentUserPageVo> page = studentManagerService.getStudentPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         for (BaseStudentUserPageVo record : page.getRecords()) {

+ 7 - 1
src/main/java/com/xjrsoft/module/student/dto/BaseStudentUserPageDto.java

@@ -39,9 +39,15 @@ public class BaseStudentUserPageDto extends PageInput {
      * 班级id
      */
     @ApiModelProperty("树id")
-    private Long treeId;
+    private String treeId;
 
     @ApiModelProperty("树类型(1:部门  2:专业  3:年级  4:班级)")
     private Integer treeType;
 
+    /**
+     * 班级id
+     */
+    @ApiModelProperty("树-查询id")
+    private String queryId;
+
 }

+ 5 - 5
src/main/resources/mapper/student/BaseStudentMapper.xml

@@ -76,18 +76,18 @@
         <if test="dto.email != null and dto.email != ''">
             and t1.email like concat('%', #{dto.email},'%')
         </if>
-        <if test="dto.treeType != null and dto.treeId != null">
+        <if test="dto.treeType != null and dto.queryId != null">
             <if test="dto.treeType == 1">
-                and t4.org_id = #{dto.treeId}
+                and t4.org_id = #{dto.queryId}
             </if>
             <if test="dto.treeType == 2">
-                and t3.major_set_id = #{dto.treeId}
+                and t3.major_set_id = #{dto.queryId}
             </if>
             <if test="dto.treeType == 3">
-                and t4.grade_id = #{dto.treeId}
+                and t4.grade_id = #{dto.queryId}
             </if>
             <if test="dto.treeType == 4">
-                and t4.id = #{dto.treeId}
+                and t4.id = #{dto.queryId}
             </if>
         </if>