Commit 1f7a0a80 authored by zhangjianqian's avatar zhangjianqian

用户安全监控用户数量查询修改

parent 8e63a301
...@@ -40,6 +40,8 @@ public class TDeviceInfoController extends BaseController ...@@ -40,6 +40,8 @@ public class TDeviceInfoController extends BaseController
@Autowired @Autowired
private ITDetectorInfoService itDetectorInfoService; private ITDetectorInfoService itDetectorInfoService;
@Autowired
private ITDetectorUserService itDetectorUserService;
/** /**
* 查询设备信息列表 * 查询设备信息列表
...@@ -217,6 +219,8 @@ public class TDeviceInfoController extends BaseController ...@@ -217,6 +219,8 @@ public class TDeviceInfoController extends BaseController
{ {
Map<String,Object> map = itDetectorInfoService.selectDetectorNum(enterpriseId); Map<String,Object> map = itDetectorInfoService.selectDetectorNum(enterpriseId);
Map<String,Object> map1 =tDeviceInfoService.selectDeviceNum(enterpriseId); Map<String,Object> map1 =tDeviceInfoService.selectDeviceNum(enterpriseId);
Map<String,Object> map2 =itDetectorUserService.selectUserNum();
map.putAll(map2);
map.putAll(map1); map.putAll(map1);
return AjaxResult.success(map); return AjaxResult.success(map);
} }
......
...@@ -84,4 +84,10 @@ public interface TDetectorUserMapper ...@@ -84,4 +84,10 @@ public interface TDetectorUserMapper
* @return 结果 * @return 结果
*/ */
public int deleteTDetectorUserByIds(Long[] userIds); public int deleteTDetectorUserByIds(Long[] userIds);
/**
* 查询用户数量
* @return
*/
public Map<String,Object> selectUserNum();
} }
...@@ -92,4 +92,10 @@ public interface ITDetectorUserService ...@@ -92,4 +92,10 @@ public interface ITDetectorUserService
* @return 结果 * @return 结果
*/ */
public int deleteTDetectorUserById(Long userId); public int deleteTDetectorUserById(Long userId);
/**
* 查询用户数量
* @return
*/
public Map<String,Object> selectUserNum();
} }
...@@ -211,4 +211,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -211,4 +211,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
{ {
return tDetectorUserMapper.deleteTDetectorUserById(userId); return tDetectorUserMapper.deleteTDetectorUserById(userId);
} }
/**
* 用户数量
* @return
*/
public Map<String,Object> selectUserNum(){
return tDetectorUserMapper.selectUserNum();
}
} }
...@@ -258,8 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -258,8 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="selectDetectorNum" resultType="java.util.HashMap"> <select id="selectDetectorNum" resultType="java.util.HashMap">
SELECT IFNULL(SUM(IF(detector_status=0,1,0)),0) AS changNum,IFNULL(SUM(detector_status=1),0) AS liNum, SELECT IFNULL(SUM(IF(detector_status=0,1,0)),0) AS changNum,IFNULL(SUM(detector_status=1),0) AS liNum,
IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum , IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum
(SELECT COUNT(user_id) FROM t_detector_user WHERE is_del = 0) AS userNum
FROM t_detector_info WHERE is_del = 0 FROM t_detector_info WHERE is_del = 0
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -164,4 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -164,4 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userId} #{userId}
</foreach> </foreach>
</delete> </delete>
<select id="selectUserNum" resultType="java.util.HashMap">
SELECT SUM(IF(user_type=1,1,0)) AS juminNum,SUM(IF(user_type=2,1,0)) AS shangNum,
SUM(IF(user_type=3,1,0)) AS gongNum FROM t_detector_user WHERE is_del = 0
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment