| | |
| | | import org.springblade.jfpt.healthcode.service.IhealthcodeService; |
| | | import org.springblade.jfpt.parcel.service.ParcelService; |
| | | import org.springblade.jfpt.parcel.util.DateUtils; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | |
| | | /** |
| | | * 一周警情统计 2021-3-16 arsn |
| | | * 主动报警统计 饼图展示 |
| | | * @param response |
| | | * @param conditionVo status 0:本日 1:本月 2:本月 |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectAlarmSum") |
| | | public R selectAlarmSum(HttpServletResponse response, ConditionVo conditionVo) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | //返回数据 |
| | | return R.data(alarmService.selectAlarmSum(conditionVo)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 一周警情统计(主动报警+被动报警类型(体温异常,红码,违禁品)) 2021-3-16 arsn 柱状图展示 |
| | | * @param response |
| | | * @return |
| | | */ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.jfpt.alarm.entity.Alarm; |
| | | import org.springblade.jfpt.alarm.vo.AlarmVO; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | List<Integer> selectAlarmData(); |
| | | |
| | | /** |
| | | * 主动报警统计 饼图展示 |
| | | * @param conditionVo status 0:本日 1:本月 2:本月 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectAlarmSum(@Param("conditionVo") ConditionVo conditionVo); |
| | | } |
| | |
| | | on |
| | | a.click_date = b.datetime |
| | | </select> |
| | | |
| | | |
| | | <!--查询本日,本周,本月 主动报警的数量--> |
| | | <select id="selectAlarmSum" resultType="java.util.HashMap"> |
| | | select sa.alarmType name,IFNULL(sb.count, 0) value from (select alarmType from sys_alarm GROUP BY alarmType) sa |
| | | left join |
| | | ( select alarmType,count(*) count from sys_alarm |
| | | where 1=1 |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |
| | | <if test="conditionVo.status==1"> |
| | | and YEARWEEK(date_format(alarmTime,'%Y-%m-%d'),1) = YEARWEEK(now(),1) |
| | | </if> |
| | | <if test="conditionVo.status==2"> |
| | | and date_format(alarmTime,'%Y%m') = date_format(now(),'%Y%m') |
| | | </if> |
| | | group by alarmType |
| | | ) sb |
| | | on |
| | | sa.alarmType = sb.alarmType |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.jfpt.alarm.entity.Alarm; |
| | | import org.springblade.jfpt.alarm.vo.AlarmVO; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | Map<String, Object> selectAlarmData(); |
| | | |
| | | /** |
| | | * 主动报警统计 饼图展示 |
| | | * @param conditionVo status 0:本日 1:本月 2:本月 |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAlarmSum(ConditionVo conditionVo); |
| | | } |
| | |
| | | import org.springblade.jfpt.alarm.mapper.AlarmMapper; |
| | | import org.springblade.jfpt.alarm.service.IAlarmService; |
| | | import org.springblade.jfpt.alarm.vo.AlarmVO; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | |
| | | //返回数据 |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 主动报警统计 饼图展示 |
| | | * @param conditionVo status 0:本日 1:本月 2:本月 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectAlarmSum(ConditionVo conditionVo) { |
| | | //status 不为空时 |
| | | if (null!=conditionVo.getStatus()){ |
| | | return baseMapper.selectAlarmSum(conditionVo); |
| | | } |
| | | //返回数据 |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | //5.业主总数 |
| | | mapsu.put("value",suserCount); |
| | | mapsu.put("backgroundColor","#EE1D23"); |
| | | mapsu.put("backgroundColor","#00BFFF"); |
| | | mapsu.put("prefixText","用户数量"); |
| | | mapsu.put("suffixText","个"); |
| | | //数据存入集合 |
| | |
| | | int equipmentCount = 0; |
| | | long hearbeat = 0; |
| | | //遍历集合数据,对比心跳时间,得出在线的设备数量 |
| | | if (status==0){ |
| | | if (status==0 && equipmentVOS.size()>0){ |
| | | for (EquipmentVO e:equipmentVOS) { |
| | | try { |
| | | hearbeat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(e.getHeartbeat()).getTime(); |