分组查询统计的数据如何在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;
	}

	

}

  1. 添加如下配置
 <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 VUSAllFlat
		where R_SPSSD &gt;= #{start} and R_SPSSD &lt;= #{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> 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值