|
@@ -5,7 +5,7 @@
|
|
<mapper namespace="com.xjrsoft.module.room.mapper.RoomBedMapper">
|
|
<mapper namespace="com.xjrsoft.module.room.mapper.RoomBedMapper">
|
|
<select id="getPage" parameterType="com.xjrsoft.module.room.dto.RoomBedPageDto" resultType="com.xjrsoft.module.room.vo.RoomBedPageVo">
|
|
<select id="getPage" parameterType="com.xjrsoft.module.room.dto.RoomBedPageDto" resultType="com.xjrsoft.module.room.vo.RoomBedPageVo">
|
|
SELECT t1.id,t1.sort_code,t3.name AS build_name,t2.floor_number,t2.room_name,t1.bed_number,t4.name AS student_name,t5.student_id,
|
|
SELECT t1.id,t1.sort_code,t3.name AS build_name,t2.floor_number,t2.room_name,t1.bed_number,t4.name AS student_name,t5.student_id,
|
|
- t4.mobile,t2.gender as gender_cn,t7.name AS grade_name,t8.name AS class_name FROM room_bed t1
|
|
|
|
|
|
+ t4.mobile,t9.name as gender_cn,t7.name AS grade_name,t8.name AS class_name FROM room_bed t1
|
|
LEFT JOIN room t2 ON t1.room_id = t2.id
|
|
LEFT JOIN room t2 ON t1.room_id = t2.id
|
|
LEFT JOIN base_office_build t3 ON t2.office_build_id = t3.id
|
|
LEFT JOIN base_office_build t3 ON t2.office_build_id = t3.id
|
|
LEFT JOIN xjr_user t4 ON t1.student_user_id = t4.id
|
|
LEFT JOIN xjr_user t4 ON t1.student_user_id = t4.id
|
|
@@ -13,6 +13,7 @@
|
|
LEFT JOIN base_student_school_roll t6 ON t1.student_user_id = t6.user_id
|
|
LEFT JOIN base_student_school_roll t6 ON t1.student_user_id = t6.user_id
|
|
LEFT JOIN base_grade t7 ON t6.grade_id = t7.id
|
|
LEFT JOIN base_grade t7 ON t6.grade_id = t7.id
|
|
LEFT JOIN base_class t8 ON t6.class_id = t8.id
|
|
LEFT JOIN base_class t8 ON t6.class_id = t8.id
|
|
|
|
+ LEFT JOIN xjr_dictionary_detail t9 ON t1.gender = t9.code AND t9.item_id = 2023000000000000004
|
|
<if test="dto.officeBuildId != null">
|
|
<if test="dto.officeBuildId != null">
|
|
and t2.office_build_id = #{dto.officeBuildId}
|
|
and t2.office_build_id = #{dto.officeBuildId}
|
|
</if>
|
|
</if>
|
|
@@ -43,7 +44,7 @@
|
|
SELECT IFNULL(MAX(sort_code),0) FROM room_bed WHERE delete_mark = 0
|
|
SELECT IFNULL(MAX(sort_code),0) FROM room_bed WHERE delete_mark = 0
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getClassInfo" parameterType="com.xjrsoft.module.room.dto.RoomBedClassPageDto" resultType="com.xjrsoft.module.room.vo.RoomBedClassPageVo">
|
|
|
|
|
|
+ <select id="getDistributeClassInfo" parameterType="com.xjrsoft.module.room.dto.DistributeClassPageDto" resultType="com.xjrsoft.module.room.vo.DistributeClassPageVo">
|
|
SELECT t1.id,t2.name AS grade_name,t3.name AS org_name,t1.name AS class_name,
|
|
SELECT t1.id,t2.name AS grade_name,t3.name AS org_name,t1.name AS class_name,
|
|
(SELECT COUNT(*) FROM base_student c1
|
|
(SELECT COUNT(*) FROM base_student c1
|
|
LEFT JOIN base_student_school_roll c2 ON c1.user_id = c2.user_id
|
|
LEFT JOIN base_student_school_roll c2 ON c1.user_id = c2.user_id
|
|
@@ -59,4 +60,23 @@
|
|
LEFT JOIN xjr_department t3 ON t1.org_id = t3.id
|
|
LEFT JOIN xjr_department t3 ON t1.org_id = t3.id
|
|
WHERE t1.delete_mark = 0
|
|
WHERE t1.delete_mark = 0
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getDistributeRoomBedInfo" parameterType="com.xjrsoft.module.room.dto.DistributeClassPageDto" resultType="com.xjrsoft.module.room.vo.DistributeRoomBedPageVo">
|
|
|
|
+ SELECT t1.id,t1.sort_code,t2.name AS build_name,t1.room_name,t4.name AS gender_cn, t3.name AS check_in_status_cn,
|
|
|
|
+ t1.bed_count,(
|
|
|
|
+ SELECT COUNT(*) FROM room_bed
|
|
|
|
+ WHERE delete_mark = 0 AND room_id = t1.id
|
|
|
|
+ AND student_user_id IS NOT NULL
|
|
|
|
+ ) AS into_count,(
|
|
|
|
+ SELECT GROUP_CONCAT(c3.name) FROM room_bed c1
|
|
|
|
+ LEFT JOIN base_student_school_roll c2 ON c1.student_user_id = c2.user_id
|
|
|
|
+ LEFT JOIN base_class c3 ON c2.class_id = c3.id
|
|
|
|
+ WHERE c1.delete_mark = 0 AND c1.room_id = t1.id
|
|
|
|
+ AND c1.student_user_id IS NOT NULL GROUP BY c3.id
|
|
|
|
+ ) AS into_class FROM room t1
|
|
|
|
+ LEFT JOIN base_office_build t2 ON t1.office_build_id = t2.id
|
|
|
|
+ LEFT JOIN xjr_dictionary_detail t3 ON t1.check_in_status = t3.code AND t3.item_id = 1739843696019435521
|
|
|
|
+ LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code AND t4.item_id = 2023000000000000004
|
|
|
|
+ WHERE t1.delete_mark = 0 ORDER BY t1.sort_code
|
|
|
|
+
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|