Pārlūkot izejas kodu

学生基本信息管理接口回滚

大数据与最优化研究所 1 gadu atpakaļ
vecāks
revīzija
ea56097145

+ 25 - 2
src/main/java/com/xjrsoft/module/student/controller/StudentManagerController.java

@@ -59,8 +59,31 @@ public class StudentManagerController {
     @SaCheckPermission("studentmanager:detail")
     public R page(@Valid BaseStudentUserPageDto dto) {
 
-        IPage<BaseStudentUserPageVo> page = studentManagerService.pageBaseStudentUser(dto);
-
+        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())
+                        .like(StrUtil.isNotBlank(dto.getEmail()), BaseStudentUser::getEmail, dto.getEmail())
+                        .eq(ObjectUtil.isNotNull(dto.getClassId()), BaseClass::getId, dto.getClassId())
+                        .in((ObjectUtil.isNotNull(dto.getTokenType()) && dto.getTokenType() == 1), BaseClass::getTeacherId, StpUtil.getLoginIdAsLong())
+                        .orderByDesc(BaseStudentUser::getId)
+                        .select(BaseStudentUser::getId)
+                        .select(BaseStudent::getStudentId)
+                        .select(BaseStudentSchoolRoll.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentUserPageVo.class).contains(x.getProperty()))
+                        .select(BaseStudentUser.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentUserPageVo.class).contains(x.getProperty()))
+                        .select(BaseStudentSchoolRoll::getStudyYear)
+                        .select("a.`name` as grade_name")
+                        .select("b.`name` as major_set_name")
+                        .selectAs(BaseClass::getName, BaseStudentUserPageVo::getClassName)
+                        .innerJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentUser::getId)
+                        .leftJoin(BaseStudentSchoolRoll.class, BaseStudentSchoolRoll::getUserId, BaseStudentUser::getId)
+                        .leftJoin("base_grade a on a.id = t2.grade_id")
+                        .leftJoin("base_major_set b on b.id = t2.major_set_id")
+                        .leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId));
+        for (BaseStudentUserPageVo record : page.getRecords()) {
+            record.setGenderCn(GenderDictionaryEnum.getValue(record.getGender()));
+        }
         PageOutput<BaseStudentUserPageVo> pageOutput = ConventPage.getPageOutput(page, BaseStudentUserPageVo.class);
         return R.ok(pageOutput);
     }

+ 18 - 26
src/main/java/com/xjrsoft/module/student/dto/BaseStudentUserPageDto.java

@@ -7,46 +7,38 @@ import lombok.EqualsAndHashCode;
 @Data
 @EqualsAndHashCode(callSuper = false)
 public class BaseStudentUserPageDto extends PageInput {
-    /**
-     * 年级id
-     */
-    @ApiModelProperty("年级id")
-    private Long gradeId;
 
     /**
-     * 班级id
+     * 账户
      */
-    @ApiModelProperty("班级id")
-    private Long classId;
-
+    @ApiModelProperty("账户")
+    private String userName;
     /**
-     * 学籍状态
+     * 手机号
      */
-    @ApiModelProperty("学籍状态")
-    private String archivesStatus;
-
+    @ApiModelProperty("手机号")
+    private String mobile;
     /**
-     * 就读方式
+     * 姓名
      */
-    @ApiModelProperty("就读方式")
-    private String stduyStatus;
-
+    @ApiModelProperty("姓名")
+    private String name;
     /**
-     * 学籍形式
+     * 邮箱
      */
-    @ApiModelProperty("学籍形式")
-    private String rollModality;
+    @ApiModelProperty("邮箱")
+    private String email;
 
     /**
-     * 姓名
+     * 权限标识
      */
-    @ApiModelProperty("姓名")
-    private String name;
+    @ApiModelProperty("权限标识")
+    private Integer tokenType;
 
     /**
-     * 是否发放毕业证
+     * 班级id
      */
-    @ApiModelProperty("是否发放毕业证0:未发放,1:已发放")
-    private Integer status;
+    @ApiModelProperty("班级id")
+    private Long classId;
 
 }

+ 0 - 2
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentMapper.java

@@ -20,8 +20,6 @@ import java.util.List;
 @Mapper
 public interface BaseStudentMapper extends MPJBaseMapper<BaseStudent> {
 
-    IPage<BaseStudentUserPageVo> pageBaseStudentUser(IPage<BaseStudent> page, BaseStudentUserPageDto dto);
-
     /**
      * 根据用户编号查询学生信息
      * @return

+ 0 - 2
src/main/java/com/xjrsoft/module/student/service/IStudentManagerService.java

@@ -11,8 +11,6 @@ import java.util.List;
 
 public interface IStudentManagerService extends MPJBaseService<BaseStudentUser> {
 
-    IPage<BaseStudentUserPageVo> pageBaseStudentUser(BaseStudentUserPageDto dto);
-
     /**
      * 新增
      *

+ 0 - 6
src/main/java/com/xjrsoft/module/student/service/impl/StudentManagerServiceImpl.java

@@ -53,12 +53,6 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
 
     private final UserRoleRelationMapper userRoleRelationMapper;
 
-
-    @Override
-    public IPage<BaseStudentUserPageVo> pageBaseStudentUser(BaseStudentUserPageDto dto) {
-        return studentbaseManagerBaseStudentMapper.pageBaseStudentUser(ConventPage.getPage(dto), dto);
-    }
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean add(BaseStudentUser baseStudentUser) {

+ 0 - 35
src/main/java/com/xjrsoft/module/student/vo/BaseStudentUserPageVo.java

@@ -108,39 +108,4 @@ public class BaseStudentUserPageVo {
      */
     @ApiModelProperty("学籍状态")
     private String archivesStatus;
-    /**
-     * 学籍状态
-     */
-    @ApiModelProperty("学籍状态")
-    private String archivesStatusCn;
-
-    /**
-     * 就读方式
-     */
-    @ApiModelProperty("就读方式")
-    private String stduyStatus;
-
-    /**
-     * 就读方式
-     */
-    @ApiModelProperty("就读方式")
-    private String stduyStatusCn;
-
-    /**
-     * 学籍形式
-     */
-    @ApiModelProperty("学籍形式")
-    private String rollModality;
-
-    /**
-     * 学籍形式
-     */
-    @ApiModelProperty("学籍形式")
-    private String rollModalityCn;
-
-    /**
-     * 是否发放毕业证
-     */
-    @ApiModelProperty("是否发放毕业证0:未发放,1:已发放")
-    private Integer status;
 }

+ 0 - 51
src/main/resources/mapper/student/BaseStudentMapper.xml

@@ -21,55 +21,4 @@
         AND t1.student_id IS NOT NULL AND t1.student_id != ''
         AND t3.archives_status = 'FB2901';
     </select>
-
-    <select id="pageBaseStudentUser" parameterType="com.xjrsoft.module.student.dto.BaseStudentUserPageDto"
-            resultType="com.xjrsoft.module.student.vo.BaseStudentUserPageVo">
-        SELECT t.id,
-               t1.student_id,
-               t.name,
-               t.gender,
-               t6.name as genderCn,
-               t.mobile,
-               t2.archives_status,
-               t7.name as archivesStatusCn,
-               t2.stduy_status,
-               t8.name as stduyStatusCn,
-               t2.roll_modality,
-               t9.name as rollModalityCn,
-               t5.status
-        FROM xjr_user t
-                 INNER JOIN base_student t1 ON (t1.user_id = t.id)
-                 LEFT JOIN base_student_school_roll t2 ON (t2.user_id = t.id)
-                 LEFT JOIN base_class t3 ON (t3.id = t2.class_id)
-                 LEFT JOIN base_student_graduate t5 ON t.id = t5.user_id
-                 LEFT JOIN xjr_dictionary_detail t6 on t6.code = t.gender
-                 LEFT JOIN xjr_dictionary_detail t7 on t7.code = t2.archives_status
-                 LEFT JOIN xjr_dictionary_detail t8 on t8.code = t2.stduy_status
-                 LEFT JOIN xjr_dictionary_detail t9 on t9.code = t2.roll_modality
-        WHERE t.delete_mark = 0
-          AND t1.delete_mark = 0
-          AND t2.delete_mark = 0
-        <if test="dto.gradeId != null and dto.gradeId > 0">
-            and t2.grade_id = #{dto.gradeId}
-        </if>
-        <if test="dto.classId != null and dto.classId > 0">
-            and t2.class_id = #{dto.classId}
-        </if>
-        <if test="dto.archivesStatus != null and dto.archivesStatus != ''">
-            and t2.archives_status = #{dto.archivesStatus}
-        </if>
-        <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
-            and t2.stduy_status = #{dto.stduyStatus}
-        </if>
-        <if test="dto.rollModality != null and dto.rollModality != ''">
-            and t2.roll_modality = #{dto.rollModality}
-        </if>
-        <if test="dto.name != null and dto.name != ''">
-            and t.name like concat('%', #{dto.stduyStatus}, '%')
-        </if>
-        <if test="dto.status != null">
-            and t5.status = #{dto.status}
-        </if>
-        ORDER BY t.id DESC
-    </select>
 </mapper>