瀏覽代碼

新生扫码查询班级逻辑调整

dzx 7 月之前
父節點
當前提交
31a8140d84

+ 4 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -5,8 +5,10 @@ import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.banding.vo.IdManyCountVo;
 import com.xjrsoft.module.outint.vo.IdCountVo;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
+import com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo;
 import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
 import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -40,4 +42,6 @@ public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
     List<IdCountVo> getSecondAmbitionStudentCount(@Param("gradeId") Long gradeId, @Param("enrollType") String enrollType);
 
     List<IdManyCountVo> getMajorStudentCount(@Param("id") Long bandingTaskId);
+
+    List<BaseStudentSompleInfoVo> getInfosByParam(@Param("dto") BaseStudentSimpleInfoDto dto);
 }

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

@@ -18,6 +18,7 @@ import com.xjrsoft.module.room.vo.RoomBedInfoVo;
 import com.xjrsoft.module.student.dto.*;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
+import com.xjrsoft.module.student.mapper.BaseNewStudentMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper;
 import com.xjrsoft.module.student.mapper.PbSemesterConfigMapper;
@@ -53,6 +54,7 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     private final UserMapper userMapper;
     private final IStudentChangeRecordService recordService;
     private final BaseStudentMapper baseStudentMapper;
+    private final BaseNewStudentMapper newStudentMapper;
 
 
     @Override
@@ -260,6 +262,9 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
     @Override
     public List<BaseStudentSompleInfoVo> getInfosByParam(BaseStudentSimpleInfoDto dto) {
         List<BaseStudentSompleInfoVo> userList = userMapper.getInfosByParam(dto);
+        if(userList.isEmpty()){
+            userList = newStudentMapper.getInfosByParam(dto);
+        }
         return userList;
     }
 

+ 24 - 0
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -439,4 +439,28 @@
         WHERE t1.delete_mark = 0 and t1.enabled_mark = 1
     </select>
 
+    <select id="getInfosByParam" parameterType="com.xjrsoft.module.student.dto.BaseStudentSimpleInfoDto" resultType="com.xjrsoft.module.student.vo.BaseStudentSompleInfoVo">
+        SELECT t1.id, t1.name AS student_name, t1.enabled_mark, t1.credential_number, t3.name AS class_name,t1.mobile,
+        t1.family_mobile AS parent_mobile,
+        t1.gender,t3.id AS class_id, t3.teacher_id,t6.name AS teacher_name,t6.user_name AS teacher_user_name,t6.mobile AS teacher_mobile,t5.name AS classroom_name,
+        t8.id AS grade_id,t8.name AS grade_name
+        FROM base_new_student t1
+        INNER JOIN banding_task_class_student t2 ON t1.id = t2.new_student_id AND t2.delete_mark = 0
+        INNER JOIN banding_task_class t3 ON t2.banding_task_class_id = t3.id AND t3.delete_mark = 0
+        LEFT JOIN base_classroom t5 ON t3.classroom_id = t5.id
+        LEFT JOIN xjr_user t6 ON t3.teacher_id = t6.id
+        LEFT JOIN banding_task t7 ON t3.banding_task_id = t7.id
+        LEFT JOIN base_grade t8 ON t7.grade_id = t8.id
+        WHERE t1.delete_mark = 0 AND t1.delete_reason IS NULL
+        <if test="dto.keyword != null and dto.keyword != ''">
+            AND (t1.name like concat('%', #{dto.keyword}, '%') OR t1.credential_number like concat('%', #{dto.keyword}, '%'))
+        </if>
+        <if test="dto.name != null and dto.name != '' and dto.idNumber != null and dto.idNumber != ''">
+            AND t1.name = #{dto.name} and t1.credential_number = #{dto.idNumber}
+        </if>
+        <if test="dto.userId != null">
+            AND t1.id = #{dto.userId}
+        </if>
+    </select>
+
 </mapper>