分组查询统计的数据如何在xml中接收

xml中接收结果:
1.封装实体类
package org.skyviewpacs.model.pojo.localMaster;public class QueueCountVo {private int resCount;//登记人数private int queueCount;//排队人数private String room;//房间名public int getResCount() {return resCount;}public void setResCount(int resCount) {this.resCount = resCount;}public int getQueueCount() {return queueCount;}public void setQueueCount(int queueCount) {this.queueCount = queueCount;}public String getRoom() {return room;}public void setRoom(String room) {this.room = room;}}
- 添加如下配置
<resultMap id="QueueCountVo" type="org.skyviewpacs.model.pojo.localMaster.QueueCountVo"><id property="resCount" column="resCount" /> //为实体类中属性<id property="queueCount" column="queueCount" /><id property="room" column="room" /></resultMap>
3.结果集接收:(1)resultMap=“QueueCountVo”
(2) RI_RoomName as room, COUNT(DISTINCT R_Number) as resCount
<select id="getResCount" resultMap="QueueCountVo">select RI_RoomName as room, COUNT(DISTINCT R_Number) as resCount from VUSAllFlatwhere R_SPSSD >= #{start} and R_SPSSD <= #{end} and R_Delete_Flag=0 and R_Arrival_State=1 and R_Modality=#{modality}<if test="rNoonType !=null and rNoonType !=''">and R_Noon_Type in (${rNoonType} )</if> <if test="riRoomname !=null and riRoomname !=''">and RI_RoomName in (${riRoomname} )</if> GROUP BY RI_RoomName </select>
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
