forked from dyf/fys-Multi-tenant
merge upstream
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package com.fuyuanshen.app.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
@ -7,6 +9,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备分享业务对象 app_device_share
|
||||
*
|
||||
@ -35,10 +39,16 @@ public class AppDeviceShareBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 功能权限(1:灯光模式;2:激光模式;3:开机画面;4:人员信息登记;5:发送信息;6:产品信息)
|
||||
以逗号分隔
|
||||
* 以逗号分隔
|
||||
*/
|
||||
private String permission;
|
||||
|
||||
/**
|
||||
* 分享用户
|
||||
* share_user
|
||||
*/
|
||||
private String shareUser;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ -46,4 +56,11 @@ public class AppDeviceShareBo extends BaseEntity {
|
||||
|
||||
|
||||
private String smsCode;
|
||||
|
||||
/**
|
||||
* 分享时间
|
||||
*/
|
||||
private Date shareStartTime;
|
||||
private Date shareEndTime;
|
||||
|
||||
}
|
||||
|
||||
@ -18,5 +18,13 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface AppDeviceShareMapper extends BaseMapperPlus<AppDeviceShare, AppDeviceShareVo> {
|
||||
IPage<AppDeviceShareVo> otherDeviceShareList(@Param("bo") AppDeviceShareBo bo, Page<AppDeviceShareVo> page);
|
||||
|
||||
Page<AppDeviceShareVo> selectAppDeviceShareList(@Param("bo") AppDeviceShareBo bo,Page<AppDeviceShareVo> page);
|
||||
Page<AppDeviceShareVo> selectAppDeviceShareList(@Param("bo") AppDeviceShareBo bo, Page<AppDeviceShareVo> page);
|
||||
|
||||
/**
|
||||
* 查询设备分享列表(web)
|
||||
*
|
||||
* @param bo 设备分享
|
||||
* @return 设备分享
|
||||
*/
|
||||
Page<AppDeviceShareVo> selectWebDeviceShareList(@Param("bo") AppDeviceShareBo bo, Page<AppDeviceShareVo> page);
|
||||
}
|
||||
|
||||
@ -1,27 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuyuanshen.app.mapper.AppDeviceShareMapper">
|
||||
|
||||
<select id="otherDeviceShareList" resultType="com.fuyuanshen.app.domain.vo.AppDeviceShareVo">
|
||||
select d.device_name,
|
||||
d.device_mac,
|
||||
d.device_sn,
|
||||
d.device_imei,
|
||||
d.device_pic,
|
||||
dt.type_name,
|
||||
dt.communication_mode,
|
||||
dt.app_model_dictionary detailPageUrl,
|
||||
d.bluetooth_name,
|
||||
c.binding_time,
|
||||
ad.*,u.user_name otherPhonenumber
|
||||
from
|
||||
app_device_share ad
|
||||
left join device d on ad.device_id = d.id
|
||||
left join app_user u on ad.create_by = u.user_id
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
inner join app_device_bind_record c on d.id = c.device_id
|
||||
d.device_mac,
|
||||
d.device_sn,
|
||||
d.device_imei,
|
||||
d.device_pic,
|
||||
dt.type_name,
|
||||
dt.communication_mode,
|
||||
dt.app_model_dictionary detailPageUrl,
|
||||
d.bluetooth_name,
|
||||
c.binding_time,
|
||||
ad.*,
|
||||
u.user_name otherPhonenumber
|
||||
from app_device_share ad
|
||||
left join device d on ad.device_id = d.id
|
||||
left join app_user u on ad.create_by = u.user_id
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
inner join app_device_bind_record c on d.id = c.device_id
|
||||
where ad.phonenumber = #{bo.phonenumber}
|
||||
</select>
|
||||
<select id="selectAppDeviceShareList" resultType="com.fuyuanshen.app.domain.vo.AppDeviceShareVo">
|
||||
@ -47,4 +47,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and ad.device_id = #{bo.deviceId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询设备分享列表(web) -->
|
||||
<select id="selectWebDeviceShareList" resultType="com.fuyuanshen.app.domain.vo.AppDeviceShareVo">
|
||||
select *
|
||||
from
|
||||
app_device_share ad
|
||||
<where>
|
||||
<if test="bo.deviceId != null">
|
||||
and ad.device_id = #{bo.deviceId}
|
||||
</if>
|
||||
<if test="bo.shareUser != null">
|
||||
and ad.share_user = #{bo.shareUser}
|
||||
</if>
|
||||
<if test="criteria.shareStartTime != null and criteria.hareEndTime != null">
|
||||
and d.create_time between #{bo.shareStartTime} and #{bo.shareEndTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -25,6 +25,13 @@ public class Device extends TenantEntity {
|
||||
@Schema(title = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(title = "设备ID")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(title = "设备记录ID")
|
||||
@TableField(exist = false)
|
||||
private Long assignId;
|
||||
@ -153,6 +160,7 @@ public class Device extends TenantEntity {
|
||||
*/
|
||||
@Schema(title = "出厂日期")
|
||||
private Date productionDate;
|
||||
|
||||
/**
|
||||
* 在线状态(0离线,1在线)
|
||||
*/
|
||||
|
||||
@ -0,0 +1,99 @@
|
||||
package com.fuyuanshen.equipment.domain;
|
||||
|
||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 设备告警对象 device_alarm
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("device_alarm")
|
||||
public class DeviceAlarm extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 报警事项
|
||||
*/
|
||||
private String deviceAction;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
private String dataSource;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private Long deviceType;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
|
||||
*/
|
||||
private Long longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Long latitude;
|
||||
|
||||
/**
|
||||
* 报警位置
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
private Date finishTime;
|
||||
|
||||
/**
|
||||
* 报警持续时间
|
||||
*/
|
||||
private Long durationTime;
|
||||
|
||||
/**
|
||||
* 0已处理,1未处理
|
||||
*/
|
||||
private Long treatmentState;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
package com.fuyuanshen.equipment.domain;
|
||||
|
||||
import com.fuyuanshen.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 设备充放电记录对象 device_charge_discharge
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("device_charge_discharge")
|
||||
public class DeviceChargeDischarge extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录唯一标识
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备唯一标识
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 操作类型: 0 charge-充电, 1 discharge-放电
|
||||
*/
|
||||
private Long operationType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 起始电量百分比(0-100)
|
||||
*/
|
||||
private Long initialSoc;
|
||||
|
||||
/**
|
||||
* 结束电量百分比(0-100)
|
||||
*/
|
||||
private Long finalSoc;
|
||||
|
||||
/**
|
||||
* 充放电量(kWh)
|
||||
*/
|
||||
private Long energyKwh;
|
||||
|
||||
/**
|
||||
* 设备额定功率(kW)
|
||||
*/
|
||||
private Long powerRating;
|
||||
|
||||
/**
|
||||
* 电压(V)
|
||||
*/
|
||||
private Long voltage;
|
||||
|
||||
/**
|
||||
* 电流(A)
|
||||
*/
|
||||
private Long current;
|
||||
|
||||
/**
|
||||
* 温度(℃)
|
||||
*/
|
||||
private Long temperature;
|
||||
|
||||
/**
|
||||
* 当前状态
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
private String errorCode;
|
||||
|
||||
/**
|
||||
* 记录创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 记录更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@ -21,6 +21,12 @@ public class DeviceType extends TenantEntity {
|
||||
@Schema(title = "ID", hidden = true)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备类型ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long deviceTypeId;
|
||||
|
||||
@Schema(title = "客户号")
|
||||
private Long customerId;
|
||||
|
||||
|
||||
@ -0,0 +1,116 @@
|
||||
package com.fuyuanshen.equipment.domain.bo;
|
||||
|
||||
import com.fuyuanshen.common.core.validate.EditGroup;
|
||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||
import com.fuyuanshen.equipment.domain.DeviceAlarm;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备告警业务对象 device_alarm
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = DeviceAlarm.class, reverseConvertGenerate = false)
|
||||
public class DeviceAlarmBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@NotNull(message = "ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 报警事项
|
||||
* device_action
|
||||
*/
|
||||
private Integer deviceAction;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备MAC
|
||||
* device_mac
|
||||
*/
|
||||
private String deviceMac;
|
||||
|
||||
/**
|
||||
* 设备IMEI
|
||||
* device_imei
|
||||
*/
|
||||
private String deviceImei;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
private String dataSource;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
* device_type
|
||||
*/
|
||||
private Long deviceType;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Long longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Long latitude;
|
||||
|
||||
/**
|
||||
* 报警位置
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
private Date finishTime;
|
||||
|
||||
/**
|
||||
* 报警持续时间
|
||||
*/
|
||||
private Long durationTime;
|
||||
|
||||
/**
|
||||
* 报警查询时间
|
||||
*/
|
||||
private String queryTime1;
|
||||
private String queryTime2;
|
||||
|
||||
/**
|
||||
* 0已处理,1未处理
|
||||
*/
|
||||
private Integer treatmentState;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package com.fuyuanshen.equipment.domain.bo;
|
||||
|
||||
import com.fuyuanshen.common.core.validate.AddGroup;
|
||||
import com.fuyuanshen.common.core.validate.EditGroup;
|
||||
import com.fuyuanshen.equipment.domain.DeviceChargeDischarge;
|
||||
import com.fuyuanshen.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 设备充放电记录业务对象 device_charge_discharge
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = DeviceChargeDischarge.class, reverseConvertGenerate = false)
|
||||
public class DeviceChargeDischargeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 记录唯一标识
|
||||
*/
|
||||
@NotNull(message = "记录唯一标识不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备唯一标识
|
||||
*/
|
||||
@NotBlank(message = "设备唯一标识不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 操作类型: 0 charge-充电, 1 discharge-放电
|
||||
*/
|
||||
@NotNull(message = "操作类型: 0 charge-充电, 1 discharge-放电不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long operationType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 起始电量百分比(0-100)
|
||||
*/
|
||||
private Long initialSoc;
|
||||
|
||||
/**
|
||||
* 结束电量百分比(0-100)
|
||||
*/
|
||||
private Long finalSoc;
|
||||
|
||||
/**
|
||||
* 充放电量(kWh)
|
||||
*/
|
||||
private Long energyKwh;
|
||||
|
||||
/**
|
||||
* 设备额定功率(kW)
|
||||
*/
|
||||
private Long powerRating;
|
||||
|
||||
/**
|
||||
* 电压(V)
|
||||
*/
|
||||
private Long voltage;
|
||||
|
||||
/**
|
||||
* 电流(A)
|
||||
*/
|
||||
private Long current;
|
||||
|
||||
/**
|
||||
* 温度(℃)
|
||||
*/
|
||||
private Long temperature;
|
||||
|
||||
/**
|
||||
* 当前状态
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
private String errorCode;
|
||||
|
||||
/**
|
||||
* 记录创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 记录更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@ -20,6 +20,12 @@ public class InstructionRecordDto {
|
||||
* 设备IMEI
|
||||
*/
|
||||
private String deviceImei;
|
||||
|
||||
/**
|
||||
* content
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 操作时间-开始时间
|
||||
*/
|
||||
@ -29,4 +35,9 @@ public class InstructionRecordDto {
|
||||
* 操作时间-结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
private Long groupId;
|
||||
}
|
||||
|
||||
@ -101,16 +101,16 @@ public class DeviceQueryCriteria extends BaseEntity {
|
||||
*/
|
||||
private Boolean isAdmin = false;
|
||||
|
||||
|
||||
/**
|
||||
* 设备所属分组
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
|
||||
/**
|
||||
* 设备地区
|
||||
*/
|
||||
private String area;
|
||||
|
||||
private String content;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 报警信息
|
||||
*
|
||||
* @author: 默苍璃
|
||||
* @date: 2025-09-0114:24
|
||||
*/
|
||||
@Data
|
||||
public class AlarmInformationVo {
|
||||
|
||||
/**
|
||||
* 报警总数
|
||||
*/
|
||||
private Integer alarmsTotal = 0;
|
||||
|
||||
/**
|
||||
* 总处理报警
|
||||
*/
|
||||
private Integer processingAlarm = 0;
|
||||
|
||||
/**
|
||||
* 强制报警
|
||||
*/
|
||||
private Integer alarmForced = 0;
|
||||
|
||||
/**
|
||||
* 撞击闯入
|
||||
*/
|
||||
private Integer intrusionImpact = 0;
|
||||
|
||||
/**
|
||||
* 手动报警
|
||||
*/
|
||||
private Integer alarmManual = 0;
|
||||
|
||||
/**
|
||||
* 电子围栏
|
||||
*/
|
||||
private Integer fenceElectronic = 0;
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据总览
|
||||
*
|
||||
* @author: 默苍璃
|
||||
* @date: 2025-09-0114:24
|
||||
*/
|
||||
@Data
|
||||
public class DataOverviewVo {
|
||||
|
||||
/**
|
||||
* 设备数据量
|
||||
*/
|
||||
private Integer devicesNumber = 0;
|
||||
|
||||
/**
|
||||
* 在线设备
|
||||
*/
|
||||
private Integer equipmentOnline = 0;
|
||||
|
||||
/**
|
||||
* 新增绑定设备
|
||||
*/
|
||||
private Integer bindingNew = 0;
|
||||
|
||||
/**
|
||||
* 异常设备
|
||||
*/
|
||||
private Integer equipmentAbnormal = 0;
|
||||
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fuyuanshen.equipment.domain.DeviceAlarm;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import com.fuyuanshen.common.excel.annotation.ExcelDictFormat;
|
||||
import com.fuyuanshen.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 设备告警视图对象 device_alarm
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-28
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = DeviceAlarm.class)
|
||||
public class DeviceAlarmVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ExcelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@ExcelProperty(value = "设备ID")
|
||||
private Long deviceId;
|
||||
|
||||
/**
|
||||
* 报警事项
|
||||
* 0-强制报警,1-撞击闯入,2-手动报警,3-电子围栏告警,4-强制告警
|
||||
*/
|
||||
@ExcelProperty(value = "报警事项")
|
||||
private Integer deviceAction;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备MAC
|
||||
*/
|
||||
private String deviceMac;
|
||||
|
||||
/**
|
||||
* 设备IMEI
|
||||
*/
|
||||
private String deviceImei;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@ExcelProperty(value = "数据来源")
|
||||
private String dataSource;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@ExcelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@ExcelProperty(value = "设备类型")
|
||||
private Long deviceType;
|
||||
private String deviceTypeName;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ExcelProperty(value = "经度")
|
||||
private Long longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@ExcelProperty(value = "纬度")
|
||||
private Long latitude;
|
||||
|
||||
/**
|
||||
* 报警位置
|
||||
*/
|
||||
@ExcelProperty(value = "报警位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 报警开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "报警开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 报警结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "报警结束时间")
|
||||
private Date finishTime;
|
||||
|
||||
/**
|
||||
* 报警持续时间
|
||||
*/
|
||||
@ExcelProperty(value = "报警持续时间")
|
||||
private String durationTime;
|
||||
|
||||
/**
|
||||
* 0已处理,1未处理
|
||||
*/
|
||||
@ExcelProperty(value = "0已处理,1未处理")
|
||||
private Integer treatmentState;
|
||||
|
||||
/**
|
||||
* 设备图片
|
||||
* device_pic
|
||||
*/
|
||||
@Schema(name = "设备图片")
|
||||
private String devicePic;
|
||||
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fuyuanshen.equipment.domain.DeviceChargeDischarge;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import com.fuyuanshen.common.excel.annotation.ExcelDictFormat;
|
||||
import com.fuyuanshen.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设备充放电记录视图对象 device_charge_discharge
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = DeviceChargeDischarge.class)
|
||||
public class DeviceChargeDischargeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录唯一标识
|
||||
*/
|
||||
@ExcelProperty(value = "记录唯一标识")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备唯一标识
|
||||
*/
|
||||
@ExcelProperty(value = "设备唯一标识")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 操作类型: 0 charge-充电, 1 discharge-放电
|
||||
*/
|
||||
@ExcelProperty(value = "操作类型: 0 charge-充电, 1 discharge-放电")
|
||||
private Long operationType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 起始电量百分比(0-100)
|
||||
*/
|
||||
@ExcelProperty(value = "起始电量百分比(0-100)")
|
||||
private Long initialSoc;
|
||||
|
||||
/**
|
||||
* 结束电量百分比(0-100)
|
||||
*/
|
||||
@ExcelProperty(value = "结束电量百分比(0-100)")
|
||||
private Long finalSoc;
|
||||
|
||||
/**
|
||||
* 充放电量(kWh)
|
||||
*/
|
||||
@ExcelProperty(value = "充放电量(kWh)")
|
||||
private Long energyKwh;
|
||||
|
||||
/**
|
||||
* 设备额定功率(kW)
|
||||
*/
|
||||
@ExcelProperty(value = "设备额定功率(kW)")
|
||||
private Long powerRating;
|
||||
|
||||
/**
|
||||
* 电压(V)
|
||||
*/
|
||||
@ExcelProperty(value = "电压(V)")
|
||||
private Long voltage;
|
||||
|
||||
/**
|
||||
* 电流(A)
|
||||
*/
|
||||
@ExcelProperty(value = "电流(A)")
|
||||
private Long current;
|
||||
|
||||
/**
|
||||
* 温度(℃)
|
||||
*/
|
||||
@ExcelProperty(value = "温度(℃)")
|
||||
private Long temperature;
|
||||
|
||||
/**
|
||||
* 当前状态
|
||||
*/
|
||||
@ExcelProperty(value = "当前状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 错误代码
|
||||
*/
|
||||
@ExcelProperty(value = "错误代码")
|
||||
private String errorCode;
|
||||
|
||||
/**
|
||||
* 记录创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "记录创建时间")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 记录更新时间
|
||||
*/
|
||||
@ExcelProperty(value = "记录更新时间")
|
||||
private Date updatedAt;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备分类
|
||||
*
|
||||
* @author: 默苍璃
|
||||
* @date: 2025-09-0114:24
|
||||
*/
|
||||
@Data
|
||||
public class EquipmentClassificationVo {
|
||||
|
||||
/**
|
||||
* 4G设备
|
||||
*/
|
||||
private Integer equipment4G = 0;
|
||||
|
||||
/**
|
||||
* 蓝牙设备
|
||||
*/
|
||||
private Integer deviceBluetooth = 0;
|
||||
|
||||
/**
|
||||
* 4G & 蓝牙 设备
|
||||
*/
|
||||
private Integer devices4GAndBluetooth = 0;
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ -8,25 +9,31 @@ public class InstructionRecordVo {
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@ExcelProperty(value = "设备型号")
|
||||
private String deviceType;
|
||||
|
||||
/**
|
||||
* 操作模块
|
||||
*/
|
||||
@ExcelProperty(value = "操作模块")
|
||||
private String deviceAction;
|
||||
|
||||
/**
|
||||
* 操作内容
|
||||
*/
|
||||
@ExcelProperty(value = "操作内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@ExcelProperty(value = "操作时间")
|
||||
private String createTime;
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LocationHistoryDetailVo {
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@ExcelProperty(value = "日期")
|
||||
private String date;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 初始地点
|
||||
*/
|
||||
@ExcelProperty(value = "初始地点")
|
||||
private String startLocation;
|
||||
|
||||
/**
|
||||
* 结束地点
|
||||
*/
|
||||
@ExcelProperty(value = "结束地点")
|
||||
private String endLocation;
|
||||
|
||||
/**
|
||||
* 轨迹详情
|
||||
*/
|
||||
@ExcelProperty(value = "轨迹详情")
|
||||
private List<Object> detailList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LocationHistoryVo {
|
||||
private Long id;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
|
||||
@ExcelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String deviceType;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@ExcelProperty(value = "设备型号")
|
||||
private String deviceTypeName;
|
||||
|
||||
/**
|
||||
* 设备IMEI
|
||||
*/
|
||||
@ExcelProperty(value = "设备IMEI")
|
||||
private String deviceImei;
|
||||
|
||||
/**
|
||||
* 设备MAC
|
||||
*/
|
||||
@ExcelProperty(value = "设备MAC")
|
||||
private String deviceMac;
|
||||
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.fuyuanshen.equipment.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package com.fuyuanshen.equipment.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import com.fuyuanshen.equipment.domain.DeviceAlarm;
|
||||
import com.fuyuanshen.equipment.domain.bo.DeviceAlarmBo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
|
||||
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 设备告警Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-28
|
||||
*/
|
||||
public interface DeviceAlarmMapper extends BaseMapperPlus<DeviceAlarm, DeviceAlarmVo> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备告警列表
|
||||
*
|
||||
* @param bo 设备告警
|
||||
* @return 设备告警
|
||||
*/
|
||||
Page<DeviceAlarmVo> selectVoPage( Page pageQuery,@Param("bo") DeviceAlarmBo bo);
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.fuyuanshen.equipment.mapper;
|
||||
|
||||
import com.fuyuanshen.equipment.domain.DeviceChargeDischarge;
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceChargeDischargeVo;
|
||||
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 设备充放电记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface DeviceChargeDischargeMapper extends BaseMapperPlus<DeviceChargeDischarge, DeviceChargeDischargeVo> {
|
||||
|
||||
}
|
||||
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuyuanshen.equipment.domain.Device;
|
||||
import com.fuyuanshen.equipment.domain.dto.InstructionRecordDto;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.LocationHistoryVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.WebDeviceVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -71,4 +73,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
AppDeviceVo getDeviceInfo(@Param("deviceMac") String deviceMac);
|
||||
|
||||
Page<WebDeviceVo> queryWebDeviceList(Page<Object> build,@Param("criteria") DeviceQueryCriteria criteria);
|
||||
|
||||
Page<LocationHistoryVo> getLocationHistory(Page<Object> build, @Param("bo") InstructionRecordDto criteria);
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.fuyuanshen.equipment.domain.form.DeviceForm;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DataOverviewVo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -115,4 +116,10 @@ public interface DeviceService extends IService<Device> {
|
||||
*/
|
||||
int webUnBindDevice(Long id);
|
||||
|
||||
/**
|
||||
* 获取数据总览
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
DataOverviewVo getDataOverview();
|
||||
}
|
||||
|
||||
@ -0,0 +1,68 @@
|
||||
package com.fuyuanshen.equipment.service;
|
||||
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
|
||||
import com.fuyuanshen.equipment.domain.bo.DeviceAlarmBo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备告警Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-28
|
||||
*/
|
||||
public interface IDeviceAlarmService {
|
||||
|
||||
/**
|
||||
* 查询设备告警
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 设备告警
|
||||
*/
|
||||
DeviceAlarmVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询设备告警列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 设备告警分页列表
|
||||
*/
|
||||
TableDataInfo<DeviceAlarmVo> queryPageList(DeviceAlarmBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的设备告警列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 设备告警列表
|
||||
*/
|
||||
List<DeviceAlarmVo> queryList(DeviceAlarmBo bo);
|
||||
|
||||
/**
|
||||
* 新增设备告警
|
||||
*
|
||||
* @param bo 设备告警
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DeviceAlarmBo bo);
|
||||
|
||||
/**
|
||||
* 修改设备告警
|
||||
*
|
||||
* @param bo 设备告警
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DeviceAlarmBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备告警信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.fuyuanshen.equipment.service;
|
||||
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceChargeDischargeVo;
|
||||
import com.fuyuanshen.equipment.domain.bo.DeviceChargeDischargeBo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备充放电记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface IDeviceChargeDischargeService {
|
||||
|
||||
/**
|
||||
* 查询设备充放电记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 设备充放电记录
|
||||
*/
|
||||
DeviceChargeDischargeVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询设备充放电记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 设备充放电记录分页列表
|
||||
*/
|
||||
TableDataInfo<DeviceChargeDischargeVo> queryPageList(DeviceChargeDischargeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的设备充放电记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 设备充放电记录列表
|
||||
*/
|
||||
List<DeviceChargeDischargeVo> queryList(DeviceChargeDischargeBo bo);
|
||||
|
||||
/**
|
||||
* 新增设备充放电记录
|
||||
*
|
||||
* @param bo 设备充放电记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DeviceChargeDischargeBo bo);
|
||||
|
||||
/**
|
||||
* 修改设备充放电记录
|
||||
*
|
||||
* @param bo 设备充放电记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DeviceChargeDischargeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备充放电记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -66,5 +66,13 @@ public interface IDeviceGroupService {
|
||||
* @param deviceId 设备id
|
||||
* @return 是否绑定成功
|
||||
*/
|
||||
Boolean bindingDevice(@NotEmpty(message = "分组id 不能为空") Long groupId, @NotEmpty(message = "设备id 不能为空") Long[] deviceId);
|
||||
Boolean bindingDevice(Long groupId, Long[] deviceId);
|
||||
|
||||
/**
|
||||
* 解绑设备分组
|
||||
*
|
||||
* @param deviceId 设备id
|
||||
* @return 是否解绑成功
|
||||
*/
|
||||
Boolean groupUnbind( Long[] deviceId);
|
||||
}
|
||||
|
||||
@ -0,0 +1,148 @@
|
||||
package com.fuyuanshen.equipment.service.impl;
|
||||
|
||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuyuanshen.equipment.domain.bo.DeviceAlarmBo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
|
||||
import com.fuyuanshen.equipment.domain.DeviceAlarm;
|
||||
import com.fuyuanshen.equipment.mapper.DeviceAlarmMapper;
|
||||
import com.fuyuanshen.equipment.service.IDeviceAlarmService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 设备告警Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-28
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DeviceAlarmServiceImpl implements IDeviceAlarmService {
|
||||
|
||||
private final DeviceAlarmMapper baseMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备告警
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 设备告警
|
||||
*/
|
||||
@Override
|
||||
public DeviceAlarmVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询设备告警列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 设备告警分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DeviceAlarmVo> queryPageList(DeviceAlarmBo bo, PageQuery pageQuery) {
|
||||
// LambdaQueryWrapper<DeviceAlarm> lqw = buildQueryWrapper(bo);
|
||||
// Page<DeviceAlarmVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<DeviceAlarmVo> result = baseMapper.selectVoPage(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的设备告警列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 设备告警列表
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceAlarmVo> queryList(DeviceAlarmBo bo) {
|
||||
LambdaQueryWrapper<DeviceAlarm> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DeviceAlarm> buildQueryWrapper(DeviceAlarmBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<DeviceAlarm> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(DeviceAlarm::getId);
|
||||
lqw.eq(bo.getDeviceId() != null, DeviceAlarm::getDeviceId, bo.getDeviceId());
|
||||
// lqw.eq(StringUtils.isNotBlank(bo.getDeviceAction()), DeviceAlarm::getDeviceAction, bo.getDeviceAction());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeviceName()), DeviceAlarm::getDeviceName, bo.getDeviceName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDataSource()), DeviceAlarm::getDataSource, bo.getDataSource());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), DeviceAlarm::getContent, bo.getContent());
|
||||
lqw.eq(bo.getDeviceType() != null, DeviceAlarm::getDeviceType, bo.getDeviceType());
|
||||
lqw.eq(bo.getLongitude() != null, DeviceAlarm::getLongitude, bo.getLongitude());
|
||||
lqw.eq(bo.getLatitude() != null, DeviceAlarm::getLatitude, bo.getLatitude());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLocation()), DeviceAlarm::getLocation, bo.getLocation());
|
||||
lqw.eq(bo.getStartTime() != null, DeviceAlarm::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getFinishTime() != null, DeviceAlarm::getFinishTime, bo.getFinishTime());
|
||||
lqw.eq(bo.getDurationTime() != null, DeviceAlarm::getDurationTime, bo.getDurationTime());
|
||||
lqw.eq(bo.getTreatmentState() != null, DeviceAlarm::getTreatmentState, bo.getTreatmentState());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备告警
|
||||
*
|
||||
* @param bo 设备告警
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DeviceAlarmBo bo) {
|
||||
DeviceAlarm add = MapstructUtils.convert(bo, DeviceAlarm.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备告警
|
||||
*
|
||||
* @param bo 设备告警
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DeviceAlarmBo bo) {
|
||||
DeviceAlarm update = MapstructUtils.convert(bo, DeviceAlarm.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DeviceAlarm entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备告警信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,146 @@
|
||||
package com.fuyuanshen.equipment.service.impl;
|
||||
|
||||
import com.fuyuanshen.common.core.utils.MapstructUtils;
|
||||
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuyuanshen.equipment.domain.bo.DeviceChargeDischargeBo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DeviceChargeDischargeVo;
|
||||
import com.fuyuanshen.equipment.domain.DeviceChargeDischarge;
|
||||
import com.fuyuanshen.equipment.mapper.DeviceChargeDischargeMapper;
|
||||
import com.fuyuanshen.equipment.service.IDeviceChargeDischargeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 设备充放电记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DeviceChargeDischargeServiceImpl implements IDeviceChargeDischargeService {
|
||||
|
||||
private final DeviceChargeDischargeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设备充放电记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 设备充放电记录
|
||||
*/
|
||||
@Override
|
||||
public DeviceChargeDischargeVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询设备充放电记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 设备充放电记录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DeviceChargeDischargeVo> queryPageList(DeviceChargeDischargeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DeviceChargeDischarge> lqw = buildQueryWrapper(bo);
|
||||
Page<DeviceChargeDischargeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的设备充放电记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 设备充放电记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceChargeDischargeVo> queryList(DeviceChargeDischargeBo bo) {
|
||||
LambdaQueryWrapper<DeviceChargeDischarge> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DeviceChargeDischarge> buildQueryWrapper(DeviceChargeDischargeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<DeviceChargeDischarge> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(DeviceChargeDischarge::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceId()), DeviceChargeDischarge::getDeviceId, bo.getDeviceId());
|
||||
lqw.eq(bo.getOperationType() != null, DeviceChargeDischarge::getOperationType, bo.getOperationType());
|
||||
lqw.eq(bo.getStartTime() != null, DeviceChargeDischarge::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, DeviceChargeDischarge::getEndTime, bo.getEndTime());
|
||||
lqw.eq(bo.getInitialSoc() != null, DeviceChargeDischarge::getInitialSoc, bo.getInitialSoc());
|
||||
lqw.eq(bo.getFinalSoc() != null, DeviceChargeDischarge::getFinalSoc, bo.getFinalSoc());
|
||||
lqw.eq(bo.getEnergyKwh() != null, DeviceChargeDischarge::getEnergyKwh, bo.getEnergyKwh());
|
||||
lqw.eq(bo.getPowerRating() != null, DeviceChargeDischarge::getPowerRating, bo.getPowerRating());
|
||||
lqw.eq(bo.getVoltage() != null, DeviceChargeDischarge::getVoltage, bo.getVoltage());
|
||||
lqw.eq(bo.getCurrent() != null, DeviceChargeDischarge::getCurrent, bo.getCurrent());
|
||||
lqw.eq(bo.getTemperature() != null, DeviceChargeDischarge::getTemperature, bo.getTemperature());
|
||||
lqw.eq(bo.getStatus() != null, DeviceChargeDischarge::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getErrorCode()), DeviceChargeDischarge::getErrorCode, bo.getErrorCode());
|
||||
lqw.eq(bo.getCreatedAt() != null, DeviceChargeDischarge::getCreatedAt, bo.getCreatedAt());
|
||||
lqw.eq(bo.getUpdatedAt() != null, DeviceChargeDischarge::getUpdatedAt, bo.getUpdatedAt());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备充放电记录
|
||||
*
|
||||
* @param bo 设备充放电记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DeviceChargeDischargeBo bo) {
|
||||
DeviceChargeDischarge add = MapstructUtils.convert(bo, DeviceChargeDischarge.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备充放电记录
|
||||
*
|
||||
* @param bo 设备充放电记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DeviceChargeDischargeBo bo) {
|
||||
DeviceChargeDischarge update = MapstructUtils.convert(bo, DeviceChargeDischarge.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DeviceChargeDischarge entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除设备充放电记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -92,6 +92,7 @@ public class DeviceGroupServiceImpl implements IDeviceGroupService {
|
||||
vo.setId(group.getId());
|
||||
vo.setGroupName(group.getGroupName());
|
||||
vo.setStatus(group.getStatus() == 1 ? "正常" : "禁用");
|
||||
vo.setParentId(group.getParentId());
|
||||
vo.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(group.getCreateTime()));
|
||||
return vo;
|
||||
}
|
||||
@ -124,10 +125,12 @@ public class DeviceGroupServiceImpl implements IDeviceGroupService {
|
||||
throw new RuntimeException("分组名称已存在,请勿重复添加!!!");
|
||||
}
|
||||
|
||||
// 验证父分组是否存在(如果提供了parentId)
|
||||
DeviceGroup pDeviceGroup = baseMapper.selectById(bo.getParentId());
|
||||
if (bo.getParentId() != null && pDeviceGroup == null) {
|
||||
throw new RuntimeException("父分组不存在!!!");
|
||||
if (bo.getParentId() != null) {
|
||||
// 验证父分组是否存在(如果提供了parentId)
|
||||
DeviceGroup pDeviceGroup = baseMapper.selectById(bo.getParentId());
|
||||
if (bo.getParentId() != null && pDeviceGroup == null) {
|
||||
throw new RuntimeException("父分组不存在!!!");
|
||||
}
|
||||
}
|
||||
|
||||
DeviceGroup add = MapstructUtils.convert(bo, DeviceGroup.class);
|
||||
@ -199,4 +202,27 @@ public class DeviceGroupServiceImpl implements IDeviceGroupService {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解绑设备分组
|
||||
*
|
||||
* @param deviceId 设备id
|
||||
* @return 是否解绑成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean groupUnbind( Long[] deviceId) {
|
||||
|
||||
if (deviceId != null && deviceId.length > 0) {
|
||||
// 创建更新条件
|
||||
UpdateWrapper<Device> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.in("id", Arrays.asList(deviceId));
|
||||
updateWrapper.set("group_id", null);
|
||||
|
||||
// 执行批量更新
|
||||
deviceMapper.update(updateWrapper);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.query.DeviceTypeQueryCriteria;
|
||||
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.CustomerVo;
|
||||
import com.fuyuanshen.equipment.domain.vo.DataOverviewVo;
|
||||
import com.fuyuanshen.equipment.enums.BindingStatusEnum;
|
||||
import com.fuyuanshen.equipment.enums.CommunicationModeEnum;
|
||||
import com.fuyuanshen.equipment.enums.DeviceActiveStatusEnum;
|
||||
@ -595,6 +596,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备MAC号
|
||||
*
|
||||
@ -613,4 +616,14 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取数据总览
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DataOverviewVo getDataOverview() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -157,11 +157,11 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
||||
throw new RuntimeException("设备类型不存在");
|
||||
}
|
||||
|
||||
List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
|
||||
.eq("device_type", deviceTypeGrants.getDeviceTypeId()));
|
||||
if (CollectionUtil.isNotEmpty(devices)) {
|
||||
throw new RuntimeException("该设备类型已绑定设备,无法修改!!!");
|
||||
}
|
||||
// List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>()
|
||||
// .eq("device_type", deviceTypeGrants.getDeviceTypeId()));
|
||||
// if (CollectionUtil.isNotEmpty(devices)) {
|
||||
// throw new RuntimeException("该设备类型已绑定设备,无法修改!!!");
|
||||
// }
|
||||
|
||||
// 校验设备类型名称
|
||||
DeviceType dt = deviceTypeMapper.selectOne(new QueryWrapper<DeviceType>().eq("type_name", resources.getTypeName()));
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuyuanshen.equipment.mapper.DeviceAlarmMapper">
|
||||
|
||||
<!-- 查询设备告警列表 -->
|
||||
<select id="selectVoPage" resultType="com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo">
|
||||
select *, d.device_mac as deviceMac, d.device_imei as deviceImei,
|
||||
d.type_name as deviceTypeName, d.device_pic as devicePic
|
||||
from device_alarm da
|
||||
left join device d on da.device_id = d.id
|
||||
left join device_type dt on dt.id = da.device_type
|
||||
<where>
|
||||
<if test="bo.deviceName != null">
|
||||
and da.device_name = #{bo.deviceName}
|
||||
</if>
|
||||
<if test="bo.deviceType != null">
|
||||
and da.device_type = #{bo.deviceType}
|
||||
</if>
|
||||
<if test="bo.deviceAction != null">
|
||||
and da.device_action = #{bo.deviceAction}
|
||||
</if>
|
||||
<if test="bo.treatmentState != null">
|
||||
and da.treatment_state = #{bo.treatmentState}
|
||||
</if>
|
||||
<if test="bo.queryTime1 != null and bo.queryTime2 != null ">
|
||||
and da.start_time between #{bo.queryTime1} and #{bo.queryTime2}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuyuanshen.equipment.mapper.DeviceChargeDischargeMapper">
|
||||
|
||||
</mapper>
|
||||
@ -28,11 +28,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="bo.deviceImei != null and bo.deviceImei != ''">
|
||||
AND b.device_imei = #{bo.deviceImei}
|
||||
</if>
|
||||
<if test="bo.content != null and bo.content != ''">
|
||||
AND b.device_imei = #{bo.content} or b.device_mac = #{bo.content}
|
||||
</if>
|
||||
<if test="bo.startTime != null and bo.startTime != ''">
|
||||
AND create_time <![CDATA[>=]]> #{bo.startTime}
|
||||
AND a.create_time <![CDATA[>=]]> #{bo.startTime}
|
||||
</if>
|
||||
<if test="bo.endTime != null and bo.endTime != ''">
|
||||
AND create_time <![CDATA[<=]]> #{bo.startTime}
|
||||
AND a.create_time <![CDATA[<=]]> #{bo.endTime}
|
||||
</if>
|
||||
<if test="bo.groupId != null">
|
||||
and b.group_id = #{bo.groupId}
|
||||
</if>
|
||||
ORDER BY
|
||||
a.create_time DESC
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT
|
||||
da.id AS id, d.device_name, d.bluetooth_name,
|
||||
da.id AS id, d.id AS deviceId, d.device_name, d.bluetooth_name, d.group_id,
|
||||
d.pub_topic, d.sub_topic, d.device_pic,
|
||||
d.device_mac, d.device_sn, d.update_by,
|
||||
d.device_imei, d.update_time, dg.id AS device_type,
|
||||
@ -71,6 +71,9 @@
|
||||
<if test="criteria.deviceStatus != null">
|
||||
and da.active = #{criteria.deviceStatus}
|
||||
</if>
|
||||
<if test="criteria.groupId != null">
|
||||
and d.group_id = #{criteria.groupId}
|
||||
</if>
|
||||
<if test="criteria.params.beginTime != null and criteria.params.endTime != null">
|
||||
and da.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
|
||||
</if>
|
||||
@ -257,11 +260,11 @@
|
||||
<if test="criteria.deviceName != null and criteria.deviceName != ''">
|
||||
and d.device_name like concat('%', #{criteria.deviceName}, '%')
|
||||
</if>
|
||||
<if test="criteria.deviceMac != null">
|
||||
and d.device_mac = #{criteria.deviceMac}
|
||||
<if test="criteria.deviceImei != null and criteria.deviceImei != ''">
|
||||
and (d.device_imei = #{criteria.deviceImei}
|
||||
</if>
|
||||
<if test="criteria.deviceImei != null">
|
||||
and d.device_imei = #{criteria.deviceImei}
|
||||
<if test="criteria.content != null and criteria.content != ''">
|
||||
AND d.device_imei = #{criteria.content} or d.device_mac = #{criteria.content}
|
||||
</if>
|
||||
<if test="criteria.deviceStatus != null">
|
||||
and d.device_status = #{criteria.deviceStatus}
|
||||
@ -276,5 +279,36 @@
|
||||
and d.group_id = #{criteria.groupId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLocationHistory" resultType="com.fuyuanshen.equipment.domain.vo.LocationHistoryVo">
|
||||
select a.id,a.device_name,a.device_type,b.type_name deviceTypeName,a.device_imei,a.device_mac from device a
|
||||
inner join device_type b on a.device_type = b.id
|
||||
|
||||
<if test="bo.deviceType != null">
|
||||
AND b.id = #{bo.deviceType}
|
||||
</if>
|
||||
<if test="bo.deviceName != null and bo.deviceName != ''">
|
||||
AND a.device_name like concat('%',#{bo.deviceName},'%')
|
||||
</if>
|
||||
<if test="bo.deviceMac != null and bo.deviceMac != ''">
|
||||
AND a.device_mac = #{bo.deviceMac}
|
||||
</if>
|
||||
<if test="bo.deviceImei != null and bo.deviceImei != ''">
|
||||
AND a.device_imei = #{bo.deviceImei}
|
||||
</if>
|
||||
<if test="bo.content != null and bo.content != ''">
|
||||
AND a.device_imei = #{bo.content} or a.device_mac = #{bo.content}
|
||||
</if>
|
||||
<if test="bo.startTime != null and bo.startTime != ''">
|
||||
AND a.create_time <![CDATA[>=]]> #{bo.startTime}
|
||||
</if>
|
||||
<if test="bo.endTime != null and bo.endTime != ''">
|
||||
AND a.create_time <![CDATA[<=]]> #{bo.endTime}
|
||||
</if>
|
||||
<if test="bo.groupId != null">
|
||||
and a.group_id = #{bo.groupId}
|
||||
</if>
|
||||
ORDER BY
|
||||
a.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -4,6 +4,7 @@
|
||||
<resultMap id="BaseResultMap" type="com.fuyuanshen.equipment.domain.DeviceType">
|
||||
<id column="grant_id" property="id"/>
|
||||
<result column="type_name" property="typeName"/>
|
||||
<result column="device_type_id" property="deviceTypeId"/>
|
||||
<result column="is_support_ble" property="isSupportBle"/>
|
||||
<result column="locate_mode" property="locateMode"/>
|
||||
<result column="network_way" property="networkWay"/>
|
||||
@ -21,7 +22,7 @@
|
||||
|
||||
<!-- 查询所有设备类型 -->
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT DISTINCT dt.* ,dg.id AS grant_id ,dg.create_time AS Dcreate_time
|
||||
SELECT DISTINCT dt.* ,dg.id AS grant_id ,dg.create_time AS Dcreate_time,dt.id AS device_type_id
|
||||
FROM device_type dt
|
||||
JOIN device_type_grants dg ON dt.id = dg.device_type_id
|
||||
<where>
|
||||
@ -44,7 +45,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 根据名称查询设备类型 -->
|
||||
<select id="queryByName" resultMap="BaseResultMap"
|
||||
<select id="queryByName" resultMap="BaseResultMap"
|
||||
parameterType="com.fuyuanshen.equipment.domain.query.DeviceTypeQueryCriteria">
|
||||
SELECT dt.*, dg.id AS grant_id
|
||||
FROM device_type dt
|
||||
|
||||
Reference in New Issue
Block a user