web端控制中心3

This commit is contained in:
2025-08-27 08:59:29 +08:00
parent 74cefe9cc3
commit 364574eeae
13 changed files with 196 additions and 44 deletions

View File

@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.device_pic,
dt.type_name,
dt.communication_mode,
dt.model_dictionary detailPageUrl,
dt.app_model_dictionary detailPageUrl,
d.bluetooth_name,
c.binding_time,
ad.*,u.user_name otherPhonenumber
@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dt.type_name,
dt.communication_mode,
d.bluetooth_name,
dt.model_dictionary detailPageUrl,
dt.app_model_dictionary detailPageUrl,
c.binding_time,
ad.*,u.user_name otherPhonenumber
from

View File

@ -153,5 +153,8 @@ public class Device extends TenantEntity {
*/
@Schema(title = "出厂日期")
private Date productionDate;
/**
* 在线状态(0离线1在线)
*/
private Integer onlineStatus;
}

View File

@ -0,0 +1,32 @@
package com.fuyuanshen.equipment.domain.dto;
import lombok.Data;
@Data
public class InstructionRecordDto {
/**
* 设备类型
*/
private String deviceType;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备MAC
*/
private String deviceMac;
/**
* 设备IMEI
*/
private String deviceImei;
/**
* 操作时间-开始时间
*/
private String startTime;
/**
* 操作时间-结束时间
*/
private String endTime;
}

View File

@ -18,22 +18,34 @@ import java.util.Set;
@Data
public class DeviceQueryCriteria extends BaseEntity {
@Schema(name = "设备id")
/**
* 设备id
*/
private Long deviceId;
@Schema(name = "设备名称")
/**
* 设备名称
*/
private String deviceName;
@Schema(name = "设备类型")
/**
* 设备类型
*/
private Long deviceType;
@Schema(name = "设备MAC")
/**
* 设备MAC
*/
private String deviceMac;
@Schema(name = "设备IMEI")
/**
* 设备IMEI
*/
private String deviceImei;
@Schema(name = "设备SN")
/**
* 设备SN
*/
private String deviceSn;
/**
@ -41,26 +53,37 @@ public class DeviceQueryCriteria extends BaseEntity {
* 0 失效
* 1 正常
*/
@Schema(name = "设备状态 0 失效 1 正常 ")
private Integer deviceStatus;
@Schema(name = "页码", example = "1")
/**
* 页码
*/
private Integer pageNum = 1;
@Schema(name = "每页数据量", example = "10")
/**
* 每页数据量
*/
private Integer pageSize = 10;
@Schema(name = "客户id")
/**
* 客户id
*/
private Long customerId;
private Set<Long> customerIds;
@Schema(name = "当前所有者")
/**
* 当前所有者
*/
private Long currentOwnerId;
@Schema(name = "租户ID")
/**
* 租户ID
*/
private String tenantId;
@Schema(name = "通讯方式", example = "0:4G;1:蓝牙")
/**
* 通讯方式 0:4G;1:蓝牙
*/
private Integer communicationMode;
/* app绑定用户id */
@ -72,22 +95,22 @@ public class DeviceQueryCriteria extends BaseEntity {
*/
private String personnelBy;
/**
* 是否为管理员
*/
@Schema(name = "是否为管理员")
private Boolean isAdmin = false;
/**
* 设备所属分组
*/
@Schema(name = "设备所属分组")
private Long groupId;
/**
* 设备地区
*/
@Schema(name = "设备地区")
private String area;
}

View File

@ -0,0 +1,32 @@
package com.fuyuanshen.equipment.domain.vo;
import lombok.Data;
@Data
public class InstructionRecordVo {
private Long id;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备类型
*/
private String deviceType;
/**
* 操作模块
*/
private String deviceAction;
/**
* 操作内容
*/
private String content;
/**
* 操作时间
*/
private String createTime;
}

View File

@ -1,8 +1,12 @@
package com.fuyuanshen.equipment.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuyuanshen.equipment.domain.DeviceLog;
import com.fuyuanshen.equipment.domain.dto.InstructionRecordDto;
import com.fuyuanshen.equipment.domain.vo.DeviceLogVo;
import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
import com.fuyuanshen.equipment.domain.vo.InstructionRecordVo;
import org.apache.ibatis.annotations.Param;
/**
* 设备日志Mapper接口
@ -12,4 +16,5 @@ import com.fuyuanshen.common.mybatis.core.mapper.BaseMapperPlus;
*/
public interface DeviceLogMapper extends BaseMapperPlus<DeviceLog, DeviceLogVo> {
Page<InstructionRecordVo> getInstructionRecord(Page<InstructionRecordVo> page,@Param("bo") InstructionRecordDto bo);
}

View File

@ -70,5 +70,5 @@ public interface DeviceMapper extends BaseMapper<Device> {
AppDeviceVo getDeviceInfo(@Param("deviceMac") String deviceMac);
Page<WebDeviceVo> queryWebDeviceList(Page<Object> build, DeviceQueryCriteria bo);
Page<WebDeviceVo> queryWebDeviceList(Page<Object> build,@Param("criteria") DeviceQueryCriteria criteria);
}

View File

@ -4,4 +4,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuyuanshen.equipment.mapper.DeviceLogMapper">
<select id="getInstructionRecord" resultType="com.fuyuanshen.equipment.domain.vo.InstructionRecordVo">
SELECT
a.id,
a.device_name AS deviceName,
c.type_name deviceType,
a.device_action AS deviceAction,
a.content,
a.create_time AS createTime
FROM
device_log a left join device b on a.device_id = b.id
left join device_type c on b.device_type = c.id
WHERE 1 = 1
<if test="bo.deviceType != null">
AND c.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 b.device_mac = #{bo.deviceMac}
</if>
<if test="bo.deviceImei != null and bo.deviceImei != ''">
AND b.device_imei = #{bo.deviceImei}
</if>
<if test="bo.startTime != null and bo.startTime != ''">
AND create_time <![CDATA[>=]]> #{bo.startTime}
</if>
<if test="bo.endTime != null and bo.endTime != ''">
AND create_time <![CDATA[<=]]> #{bo.startTime}
</if>
ORDER BY
a.create_time DESC
</select>
</mapper>

View File

@ -151,7 +151,7 @@
dt.type_name,
dt.communication_mode,
d.bluetooth_name,
dt.model_dictionary detailPageUrl,
dt.app_model_dictionary detailPageUrl,
c.binding_time
from device d
inner join device_type dt on d.device_type = dt.id
@ -181,7 +181,7 @@
d.device_pic,
dt.type_name,
dt.communication_mode,
dt.model_dictionary detailPageUrl,
dt.app_model_dictionary detailPageUrl,
d.bluetooth_name
from device d
inner join device_type dt on d.device_type = dt.id
@ -227,7 +227,7 @@
dt.type_name,
dt.communication_mode,
d.bluetooth_name,
dt.model_dictionary detailPageUrl
dt.app_model_dictionary detailPageUrl
from device d
inner join device_type dt on d.device_type = dt.id
where d.device_mac = #{deviceMac}
@ -242,7 +242,7 @@
dt.type_name,
dt.communication_mode,
d.bluetooth_name,
dt.model_dictionary detailPageUrl,
dt.pc_model_dictionary detailPageUrl,
ap.name personnelBy,
d.device_status,
c.binding_time
@ -254,7 +254,7 @@
<if test="criteria.deviceType != null">
and d.device_type = #{criteria.deviceType}
</if>
<if test="criteria.deviceName != null">
<if test="criteria.deviceName != null and criteria.deviceName != ''">
and d.device_name like concat('%', #{criteria.deviceName}, '%')
</if>
<if test="criteria.deviceMac != null">
@ -270,7 +270,10 @@
and ap.name like concat('%', #{criteria.personnelBy}, '%')
</if>
<if test="criteria.communicationMode != null">
and dt.communication_mode, = #{criteria.communicationMode}
and dt.communication_mode = #{criteria.communicationMode}
</if>
<if test="criteria.groupId != null">
and d.group_id = #{criteria.groupId}
</if>
</select>