Merge remote-tracking branch 'origin/main'

This commit is contained in:
MDSMO
2025-08-28 15:10:14 +08:00
35 changed files with 358 additions and 156 deletions

View File

@@ -615,4 +615,29 @@
where a.id = #{id}
</select>
<select id="listViewDormInfoByIds" parameterType="List" resultType="DmsDormitory">
select a.*,
case b.occupancy
when b.occupancy is not null then b.occupancy
else 0
end
as occupancy from view_dorm_info as a
left join view_dorm_stu_count as b on a.id = b.dormitory_id
where a.id in
<foreach item="item" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getDormitoryById" parameterType="Long" resultType="DmsDormitory">
select a.*,
case b.occupancy
when b.occupancy is not null then b.occupancy
else 0
end
as occupancy from view_dorm_info as a
left join view_dorm_stu_count as b on a.id = b.dormitory_id
where a.id = #{id}
</select>
</mapper>

View File

@@ -37,6 +37,7 @@
where a2.apply_status != 1
) as t1
<where>
t1.apply_status = 1 or t1.apply_status = 2 or t1.apply_status = 3
<if test="stuNo != null and stuNo != ''">and t1.stu_no = #{stuNo}</if>
<if test="roomId != null ">and t1.room_id = #{roomId}</if>
<if test="startDate != null ">and t1.start_date = #{startDate}</if>