Browse Source

学生查询接口

dzx 8 months ago
parent
commit
d920dde153

+ 8 - 0
src/main/java/com/xjrsoft/module/organization/mapper/UserMapper.java

@@ -5,7 +5,13 @@ import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.organization.dto.UserPageDto;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.vo.ResetUserPageVo;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
 /**
  * <p>
  * 用户 Mapper 接口
@@ -17,4 +23,6 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface UserMapper extends MPJBaseMapper<User> {
     Page<ResetUserPageVo> getResetUserPage(Page<ResetUserPageVo> page, UserPageDto dto);
+
+    List<BaseStudentSompleInfoVo> getInfosByParam(@Param("dto") BaseStudentSimpleInfoDto dto);
 }

+ 11 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
@@ -15,6 +16,7 @@ import com.xjrsoft.module.student.service.IStudentManagerService;
 import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.MobileClassStatisticsVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
 * @title: 学生职务设置
@@ -91,4 +94,12 @@ public class BaseStudentInfoController {
         }
         return RT.ok(BeanUtil.toBean(detailVo, BaseStudentInfoDetailVo.class));
     }
+
+    @GetMapping(value = "/studentinfoByKeyWord")
+    @ApiOperation(value="根据姓名或者身份证号查询详情信息")
+    @SaCheckPermission("room:detail")
+    public RT<List<BaseStudentSompleInfoVo>> info(@Valid BaseStudentSimpleInfoDto dto){
+        List<BaseStudentSompleInfoVo> infos = baseStudentSchoolRollService.getInfosByParam(dto);
+        return RT.ok(infos);
+    }
 }

+ 15 - 0
src/main/java/com/xjrsoft/module/student/dto/BaseStudentSimpleInfoDto.java

@@ -0,0 +1,15 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author dzx
+ * @date 2024/7/9
+ */
+@Data
+public class BaseStudentSimpleInfoDto {
+
+    @ApiModelProperty("关键字")
+    private String keyword;
+}

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

@@ -2,6 +2,7 @@ package com.xjrsoft.module.student.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
@@ -9,8 +10,11 @@ import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.MobileClassStatisticsVo;
 
+import java.util.List;
+
 /**
 * @title: 奖学金申请
 * @Author dzx
@@ -45,4 +49,6 @@ public interface IBaseStudentSchoolRollService extends MPJBaseService<BaseStuden
     MobileClassStatisticsVo getMobileClassStatistics(BaseStudentInfoPageDto dto);
 
     Boolean updateStudentClass(Long classId, Long userId);
+
+    List<BaseStudentSompleInfoVo> getInfosByParam(BaseStudentSimpleInfoDto dto);
 }

+ 10 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -10,8 +10,10 @@ import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.StudyStatusEnum;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
+import com.xjrsoft.module.organization.mapper.UserMapper;
 import com.xjrsoft.module.room.mapper.RoomBedMapper;
 import com.xjrsoft.module.room.vo.RoomBedInfoVo;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoDetailDto;
 import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.dto.PbVXsxxsfytbDto;
@@ -25,6 +27,7 @@ import com.xjrsoft.module.student.vo.BaseStudentInfoCategoryVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoDetailVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageDataVo;
 import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.MobileClassStatisticsVo;
 import com.xjrsoft.module.student.vo.PbVXsxxsfytbVo;
 import lombok.AllArgsConstructor;
@@ -50,6 +53,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     private final BaseClassMapper baseClassMapper;
     private final PbSemesterConfigMapper pbSemesterConfigMapper;
     private final PbVXsxxsfytbMapper pbVXsxxsfytbMapper;
+    private final UserMapper userMapper;
 
 
     @Override
@@ -197,4 +201,10 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     public Boolean updateStudentClass(Long classId, Long userId) {
         return baseStudentSchoolRollMapper.updateStudentClass(classId, userId);
     }
+
+    @Override
+    public List<BaseStudentSompleInfoVo> getInfosByParam(BaseStudentSimpleInfoDto dto) {
+        List<BaseStudentSompleInfoVo> userList = userMapper.getInfosByParam(dto);
+        return userList;
+    }
 }

+ 46 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentSompleInfoVo.java

@@ -0,0 +1,46 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 移动端学生修改信息列表
+* @Author dzx
+* @Date: 2024年2月26日
+* @Version 1.0
+*/
+@Data
+public class BaseStudentSompleInfoVo {
+
+
+    @ApiModelProperty("主键编号")
+    private Long id;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("启用状态(0:禁用 1:启用)")
+    private Integer enabledMark;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("本人电话")
+    private String mobile;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("班主任名称")
+    private String teacherName;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("班级名称")
+    private String className;
+
+}

+ 7 - 0
src/main/resources/mapper/organization/UserMapper.xml

@@ -15,4 +15,11 @@
             and t2.role_id = #{dto.roleId}
         </if>
     </select>
+    <select id="getInfosByParam" parameterType="com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto" resultType="com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo">
+        SELECT t1.id, t1.name, t1.enabled_mark, t1.credential_number, t4.name AS class_name FROM xjr_user t1
+        INNER JOIN base_student t2 ON t1.id = t2.user_id
+        INNER JOIN base_student_school_roll t3 ON t1.id = t3.user_id
+        INNER JOIN base_class t4 ON t4.id = t3.class_id
+        WHERE t1.delete_mark = 0 AND (t1.name LIKE CONCAT('%', #{dto.keyword},'%') OR t1.credential_number LIKE CONCAT('%', #{dto.keyword},'%'))
+    </select>
 </mapper>