DeviceStatusMapper.xml 818 B

12345678910111213141516
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.xy.mapper.DeviceStatusMapper">
  4. <!-- 统计状态数量 -->
  5. <select id="statusCount" resultType="com.xy.mapper.entity.DeviceStatusCount">
  6. select
  7. (select count(*) busy_state from device_info where busy_state = 1) busyState,
  8. (select count(*) net_state from device_status where net_state = 0) netState,
  9. (select count(*) device_state from device_status where device_state = 1) deviceState,
  10. (select count(*) active_state from device_info where active_state = 1) activeState,
  11. (select count(*) temp_state from device_status where temp_state = 1) tempState
  12. from dual
  13. </select>
  14. </mapper>