Merge remote-tracking branch 'origin/master'
| | |
| | | package com.ycl.platform.domain.entity; |
| | | |
| | | import annotation.Excel; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.system.entity.BaseEntity; |
| | | |
| | |
| | | @Excel(name = "类型编码 : [131.摄像机编码;132.网络摄像机编码;]") |
| | | private Long lxbm; |
| | | |
| | | @Excel(name = "异常原因") |
| | | private String reason; |
| | | |
| | | @Excel(name ="异常恢复标识") |
| | | private Long recovery; |
| | | |
| | | @Excel(name = "异常恢复时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date recoveryTime; |
| | | @TableField(exist = false) |
| | | private Integer recovery; |
| | | |
| | | private Long deptId; |
| | | |
| | |
| | | return installedTime; |
| | | } |
| | | |
| | | public Date getRecoveryTime() { |
| | | return recoveryTime; |
| | | } |
| | | |
| | | public void setRecoveryTime(Date recoveryTime) { |
| | | this.recoveryTime = recoveryTime; |
| | | } |
| | | |
| | | public Long getRecovery() { |
| | | public Integer getRecovery() { |
| | | return recovery; |
| | | } |
| | | |
| | | public void setRecovery(Long recovery) { |
| | | public void setRecovery(Integer recovery) { |
| | | this.recovery = recovery; |
| | | } |
| | | |
| | | public String getReason() { |
| | | return reason; |
| | | } |
| | | |
| | | public void setReason(String reason) { |
| | | this.reason = reason; |
| | | } |
| | | |
| | | |
| | | |
| | | public void setId(Long id) |
| | | { |
| | |
| | | ", cameraDept='" + cameraDept + '\'' + |
| | | ", hybm='" + hybm + '\'' + |
| | | ", lxbm=" + lxbm + |
| | | ", reason='" + reason + '\'' + |
| | | ", recovery=" + recovery + |
| | | ", recoveryTime=" + recoveryTime + |
| | | ", deptId=" + deptId + |
| | | '}'; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ycl.platform.base.AbsEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 运维点位 |
| | |
| | | @TableField("point_tag") |
| | | private String pointTag; |
| | | |
| | | @TableField("reason") |
| | | private String reason; |
| | | |
| | | @TableField("recovery") |
| | | private Integer recovery; |
| | | |
| | | @TableField("recovery_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date recoveryTime; |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取视频统计 |
| | | * @param cameraFunType 类型 |
| | | * @param tMonitor 条件 |
| | | * @return 统计数 |
| | | */ |
| | | Map<String, String> getVideoCount(TMonitor tMonitor); |
| | | |
| | | Map<String, String> recoveryException(); |
| | | Map<String, String> recoveryException(String time); |
| | | |
| | | /** |
| | | * 获取恢复异常持续关注设备 |
| | | * @return 设备 |
| | | */ |
| | | List<TMonitorVO> selectRecoveryMonitor(String time); |
| | | } |
| | |
| | | /** |
| | | * 获取指定摄像头功能类型下的视频数量。 |
| | | * |
| | | * @param cameraFunType 摄像头功能类型,用于筛选视频。 |
| | | * @param tMonitor 条件 |
| | | * @return 返回一个包含视频数量的Map对象,其中key为统计指标,value为对应功能类型下的统计数量。 |
| | | */ |
| | | Map<String, String> getVideoCount(TMonitor tMonitor); |
| | |
| | | * @return |
| | | */ |
| | | Result select(String keyword); |
| | | |
| | | /** |
| | | * 批量同步状态 |
| | | * |
| | | * @param pointIds 点位id |
| | | * @param recovery 状态 |
| | | * @return 数量 |
| | | */ |
| | | boolean updateRecovery(List<Integer> pointIds, int recovery); |
| | | } |
| | |
| | | import com.ycl.platform.domain.vo.TMonitorVO; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import com.ycl.system.service.ISysConfigService; |
| | | import com.ycl.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 设备资产Service业务层处理 |
| | |
| | | { |
| | | @Autowired |
| | | private TMonitorMapper tMonitorMapper; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * 查询设备资产 |
| | |
| | | @DataScope(deptAlias = "d",userAlias = "u") |
| | | public List<TMonitorVO> selectTMonitorList(TMonitor tMonitor) |
| | | { |
| | | return tMonitorMapper.selectTMonitorList(tMonitor); |
| | | List<TMonitorVO> monitors = tMonitorMapper.selectTMonitorList(tMonitor); |
| | | if (Objects.equals(tMonitor.getRecovery(), 1)) { |
| | | String time = configService.selectConfigByKey("abnormal.equipment.continuous.attention.time"); |
| | | if (StringUtils.isBlank(time)) { |
| | | throw new RuntimeException("请配置异常设备连续关注时间"); |
| | | } |
| | | List<TMonitorVO> recoveryMonitors = tMonitorMapper.selectRecoveryMonitor(time); |
| | | monitors.addAll(recoveryMonitors); |
| | | } |
| | | return monitors; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public Map<String, String> recoveryException() { |
| | | return tMonitorMapper.recoveryException(); |
| | | String time = configService.selectConfigByKey("abnormal.equipment.continuous.attention.time"); |
| | | return tMonitorMapper.recoveryException(time); |
| | | } |
| | | } |
| | |
| | | import com.ycl.platform.service.NotifyService; |
| | | import com.ycl.platform.service.WorkOrderAuditingRecordService; |
| | | import com.ycl.platform.service.WorkOrderService; |
| | | import com.ycl.platform.service.YwPointService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.system.model.LoginUser; |
| | | import com.ycl.system.page.PageUtil; |
| | |
| | | import com.ycl.utils.SecurityUtils; |
| | | import com.ycl.utils.redis.RedisCache; |
| | | import com.ycl.utils.uuid.IdUtils; |
| | | import constant.PointConfigConstants; |
| | | import enumeration.general.*; |
| | | import enumeration.general.NotifyTypeEnum; |
| | | import enumeration.general.UrgentLevelEnum; |
| | | import enumeration.general.WorkOrderDistributeWayEnum; |
| | | import enumeration.general.WorkOrderStatusEnum; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements WorkOrderService { |
| | | |
| | | private final WorkOrderMapper workOrderMapper; |
| | | private final YwUnitMapper ywUnitMapper; |
| | | private final YwPeopleMapper ywPeopleMapper; |
| | | private final YwPointService ywPointService; |
| | | private final WorkOrderAuditingRecordMapper workOrderAuditingRecordMapper; |
| | | private final WorkOrderAuditingRecordService workOrderAuditingRecordService; |
| | | private final WorkOrderYwConditionRecordMapper workOrderYwConditionRecordMapper; |
| | |
| | | UrgentLevelEnum.WARNING, |
| | | workOrder.getWorkOrderNo()); |
| | | notifyService.save(notify); |
| | | // 同步点位状态 |
| | | if (form.getAuditingResult() == WorkOrderStatusEnum.AUDITING_SUCCESS) { |
| | | ywPointService.updateRecovery(Collections.singletonList(workOrder.getPointId()), 0); |
| | | } |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Result distributeFast(DistributeWorkOrderVO data) { |
| | | // 获取当前时间 |
| | | LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault()); |
| | | data.setEnd(now); |
| | | switch (data.getFastWay()) { |
| | | case LAST_HALF_HOUR: |
| | | data.setStart(now.minusMinutes(30)); |
| | | data.setEnd(now); |
| | | break; |
| | | case LAST_HOUR: |
| | | data.setStart(now.minusHours(1)); |
| | | data.setEnd(now); |
| | | break; |
| | | case LAST_TWO_HOUR: |
| | | data.setStart(now.minusHours(2)); |
| | | data.setEnd(now); |
| | | break; |
| | | case LAST_DAY: |
| | | data.setStart(now.minusDays(1)); |
| | | data.setEnd(now); |
| | | break; |
| | | } |
| | | |
| | | // 查询符合条件的工单 |
| | | List<Integer> ids = new LambdaQueryChainWrapper<>(baseMapper) |
| | | List<WorkOrder> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .select(WorkOrder::getId, WorkOrder::getPointId) |
| | | .eq(WorkOrder::getStatus, WorkOrderStatusEnum.WAIT_DISTRIBUTE) |
| | | .eq(Objects.nonNull(data.getUnitId()), WorkOrder::getUnitId, data.getUnitId()) |
| | | .eq(WorkOrder::getErrorType, data.getErrorType()) |
| | | .between(WorkOrder::getCreateTime, data.getStart(), data.getEnd()) |
| | | .orderByDesc(WorkOrder::getCreateTime) |
| | | .last("limit " + data.getFastNumLimit()) |
| | | .list() |
| | | .stream() |
| | | .map(WorkOrder::getId) |
| | | .toList(); |
| | | .list(); |
| | | List<Integer> ids = list.stream().map(WorkOrder::getId).toList(); |
| | | List<Integer> pointIds = list.stream().map(WorkOrder::getPointId).toList(); |
| | | |
| | | if (ids.isEmpty()) { |
| | | return Result.error("没有符合条件的工单"); |
| | | } |
| | | if (!getDistributeLock()) { |
| | | return Result.error("此刻有人下发中,为避免冲突,请稍后重试"); |
| | | } |
| | | if (ids.isEmpty()) { return Result.error("没有符合条件的工单"); } |
| | | if (!getDistributeLock()) { return Result.error("此刻有人下发中,为避免冲突,请稍后重试"); } |
| | | try { |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .set(WorkOrder::getStatus, WorkOrderStatusEnum.DISTRIBUTED) |
| | | .in(WorkOrder::getId, ids) |
| | | .update(); |
| | | addDistributeRecord(ids, WorkOrderDistributeWayEnum.FAST_DISTRIBUTE); |
| | | // 同步点位状态 |
| | | ywPointService.updateRecovery(pointIds, 1); |
| | | return Result.ok("成功下发" + ids.size() + "条工单"); |
| | | } catch (Exception e) { |
| | | return Result.error("操作失败"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Result selectedIdsDistribute(DistributeWorkOrderQuery query) { |
| | | WorkOrderDistributeWayEnum distributeWayEnum = WorkOrderDistributeWayEnum.SELECTED_DISTRIBUTE; |
| | | if (!getDistributeLock()) { |
| | | return Result.error("此刻有人下发中,为避免冲突,请稍后重试"); |
| | | } |
| | | if (!getDistributeLock()) { return Result.error("此刻有人下发中,为避免冲突,请稍后重试"); } |
| | | try { |
| | | if (query.getIds().isEmpty()) { |
| | | query.setIds(new LambdaQueryChainWrapper<>(baseMapper) |
| | |
| | | .collect(Collectors.toList())); |
| | | distributeWayEnum = WorkOrderDistributeWayEnum.ALL_DISTRIBUTE; |
| | | } |
| | | if (query.getIds().isEmpty()) { |
| | | return Result.error("没有工单待下发"); |
| | | } |
| | | if (query.getIds().isEmpty()) { return Result.error("没有工单待下发"); } |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .set(WorkOrder::getStatus, WorkOrderStatusEnum.DISTRIBUTED) |
| | | .in(WorkOrder::getId, query.getIds()) |
| | | .update(); |
| | | addDistributeRecord(query.getIds(), distributeWayEnum); |
| | | // 同步点位状态 |
| | | List<Integer> pointIds = new LambdaQueryChainWrapper<>(baseMapper).select(WorkOrder::getPointId).in(WorkOrder::getId, query.getIds()).list().stream().map(WorkOrder::getPointId).toList(); |
| | | ywPointService.updateRecovery(pointIds, 1); |
| | | return Result.ok("成功下发" + query.getIds().size() + "条工单"); |
| | | } catch (Exception e) { |
| | | return Result.error("操作失败"); |
| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.base.BaseSelect; |
| | | import com.ycl.platform.domain.entity.Region; |
| | | import com.ycl.platform.domain.entity.YwPeople; |
| | | import com.ycl.platform.domain.entity.YwPoint; |
| | | import com.ycl.platform.domain.entity.YwUnit; |
| | | import com.ycl.platform.domain.form.BatchEditPointForm; |
| | | import com.ycl.platform.mapper.RegionMapper; |
| | | import com.ycl.platform.domain.form.YwPointForm; |
| | | import com.ycl.platform.domain.query.YwPointQuery; |
| | | import com.ycl.platform.domain.vo.YwPointVO; |
| | | import com.ycl.platform.mapper.YwPeopleMapper; |
| | | import com.ycl.platform.mapper.YwPointMapper; |
| | | import com.ycl.platform.mapper.YwUnitMapper; |
| | | import com.ycl.platform.service.YwPointService; |
| | | import com.ycl.platform.service.YwUnitService; |
| | | import com.ycl.system.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.form.YwPointForm; |
| | | import com.ycl.platform.domain.vo.YwPointVO; |
| | | import com.ycl.platform.domain.query.YwPointQuery; |
| | | import java.util.List; |
| | | |
| | | import com.ycl.system.entity.SysUser; |
| | | import com.ycl.system.mapper.SysDeptMapper; |
| | | import com.ycl.system.service.ISysDeptService; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.system.page.PageUtil; |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.SecurityUtils; |
| | | import enumeration.general.RegionLevelEnum; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | import java.util.ArrayList; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | /** |
| | | * 运维点位 服务实现类 |
| | |
| | | }).collect(Collectors.toList()); |
| | | return Result.ok().data(data); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateRecovery(List<Integer> pointIds, int recovery) { |
| | | return new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .in(YwPoint::getId, pointIds) |
| | | .set(YwPoint::getRecovery, recovery) |
| | | .set(recovery == 0, YwPoint::getRecoveryTime, DateUtils.getNowDate()) |
| | | .update(); |
| | | } |
| | | } |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectTMonitorVo"> |
| | | select id, serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, public_security, installed_time, management_unit, mu_contact_info, storage_days, monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format, camera_dept, hybm, lxbm, reason, recovery,recovery_time,dept_id from t_monitor |
| | | select id, serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, public_security, installed_time, management_unit, mu_contact_info, storage_days, monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format, camera_dept, hybm, lxbm from t_monitor |
| | | </sql> |
| | | |
| | | <select id="selectTMonitorList" resultType="com.ycl.platform.domain.vo.TMonitorVO"> |
| | | select id, serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, public_security, installed_time, management_unit, mu_contact_info, storage_days |
| | | , monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format, camera_dept, hybm, lxbm, reason, recovery,recovery_time,d.dept_name from t_monitor m |
| | | left join sys_dept d on m.dept_id = d.dept_id |
| | | select m.id, m.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, public_security, installed_time, management_unit, mu_contact_info, storage_days |
| | | , monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format, camera_dept, hybm, lxbm, d.dept_name from t_monitor m |
| | | left join t_yw_point p on m.serial_number = p.serial_number |
| | | left join sys_dept d on p.dept_id = d.dept_id |
| | | <where> |
| | | <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if> |
| | | <if test="serialNumber != null and serialNumber != ''"> and m.serial_number = #{serialNumber}</if> |
| | | <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
| | | <if test="siteType != null "> and site_type = #{siteType}</if> |
| | | <if test="macAddr != null and macAddr != ''"> and mac_addr = #{macAddr}</if> |
| | |
| | | <if test="cameraDept != null and cameraDept != ''"> and camera_dept = #{cameraDept}</if> |
| | | <if test="hybm != null and hybm != ''"> and hybm = #{hybm}</if> |
| | | <if test="lxbm != null "> and lxbm = #{lxbm}</if> |
| | | <if test="reason != null and reason != ''"> and reason = #{reason}</if> |
| | | <if test="recovery != null "> and recovery = #{recovery}</if> |
| | | <if test="recoveryTime != null "> and recovery_time = #{recoveryTime}</if> |
| | | <if test="deptId != null "> and m.dept_id = #{deptId}</if> |
| | | <if test="recovery != null "> and p.recovery = #{recovery}</if> |
| | | </where> |
| | | ${params.dataScope} |
| | | </select> |
| | |
| | | <if test="cameraDept != null">camera_dept,</if> |
| | | <if test="hybm != null">hybm,</if> |
| | | <if test="lxbm != null">lxbm,</if> |
| | | <if test="reason != null">reason,</if> |
| | | <if test="recovery != null">recovery,</if> |
| | | <if test="recoveryTime != null">recovery_time,</if> |
| | | <if test="deptId != null">dept_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if> |
| | |
| | | <if test="cameraDept != null">#{cameraDept},</if> |
| | | <if test="hybm != null">#{hybm},</if> |
| | | <if test="lxbm != null">#{lxbm},</if> |
| | | <if test="reason != null">#{reason},</if> |
| | | <if test="recovery != null">#{recovery},</if> |
| | | <if test="recoveryTime != null">#{recoveryTime},</if> |
| | | <if test="deptId != null">#{deptId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="cameraDept != null">camera_dept = #{cameraDept},</if> |
| | | <if test="hybm != null">hybm = #{hybm},</if> |
| | | <if test="lxbm != null">lxbm = #{lxbm},</if> |
| | | <if test="reason != null">reason = #{reason},</if> |
| | | <if test="recoveryTime != null">recovery_time = #{recoveryTime},</if> |
| | | <if test="deptId != null">dept_id = #{deptId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | SELECT count(*) AS totalPosts, |
| | | IFNULL(SUM(IF(on_state = 1, 1, 0)), 0) AS totalMembers, |
| | | IFNULL(SUM(IF(on_state = 2, 1, 0)), 0) AS postsPercentage, |
| | | -1 as noStore, |
| | | -1 as partStore, |
| | | IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage, |
| | | -1 as totalFace, |
| | | -1 as totalCar |
| | | IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage |
| | | FROM t_monitor m |
| | | left join sys_dept d on m.dept_id = d.dept_id |
| | | left join t_yw_point p on m.serial_number = p.serial_number |
| | | left join sys_dept d on p.dept_id = d.dept_id |
| | | <where> |
| | | camera_fun_type like concat('%', #{cameraFunType}, '%') |
| | | </where> |
| | |
| | | </select> |
| | | |
| | | <select id="recoveryException" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT count(*) AS totalPosts, |
| | | IFNULL(SUM(IF(on_state = 1, 1, 0)), 0) AS totalMembers, |
| | | IFNULL(SUM(IF(on_state = 2, 1, 0)), 0) AS postsPercentage, |
| | | IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage |
| | | FROM t_monitor |
| | | WHERE recovery = 1 |
| | | FROM t_monitor t |
| | | LEFT JOIN t_yw_point p ON t.serial_number = p.serial_number |
| | | WHERE p.recovery = 1 OR TIMESTAMPDIFF(DAY, p.recovery_time, NOW()) <= #{time} |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="selectRecoveryMonitor" resultType="com.ycl.platform.domain.vo.TMonitorVO"> |
| | | <![CDATA[ |
| | | SELECT t.id, p.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, public_security, installed_time, management_unit, mu_contact_info, storage_days, monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format, camera_dept, hybm, lxbm |
| | | FROM t_monitor t |
| | | LEFT JOIN t_yw_point p ON t.serial_number = p.serial_number |
| | | WHERE TIMESTAMPDIFF(DAY, p.recovery_time, NOW()) <= #{time} |
| | | ]]> |
| | | </select> |
| | | |
| | | </mapper> |