mapper.xml
<resultMap id="xxDtoResultMap"
type="com.xx.xxDto">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="roomCount" column="room_count" jdbcType="INTEGER"/>
<collection property="roomIds" ofType="Integer">
<result column="room_ids"/>
</collection>
</resultMap>
<select id="list" resultMap="xxDtoResultMap">
select
id
count(xx.id) as room_count,
room.id as room_ids
....
</select>
参考
select-list-of-integers-as-collection-inside-another-result-map-in-mybatis