修复分配学院宿舍人数问题
This commit is contained in:
@@ -616,13 +616,13 @@
|
||||
</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
|
||||
SELECT a.*,
|
||||
CASE
|
||||
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}
|
||||
|
||||
Reference in New Issue
Block a user