add alarm count,device count impl.

change select impl to support select by org
This commit is contained in:
wty 2022-10-09 10:08:22 +08:00
parent cb729319ba
commit 1460f197f0
12 changed files with 198 additions and 57 deletions

View File

@ -3,6 +3,7 @@ package com.aiit.xiuos.controller;
import com.aiit.xiuos.Utils.Constant;
import com.aiit.xiuos.Utils.ResultRespons;
import com.aiit.xiuos.model.AlarmInfo;
import com.aiit.xiuos.model.UserInfo;
import com.aiit.xiuos.service.AlarmInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/alarmInfo")
@ -18,6 +20,11 @@ public class AlarmInfoController {
AlarmInfoService alarmInfoService;
@GetMapping("/select")
public ResultRespons getAllInfo(AlarmInfo alarmInfo,HttpServletRequest request){
UserInfo userInfo =(UserInfo) request.getSession().getAttribute("user");
if(userInfo==null){
return new ResultRespons(Constant.SessionTimeOut_CODE,"用户尚未登录,请先登录!");
}
alarmInfo.setOrg(userInfo.getOrg());
List<AlarmInfo> lists = alarmInfoService.selectByParam(alarmInfo);
if(lists!=null && lists.size()>=0){
@ -37,4 +44,28 @@ public class AlarmInfoController {
}
return new ResultRespons(Constant.ERROR_CODE,"更新告警信息失败!");
}
@GetMapping("/getAlarmLevelCount")
public ResultRespons getAlarmLevelCount(HttpServletRequest request){
UserInfo userInfo =(UserInfo) request.getSession().getAttribute("user");
if(userInfo==null){
return new ResultRespons(Constant.SessionTimeOut_CODE,"用户尚未登录,请先登录!");
}
List<Map<String,String>> list=alarmInfoService.getAlarmLevelCount(userInfo.getOrg());
if(list!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询成功!",list);
}
return new ResultRespons(Constant.ERROR_CODE,"查询失败!");
}
@GetMapping("/getCount")
public ResultRespons getCount(HttpServletRequest request){
UserInfo userInfo =(UserInfo) request.getSession().getAttribute("user");
if(userInfo==null){
return new ResultRespons(Constant.SessionTimeOut_CODE,"用户尚未登录,请先登录!");
}
int res= alarmInfoService.getCount(userInfo.getOrg());
return new ResultRespons(Constant.SUCCESS_CODE,"查询成功!",res);
}
}

View File

@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/device")
@ -32,6 +33,7 @@ public class DeviceController {
String id =GenerateIdUtil.getId(userInfo.getUsername(),userInfo.getOrg());
deviceInfo.setId(id);
deviceInfo.setUpdatetime(MyUtils.getTime());
deviceInfo.setOrg(userInfo.getOrg());
int res=deviceInfoService.addDevice(deviceInfo);
if(1==res){
return new ResultRespons(Constant.SUCCESS_CODE,"新增设备成功!");
@ -40,11 +42,15 @@ public class DeviceController {
}
@GetMapping("/select")
public ResultRespons selectDevice(@RequestParam("activestatus") int activestatus, HttpServletRequest request){
UserInfo userInfo =(UserInfo) request.getSession().getAttribute("user");
if(userInfo==null){
return new ResultRespons(Constant.SessionTimeOut_CODE,"用户尚未登录,请先登录!");
}
List<DeviceInfo> deviceInfoList =null;
if(1==activestatus){
deviceInfoList=deviceInfoService.selectActiveDevice();
deviceInfoList=deviceInfoService.selectActiveDevice(userInfo.getOrg());
}else if(0==activestatus){
deviceInfoList=deviceInfoService.selectUnActiveDevice();
deviceInfoList=deviceInfoService.selectUnActiveDevice(userInfo.getOrg());
}
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",deviceInfoList);
}
@ -60,10 +66,37 @@ public class DeviceController {
@PostMapping("/active")
public ResultRespons activeDevice(@RequestBody DeviceInfo deviceInfo, HttpServletRequest request){
int res=deviceInfoService.activeDeviceByNo(deviceInfo.getNo());
if(1==res){
return new ResultRespons(Constant.SUCCESS_CODE,"激活设备成功!");
}
return new ResultRespons(Constant.ERROR_CODE,"激活设备失败!");
}
@GetMapping("/getTypeCount")
public ResultRespons getTypeCount(HttpServletRequest request){
UserInfo userInfo =(UserInfo) request.getSession().getAttribute("user");
if(userInfo==null){
return new ResultRespons(Constant.SessionTimeOut_CODE,"用户尚未登录,请先登录!");
}
List<Map<String,String>> list=deviceInfoService.getDeviceTypeCount(userInfo.getOrg());
if(list!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",list);
}
return new ResultRespons(Constant.ERROR_CODE,"查询设备失败!");
}
@GetMapping("/getRunStatusCount")
public ResultRespons getRunStatusCount(HttpServletRequest request){
UserInfo userInfo =(UserInfo) request.getSession().getAttribute("user");
if(userInfo==null){
return new ResultRespons(Constant.SessionTimeOut_CODE,"用户尚未登录,请先登录!");
}
List<Map<String,String>> list=deviceInfoService.getDeviceRunStautsCount(userInfo.getOrg());
if(list!=null){
return new ResultRespons(Constant.SUCCESS_CODE,"查询设备成功!",list);
}
return new ResultRespons(Constant.ERROR_CODE,"查询设备失败!");
}
}

View File

@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository
public interface AlarmInfoMapper {
@ -29,5 +30,9 @@ public interface AlarmInfoMapper {
List<AlarmInfo> selectByParam(AlarmInfo alarmInfo);
@Select("select alarm_level,count(alarm_level) from alarm_info where org = #{org}GROUP BY alarm_level")
List<Map<String,String>> getAlarmLevelCount(@Param("org") String org);
@Select("select count(1) as 未处理 from alarm_info where org =#{org} and alarm_status =1")
int getCount(@Param("org") String org);
}

View File

@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository
public interface DeviceInfoMapper {
@ -26,15 +27,19 @@ public interface DeviceInfoMapper {
@Update("update device_info set activestatus=1,updatetime=#{time} where no =#{no}")
int updateStatusByNo(@Param("time") String updateTime, @Param("no") String no);
@Select("select * from device_info where activestatus=1")
List<DeviceInfo> selectActiveDevices();
@Select("select * from device_info where activestatus=1 and org=#{org}")
List<DeviceInfo> selectActiveDevices(@Param("org") String org);
@Select("select * from device_info where activestatus=0")
List<DeviceInfo> selectUnActiveDevices();
@Select("select * from device_info where activestatus=0 and org=#{org}" )
List<DeviceInfo> selectUnActiveDevices(@Param("org") String org);
@Delete("delete from device_info where no =#{no}")
int deleteByNo(@Param("no") String no);
@Select("select * from device_info where no=#{no}")
List<DeviceInfo> selectByNo(@Param("no") String no);
List<Map<String,String>> getDeviceTypeCount(@Param("org") String org);
List<Map<String,String>> getDeviceRunStatusCount(@Param("org") String org);
}

View File

@ -12,7 +12,7 @@ public class AlarmInfo {
private String deviceNo;
private String alarmName;
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date alarmTime;
private String deviceType;
@ -23,7 +23,9 @@ public class AlarmInfo {
private String alarmRes;
public AlarmInfo(String deviceNo, String alarmName, Date alarmTime, String deviceType, Integer alarmStatus, Integer alarmLevel, String alarmRes) {
private String org;
public AlarmInfo(String deviceNo, String alarmName, Date alarmTime, String deviceType, Integer alarmStatus, Integer alarmLevel, String alarmRes, String org) {
this.deviceNo = deviceNo;
this.alarmName = alarmName;
this.alarmTime = alarmTime;
@ -31,6 +33,7 @@ public class AlarmInfo {
this.alarmStatus = alarmStatus;
this.alarmLevel = alarmLevel;
this.alarmRes = alarmRes;
this.org = org;
}
public AlarmInfo() {

View File

@ -1,6 +1,5 @@
package com.aiit.xiuos.model;
import lombok.Builder;
import lombok.Data;
@ -55,7 +54,9 @@ public class DeviceInfo {
private String privateserverusername;
public DeviceInfo(String id, String no, String productname, String type, Integer activestatus, String updatetime, String devicedesc, Integer runstatus, String statusdesc, String kernel, String webversion, String ipaddr, String netmask, String gateway, String dnsserver0, String dnsserver1, String topic, String serveraddr, String serverport, String username, String clientid, String privateserveraddr, String privateserverport, String privateserverusername) {
private String org;
public DeviceInfo(String id, String no, String productname, String type, Integer activestatus, String updatetime, String devicedesc, Integer runstatus, String statusdesc, String kernel, String webversion, String ipaddr, String netmask, String gateway, String dnsserver0, String dnsserver1, String topic, String serveraddr, String serverport, String username, String clientid, String privateserveraddr, String privateserverport, String privateserverusername, String org) {
this.id = id;
this.no = no;
this.productname = productname;
@ -80,6 +81,7 @@ public class DeviceInfo {
this.privateserveraddr = privateserveraddr;
this.privateserverport = privateserverport;
this.privateserverusername = privateserverusername;
this.org = org;
}
public DeviceInfo() {

View File

@ -3,10 +3,14 @@ package com.aiit.xiuos.service;
import com.aiit.xiuos.model.AlarmInfo;
import java.util.List;
import java.util.Map;
public interface AlarmInfoService {
List<AlarmInfo> selectAll();
List<AlarmInfo> selectByLevel(int level);
int updateAlarmInfo(AlarmInfo alarmInfo);
List<AlarmInfo> selectByParam(AlarmInfo alarmInfo);
List<Map<String,String>> getAlarmLevelCount(String org);
//获取未处理得告警数量
int getCount(String org);
}

View File

@ -3,12 +3,16 @@ package com.aiit.xiuos.service;
import com.aiit.xiuos.model.DeviceInfo;
import java.util.List;
import java.util.Map;
public interface DeviceInfoService {
int addDevice(DeviceInfo deviceInfo);
int deleteDeviceByNo(String no);
int activeDeviceByNo(String no);
List<DeviceInfo> selectActiveDevice();
List<DeviceInfo> selectUnActiveDevice();
List<DeviceInfo> selectActiveDevice(String org);
List<DeviceInfo> selectUnActiveDevice(String org);
List<DeviceInfo> selectbyNo(String no);
List<Map<String,String>> getDeviceTypeCount(String org);
List<Map<String,String>> getDeviceRunStautsCount(String org);
}

View File

@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class AlarmInfoServiceImpl implements AlarmInfoService {
@Autowired
@ -32,4 +34,14 @@ public class AlarmInfoServiceImpl implements AlarmInfoService {
return alarmInfoMapper.selectByParam(alarmInfo);
}
@Override
public List<Map<String, String>> getAlarmLevelCount(String org) {
return alarmInfoMapper.getAlarmLevelCount(org);
}
@Override
public int getCount(String org) {
return alarmInfoMapper.getCount(org);
}
}

View File

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class DeviceInfoServiceImpl implements DeviceInfoService {
@ -30,17 +31,27 @@ public class DeviceInfoServiceImpl implements DeviceInfoService {
}
@Override
public List<DeviceInfo> selectActiveDevice() {
return deviceInfoMapper.selectActiveDevices();
public List<DeviceInfo> selectActiveDevice(String org) {
return deviceInfoMapper.selectActiveDevices(org);
}
@Override
public List<DeviceInfo> selectUnActiveDevice() {
return deviceInfoMapper.selectUnActiveDevices();
public List<DeviceInfo> selectUnActiveDevice(String org) {
return deviceInfoMapper.selectUnActiveDevices(org);
}
@Override
public List<DeviceInfo> selectbyNo(String no) {
return deviceInfoMapper.selectByNo(no);
}
@Override
public List<Map<String, String>> getDeviceTypeCount(String org) {
return deviceInfoMapper.getDeviceTypeCount(org);
}
@Override
public List<Map<String, String>> getDeviceRunStautsCount(String org) {
return deviceInfoMapper.getDeviceRunStatusCount(org);
}
}

View File

@ -10,10 +10,12 @@
<arg column="alarm_status" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="alarm_level" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="alarm_res" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="org" javaType="java.lang.String" jdbcType="VARCHAR" />
</constructor>
</resultMap>
<sql id="Base_Column_List">
device_no, alarm_name, alarm_time, device_type, alarm_status, alarm_level, alarm_res
device_no, alarm_name, alarm_time, device_type, alarm_status, alarm_level, alarm_res,
org
</sql>
<select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
select
@ -30,10 +32,10 @@
<insert id="insert" parameterType="com.aiit.xiuos.model.AlarmInfo">
insert into alarm_info (device_no, alarm_name, alarm_time,
device_type, alarm_status, alarm_level,
alarm_res)
alarm_res, org)
values (#{deviceNo,jdbcType=VARCHAR}, #{alarmName,jdbcType=VARCHAR}, #{alarmTime,jdbcType=TIMESTAMP},
#{deviceType,jdbcType=VARCHAR}, #{alarmStatus,jdbcType=INTEGER}, #{alarmLevel,jdbcType=INTEGER},
#{alarmRes,jdbcType=VARCHAR})
#{alarmRes,jdbcType=VARCHAR}, #{org,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.aiit.xiuos.model.AlarmInfo">
insert into alarm_info
@ -59,6 +61,9 @@
<if test="alarmRes != null">
alarm_res,
</if>
<if test="org != null">
org,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceNo != null">
@ -82,6 +87,9 @@
<if test="alarmRes != null">
#{alarmRes,jdbcType=VARCHAR},
</if>
<if test="org != null">
#{org,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.aiit.xiuos.model.AlarmInfo">
@ -102,6 +110,9 @@
<if test="alarmRes != null">
alarm_res = #{alarmRes,jdbcType=VARCHAR},
</if>
<if test="org != null">
org = #{org,jdbcType=VARCHAR},
</if>
</set>
where device_no = #{deviceNo,jdbcType=VARCHAR}
and alarm_name = #{alarmName,jdbcType=VARCHAR}
@ -112,31 +123,31 @@
device_type = #{deviceType,jdbcType=VARCHAR},
alarm_status = #{alarmStatus,jdbcType=INTEGER},
alarm_level = #{alarmLevel,jdbcType=INTEGER},
alarm_res = #{alarmRes,jdbcType=VARCHAR}
alarm_res = #{alarmRes,jdbcType=VARCHAR},
org = #{org,jdbcType=VARCHAR}
where device_no = #{deviceNo,jdbcType=VARCHAR}
and alarm_name = #{alarmName,jdbcType=VARCHAR}
</update>
<select id="selectByParam" parameterType="com.aiit.xiuos.model.AlarmInfo" resultMap="BaseResultMap">
select * from alarm_info where 1=1
<if test="deviceNo != null">
and device_no = #{deviceNo,jdbcType=VARCHAR}
</if>
<if test="alarmName != null">
and alarm_name = #{alarmName,jdbcType=VARCHAR}
</if>
<if test="alarmTime != null">
and alarm_time = #{alarmTime,jdbcType=TIMESTAMP}
</if>
<if test="deviceType != null">
and device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if test="alarmStatus != null">
and alarm_status = #{alarmStatus,jdbcType=INTEGER}
</if>
<if test="alarmLevel != null">
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</if>
order by alarm_time desc;
select * from alarm_info where org= #{org,jdbcType=VARCHAR}
<if test="deviceNo != null">
and device_no = #{deviceNo,jdbcType=VARCHAR}
</if>
<if test="alarmName != null">
and alarm_name = #{alarmName,jdbcType=VARCHAR}
</if>
<if test="alarmTime != null">
and alarm_time = #{alarmTime,jdbcType=TIMESTAMP}
</if>
<if test="deviceType != null">
and device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if test="alarmStatus != null">
and alarm_status = #{alarmStatus,jdbcType=INTEGER}
</if>
<if test="alarmLevel != null">
and alarm_level = #{alarmLevel,jdbcType=INTEGER}
</if>
order by alarm_time desc;
</select>
</mapper>

View File

@ -27,23 +27,25 @@
<arg column="privateserveraddr" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="privateserverport" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="privateserverusername" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="org" javaType="java.lang.String" jdbcType="VARCHAR" />
</constructor>
</resultMap>
<sql id="Base_Column_List">
id, no, productname, type, activestatus, updatetime, devicedesc, runstatus, statusdesc,
kernel, webversion, ipaddr, netmask, gateway, dnsserver0, dnsserver1, topic, serveraddr,
serverport, username, clientid, privateserveraddr, privateserverport, privateserverusername
serverport, username, clientid, privateserveraddr, privateserverport, privateserverusername,
org
</sql>
<select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from device_info
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
and no = #{no,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="map">
delete from device_info
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
and no = #{no,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.aiit.xiuos.model.DeviceInfo">
@ -54,17 +56,17 @@
netmask, gateway, dnsserver0,
dnsserver1, topic, serveraddr,
serverport, username, clientid,
privateserveraddr, privateserverport, privateserverusername
)
values (#{id,jdbcType=INTEGER}, #{no,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR},
privateserveraddr, privateserverport, privateserverusername,
org)
values (#{id,jdbcType=VARCHAR}, #{no,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{activestatus,jdbcType=INTEGER}, #{updatetime,jdbcType=VARCHAR},
#{devicedesc,jdbcType=VARCHAR}, #{runstatus,jdbcType=INTEGER}, #{statusdesc,jdbcType=VARCHAR},
#{kernel,jdbcType=VARCHAR}, #{webversion,jdbcType=VARCHAR}, #{ipaddr,jdbcType=VARCHAR},
#{netmask,jdbcType=VARCHAR}, #{gateway,jdbcType=VARCHAR}, #{dnsserver0,jdbcType=VARCHAR},
#{dnsserver1,jdbcType=VARCHAR}, #{topic,jdbcType=VARCHAR}, #{serveraddr,jdbcType=VARCHAR},
#{serverport,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{clientid,jdbcType=INTEGER},
#{privateserveraddr,jdbcType=VARCHAR}, #{privateserverport,jdbcType=VARCHAR}, #{privateserverusername,jdbcType=VARCHAR}
)
#{serverport,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{clientid,jdbcType=VARCHAR},
#{privateserveraddr,jdbcType=VARCHAR}, #{privateserverport,jdbcType=VARCHAR}, #{privateserverusername,jdbcType=VARCHAR},
#{org,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.aiit.xiuos.model.DeviceInfo">
insert into device_info
@ -141,10 +143,13 @@
<if test="privateserverusername != null">
privateserverusername,
</if>
<if test="org != null">
org,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
#{id,jdbcType=VARCHAR},
</if>
<if test="no != null">
#{no,jdbcType=VARCHAR},
@ -204,7 +209,7 @@
#{username,jdbcType=VARCHAR},
</if>
<if test="clientid != null">
#{clientid,jdbcType=INTEGER},
#{clientid,jdbcType=VARCHAR},
</if>
<if test="privateserveraddr != null">
#{privateserveraddr,jdbcType=VARCHAR},
@ -215,6 +220,9 @@
<if test="privateserverusername != null">
#{privateserverusername,jdbcType=VARCHAR},
</if>
<if test="org != null">
#{org,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.aiit.xiuos.model.DeviceInfo">
@ -275,7 +283,7 @@
username = #{username,jdbcType=VARCHAR},
</if>
<if test="clientid != null">
clientid = #{clientid,jdbcType=INTEGER},
clientid = #{clientid,jdbcType=VARCHAR},
</if>
<if test="privateserveraddr != null">
privateserveraddr = #{privateserveraddr,jdbcType=VARCHAR},
@ -286,8 +294,11 @@
<if test="privateserverusername != null">
privateserverusername = #{privateserverusername,jdbcType=VARCHAR},
</if>
<if test="org != null">
org = #{org,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=VARCHAR}
and no = #{no,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.aiit.xiuos.model.DeviceInfo">
@ -310,11 +321,20 @@
serveraddr = #{serveraddr,jdbcType=VARCHAR},
serverport = #{serverport,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
clientid = #{clientid,jdbcType=INTEGER},
clientid = #{clientid,jdbcType=VARCHAR},
privateserveraddr = #{privateserveraddr,jdbcType=VARCHAR},
privateserverport = #{privateserverport,jdbcType=VARCHAR},
privateserverusername = #{privateserverusername,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
privateserverusername = #{privateserverusername,jdbcType=VARCHAR},
org = #{org,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
and no = #{no,jdbcType=VARCHAR}
</update>
<select id="getDeviceTypeCount" parameterType="map" resultType="java.util.Map">
select type,count(type) from device_info where org = #{org,jdbcType=VARCHAR} GROUP BY type ;
</select>
<select id="getDeviceRunStatusCount" parameterType="map" resultType="java.util.Map">
select d.runstatus ,count(d.runstatus) from device_info d where org = #{org,jdbcType=VARCHAR} GROUP BY d.runstatus ;
</select>
</mapper>