From aed6203e78aa81d24398a2b854602559c9be964d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Fri, 16 Jan 2026 18:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0IOT=E7=9A=84MAPPER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/device/mapper/AircraftMapper.java | 69 ++++++++ .../device/mapper/AircraftPayloadMapper.java | 85 ++++++++++ .../com/ruoyi/device/mapper/DeviceMapper.java | 61 ++++++++ .../device/mapper/DockAircraftMapper.java | 77 +++++++++ .../ruoyi/device/mapper/DockGroupMapper.java | 77 +++++++++ .../com/ruoyi/device/mapper/DockMapper.java | 69 ++++++++ .../com/ruoyi/device/mapper/GroupMapper.java | 61 ++++++++ .../ruoyi/device/mapper/PayloadMapper.java | 61 ++++++++ .../device/mapper/entity/AircraftEntity.java | 64 ++++++++ .../mapper/entity/AircraftPayloadEntity.java | 78 +++++++++ .../device/mapper/entity/DeviceEntity.java | 148 ++++++++++++++++++ .../mapper/entity/DockAircraftEntity.java | 64 ++++++++ .../device/mapper/entity/DockEntity.java | 78 +++++++++ .../device/mapper/entity/DockGroupEntity.java | 64 ++++++++ .../device/mapper/entity/GroupEntity.java | 50 ++++++ .../device/mapper/entity/PayloadEntity.java | 120 ++++++++++++++ .../db/migration/V2__Create_device_tables.sql | 54 +++++++ .../V3__Create_association_tables.sql | 52 ++++++ .../db/migration/V4__Create_group_tables.sql | 33 ++++ .../mapper/device/AircraftMapper.xml | 87 ++++++++++ .../mapper/device/AircraftPayloadMapper.xml | 104 ++++++++++++ .../resources/mapper/device/DeviceMapper.xml | 121 ++++++++++++++ .../mapper/device/DockAircraftMapper.xml | 92 +++++++++++ .../mapper/device/DockGroupMapper.xml | 92 +++++++++++ .../resources/mapper/device/DockMapper.xml | 94 +++++++++++ .../resources/mapper/device/GroupMapper.xml | 75 +++++++++ .../resources/mapper/device/PayloadMapper.xml | 105 +++++++++++++ 27 files changed, 2135 insertions(+) create mode 100644 src/main/java/com/ruoyi/device/mapper/AircraftMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/AircraftPayloadMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/DeviceMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/DockAircraftMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/DockGroupMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/DockMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/GroupMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/PayloadMapper.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/AircraftEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/AircraftPayloadEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/DeviceEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/DockAircraftEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/DockEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/DockGroupEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/GroupEntity.java create mode 100644 src/main/java/com/ruoyi/device/mapper/entity/PayloadEntity.java create mode 100644 src/main/resources/db/migration/V2__Create_device_tables.sql create mode 100644 src/main/resources/db/migration/V3__Create_association_tables.sql create mode 100644 src/main/resources/db/migration/V4__Create_group_tables.sql create mode 100644 src/main/resources/mapper/device/AircraftMapper.xml create mode 100644 src/main/resources/mapper/device/AircraftPayloadMapper.xml create mode 100644 src/main/resources/mapper/device/DeviceMapper.xml create mode 100644 src/main/resources/mapper/device/DockAircraftMapper.xml create mode 100644 src/main/resources/mapper/device/DockGroupMapper.xml create mode 100644 src/main/resources/mapper/device/DockMapper.xml create mode 100644 src/main/resources/mapper/device/GroupMapper.xml create mode 100644 src/main/resources/mapper/device/PayloadMapper.xml diff --git a/src/main/java/com/ruoyi/device/mapper/AircraftMapper.java b/src/main/java/com/ruoyi/device/mapper/AircraftMapper.java new file mode 100644 index 0000000..b8ac407 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/AircraftMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.AircraftEntity; +import java.util.List; + +/** + * 无人机表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface AircraftMapper +{ + /** + * 根据无人机主键查询无人机 + * + * @param aircraftId 无人机主键 + * @return 无人机信息 + */ + AircraftEntity selectAircraftByAircraftId(Long aircraftId); + + /** + * 根据设备主键查询无人机列表 + * + * @param deviceId 设备主键 + * @return 无人机列表 + */ + List selectAircraftListByDeviceId(Long deviceId); + + /** + * 查询无人机列表 + * + * @param aircraft 无人机信息 + * @return 无人机集合 + */ + List selectAircraftList(AircraftEntity aircraft); + + /** + * 新增无人机 + * + * @param aircraft 无人机信息 + * @return 影响行数 + */ + int insertAircraft(AircraftEntity aircraft); + + /** + * 修改无人机 + * + * @param aircraft 无人机信息 + * @return 影响行数 + */ + int updateAircraft(AircraftEntity aircraft); + + /** + * 删除无人机 + * + * @param aircraftId 无人机主键 + * @return 影响行数 + */ + int deleteAircraftByAircraftId(Long aircraftId); + + /** + * 批量删除无人机 + * + * @param aircraftIds 需要删除的无人机主键集合 + * @return 影响行数 + */ + int deleteAircraftByAircraftIds(Long[] aircraftIds); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/AircraftPayloadMapper.java b/src/main/java/com/ruoyi/device/mapper/AircraftPayloadMapper.java new file mode 100644 index 0000000..676d84e --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/AircraftPayloadMapper.java @@ -0,0 +1,85 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.AircraftPayloadEntity; +import java.util.List; + +/** + * 无人机挂载关联表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface AircraftPayloadMapper +{ + /** + * 根据关联主键查询无人机挂载关联 + * + * @param id 关联主键 + * @return 无人机挂载关联信息 + */ + AircraftPayloadEntity selectAircraftPayloadById(Long id); + + /** + * 根据无人机主键查询无人机挂载关联列表 + * + * @param aircraftId 无人机主键 + * @return 无人机挂载关联列表 + */ + List selectAircraftPayloadListByAircraftId(Long aircraftId); + + /** + * 根据挂载主键查询无人机挂载关联列表 + * + * @param payloadId 挂载主键 + * @return 无人机挂载关联列表 + */ + List selectAircraftPayloadListByPayloadId(Long payloadId); + + /** + * 根据机场主键查询无人机挂载关联列表 + * + * @param dockId 机场主键 + * @return 无人机挂载关联列表 + */ + List selectAircraftPayloadListByDockId(Long dockId); + + /** + * 查询无人机挂载关联列表 + * + * @param aircraftPayload 无人机挂载关联信息 + * @return 无人机挂载关联集合 + */ + List selectAircraftPayloadList(AircraftPayloadEntity aircraftPayload); + + /** + * 新增无人机挂载关联 + * + * @param aircraftPayload 无人机挂载关联信息 + * @return 影响行数 + */ + int insertAircraftPayload(AircraftPayloadEntity aircraftPayload); + + /** + * 修改无人机挂载关联 + * + * @param aircraftPayload 无人机挂载关联信息 + * @return 影响行数 + */ + int updateAircraftPayload(AircraftPayloadEntity aircraftPayload); + + /** + * 删除无人机挂载关联 + * + * @param id 关联主键 + * @return 影响行数 + */ + int deleteAircraftPayloadById(Long id); + + /** + * 批量删除无人机挂载关联 + * + * @param ids 需要删除的关联主键集合 + * @return 影响行数 + */ + int deleteAircraftPayloadByIds(Long[] ids); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/DeviceMapper.java b/src/main/java/com/ruoyi/device/mapper/DeviceMapper.java new file mode 100644 index 0000000..fc183d2 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/DeviceMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.DeviceEntity; +import java.util.List; + +/** + * 设备表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface DeviceMapper +{ + /** + * 根据设备主键查询设备 + * + * @param deviceId 设备主键 + * @return 设备信息 + */ + DeviceEntity selectDeviceByDeviceId(Long deviceId); + + /** + * 查询设备列表 + * + * @param device 设备信息 + * @return 设备集合 + */ + List selectDeviceList(DeviceEntity device); + + /** + * 新增设备 + * + * @param device 设备信息 + * @return 影响行数 + */ + int insertDevice(DeviceEntity device); + + /** + * 修改设备 + * + * @param device 设备信息 + * @return 影响行数 + */ + int updateDevice(DeviceEntity device); + + /** + * 删除设备 + * + * @param deviceId 设备主键 + * @return 影响行数 + */ + int deleteDeviceByDeviceId(Long deviceId); + + /** + * 批量删除设备 + * + * @param deviceIds 需要删除的设备主键集合 + * @return 影响行数 + */ + int deleteDeviceByDeviceIds(Long[] deviceIds); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/DockAircraftMapper.java b/src/main/java/com/ruoyi/device/mapper/DockAircraftMapper.java new file mode 100644 index 0000000..10190c2 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/DockAircraftMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.DockAircraftEntity; +import java.util.List; + +/** + * 机场无人机关联表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface DockAircraftMapper +{ + /** + * 根据关联主键查询机场无人机关联 + * + * @param id 关联主键 + * @return 机场无人机关联信息 + */ + DockAircraftEntity selectDockAircraftById(Long id); + + /** + * 根据机场主键查询机场无人机关联列表 + * + * @param dockId 机场主键 + * @return 机场无人机关联列表 + */ + List selectDockAircraftListByDockId(Long dockId); + + /** + * 根据无人机主键查询机场无人机关联列表 + * + * @param aircraftId 无人机主键 + * @return 机场无人机关联列表 + */ + List selectDockAircraftListByAircraftId(Long aircraftId); + + /** + * 查询机场无人机关联列表 + * + * @param dockAircraft 机场无人机关联信息 + * @return 机场无人机关联集合 + */ + List selectDockAircraftList(DockAircraftEntity dockAircraft); + + /** + * 新增机场无人机关联 + * + * @param dockAircraft 机场无人机关联信息 + * @return 影响行数 + */ + int insertDockAircraft(DockAircraftEntity dockAircraft); + + /** + * 修改机场无人机关联 + * + * @param dockAircraft 机场无人机关联信息 + * @return 影响行数 + */ + int updateDockAircraft(DockAircraftEntity dockAircraft); + + /** + * 删除机场无人机关联 + * + * @param id 关联主键 + * @return 影响行数 + */ + int deleteDockAircraftById(Long id); + + /** + * 批量删除机场无人机关联 + * + * @param ids 需要删除的关联主键集合 + * @return 影响行数 + */ + int deleteDockAircraftByIds(Long[] ids); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/DockGroupMapper.java b/src/main/java/com/ruoyi/device/mapper/DockGroupMapper.java new file mode 100644 index 0000000..4bfd28e --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/DockGroupMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.DockGroupEntity; +import java.util.List; + +/** + * 机场分组关联表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface DockGroupMapper +{ + /** + * 根据关联主键查询机场分组关联 + * + * @param id 关联主键 + * @return 机场分组关联信息 + */ + DockGroupEntity selectDockGroupById(Long id); + + /** + * 根据机场主键查询机场分组关联列表 + * + * @param dockId 机场主键 + * @return 机场分组关联列表 + */ + List selectDockGroupListByDockId(Long dockId); + + /** + * 根据分组主键查询机场分组关联列表 + * + * @param groupId 分组主键 + * @return 机场分组关联列表 + */ + List selectDockGroupListByGroupId(Long groupId); + + /** + * 查询机场分组关联列表 + * + * @param dockGroup 机场分组关联信息 + * @return 机场分组关联集合 + */ + List selectDockGroupList(DockGroupEntity dockGroup); + + /** + * 新增机场分组关联 + * + * @param dockGroup 机场分组关联信息 + * @return 影响行数 + */ + int insertDockGroup(DockGroupEntity dockGroup); + + /** + * 修改机场分组关联 + * + * @param dockGroup 机场分组关联信息 + * @return 影响行数 + */ + int updateDockGroup(DockGroupEntity dockGroup); + + /** + * 删除机场分组关联 + * + * @param id 关联主键 + * @return 影响行数 + */ + int deleteDockGroupById(Long id); + + /** + * 批量删除机场分组关联 + * + * @param ids 需要删除的关联主键集合 + * @return 影响行数 + */ + int deleteDockGroupByIds(Long[] ids); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/DockMapper.java b/src/main/java/com/ruoyi/device/mapper/DockMapper.java new file mode 100644 index 0000000..9cbd420 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/DockMapper.java @@ -0,0 +1,69 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.DockEntity; +import java.util.List; + +/** + * 机场表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface DockMapper +{ + /** + * 根据机场主键查询机场 + * + * @param dockId 机场主键 + * @return 机场信息 + */ + DockEntity selectDockByDockId(Long dockId); + + /** + * 根据设备主键查询机场列表 + * + * @param deviceId 设备主键 + * @return 机场列表 + */ + List selectDockListByDeviceId(Long deviceId); + + /** + * 查询机场列表 + * + * @param dock 机场信息 + * @return 机场集合 + */ + List selectDockList(DockEntity dock); + + /** + * 新增机场 + * + * @param dock 机场信息 + * @return 影响行数 + */ + int insertDock(DockEntity dock); + + /** + * 修改机场 + * + * @param dock 机场信息 + * @return 影响行数 + */ + int updateDock(DockEntity dock); + + /** + * 删除机场 + * + * @param dockId 机场主键 + * @return 影响行数 + */ + int deleteDockByDockId(Long dockId); + + /** + * 批量删除机场 + * + * @param dockIds 需要删除的机场主键集合 + * @return 影响行数 + */ + int deleteDockByDockIds(Long[] dockIds); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/GroupMapper.java b/src/main/java/com/ruoyi/device/mapper/GroupMapper.java new file mode 100644 index 0000000..a9a6f41 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/GroupMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.GroupEntity; +import java.util.List; + +/** + * 分组表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface GroupMapper +{ + /** + * 根据分组主键查询分组 + * + * @param groupId 分组主键 + * @return 分组信息 + */ + GroupEntity selectGroupByGroupId(Long groupId); + + /** + * 查询分组列表 + * + * @param group 分组信息 + * @return 分组集合 + */ + List selectGroupList(GroupEntity group); + + /** + * 新增分组 + * + * @param group 分组信息 + * @return 影响行数 + */ + int insertGroup(GroupEntity group); + + /** + * 修改分组 + * + * @param group 分组信息 + * @return 影响行数 + */ + int updateGroup(GroupEntity group); + + /** + * 删除分组 + * + * @param groupId 分组主键 + * @return 影响行数 + */ + int deleteGroupByGroupId(Long groupId); + + /** + * 批量删除分组 + * + * @param groupIds 需要删除的分组主键集合 + * @return 影响行数 + */ + int deleteGroupByGroupIds(Long[] groupIds); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/PayloadMapper.java b/src/main/java/com/ruoyi/device/mapper/PayloadMapper.java new file mode 100644 index 0000000..782e29d --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/PayloadMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.device.mapper; + +import com.ruoyi.device.mapper.entity.PayloadEntity; +import java.util.List; + +/** + * 挂载表Mapper接口 + * + * @author ruoyi + * @date 2026-01-16 + */ +public interface PayloadMapper +{ + /** + * 根据挂载主键查询挂载 + * + * @param payloadId 挂载主键 + * @return 挂载信息 + */ + PayloadEntity selectPayloadByPayloadId(Long payloadId); + + /** + * 查询挂载列表 + * + * @param payload 挂载信息 + * @return 挂载集合 + */ + List selectPayloadList(PayloadEntity payload); + + /** + * 新增挂载 + * + * @param payload 挂载信息 + * @return 影响行数 + */ + int insertPayload(PayloadEntity payload); + + /** + * 修改挂载 + * + * @param payload 挂载信息 + * @return 影响行数 + */ + int updatePayload(PayloadEntity payload); + + /** + * 删除挂载 + * + * @param payloadId 挂载主键 + * @return 影响行数 + */ + int deletePayloadByPayloadId(Long payloadId); + + /** + * 批量删除挂载 + * + * @param payloadIds 需要删除的挂载主键集合 + * @return 影响行数 + */ + int deletePayloadByPayloadIds(Long[] payloadIds); +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/AircraftEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/AircraftEntity.java new file mode 100644 index 0000000..26bc07d --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/AircraftEntity.java @@ -0,0 +1,64 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 无人机表实体对象 device_aircraft + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class AircraftEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 无人机主键 */ + private Long aircraftId; + + /** 无人机名称 */ + private String aircraftName; + + /** 设备表主键 */ + private Long deviceId; + + public Long getAircraftId() + { + return aircraftId; + } + + public void setAircraftId(Long aircraftId) + { + this.aircraftId = aircraftId; + } + + public String getAircraftName() + { + return aircraftName; + } + + public void setAircraftName(String aircraftName) + { + this.aircraftName = aircraftName; + } + + public Long getDeviceId() + { + return deviceId; + } + + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + @Override + public String toString() + { + return "AircraftEntity{" + + "aircraftId=" + aircraftId + + ", aircraftName='" + aircraftName + '\'' + + ", deviceId=" + deviceId + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/AircraftPayloadEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/AircraftPayloadEntity.java new file mode 100644 index 0000000..8a8ec23 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/AircraftPayloadEntity.java @@ -0,0 +1,78 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 无人机挂载关联表实体对象 device_aircraft_payload + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class AircraftPayloadEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 关联主键 */ + private Long id; + + /** 无人机主键 */ + private Long aircraftId; + + /** 挂载主键 */ + private Long payloadId; + + /** 机场主键 */ + private Long dockId; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getAircraftId() + { + return aircraftId; + } + + public void setAircraftId(Long aircraftId) + { + this.aircraftId = aircraftId; + } + + public Long getPayloadId() + { + return payloadId; + } + + public void setPayloadId(Long payloadId) + { + this.payloadId = payloadId; + } + + public Long getDockId() + { + return dockId; + } + + public void setDockId(Long dockId) + { + this.dockId = dockId; + } + + @Override + public String toString() + { + return "AircraftPayloadEntity{" + + "id=" + id + + ", aircraftId=" + aircraftId + + ", payloadId=" + payloadId + + ", dockId=" + dockId + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/DeviceEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/DeviceEntity.java new file mode 100644 index 0000000..ea26194 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/DeviceEntity.java @@ -0,0 +1,148 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 设备表实体对象 device_device + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class DeviceEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 设备主键 */ + private Long deviceId; + + /** 设备名称 */ + private String deviceName; + + /** IOT中的设备ID */ + private String iotDeviceId; + + /** 设备类型 */ + private String deviceType; + + /** 设备厂商 */ + private String deviceManufacturer; + + /** 设备型号 */ + private String deviceModel; + + /** 设备SN号 */ + private String deviceSn; + + /** 所属部门主键 */ + private Long deptId; + + /** 网关 */ + private String gateway; + + public Long getDeviceId() + { + return deviceId; + } + + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + public String getDeviceName() + { + return deviceName; + } + + public void setDeviceName(String deviceName) + { + this.deviceName = deviceName; + } + + public String getIotDeviceId() + { + return iotDeviceId; + } + + public void setIotDeviceId(String iotDeviceId) + { + this.iotDeviceId = iotDeviceId; + } + + public String getDeviceType() + { + return deviceType; + } + + public void setDeviceType(String deviceType) + { + this.deviceType = deviceType; + } + + public String getDeviceManufacturer() + { + return deviceManufacturer; + } + + public void setDeviceManufacturer(String deviceManufacturer) + { + this.deviceManufacturer = deviceManufacturer; + } + + public String getDeviceModel() + { + return deviceModel; + } + + public void setDeviceModel(String deviceModel) + { + this.deviceModel = deviceModel; + } + + public String getDeviceSn() + { + return deviceSn; + } + + public void setDeviceSn(String deviceSn) + { + this.deviceSn = deviceSn; + } + + public Long getDeptId() + { + return deptId; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public String getGateway() + { + return gateway; + } + + public void setGateway(String gateway) + { + this.gateway = gateway; + } + + @Override + public String toString() + { + return "DeviceEntity{" + + "deviceId=" + deviceId + + ", deviceName='" + deviceName + '\'' + + ", iotDeviceId='" + iotDeviceId + '\'' + + ", deviceType='" + deviceType + '\'' + + ", deviceManufacturer='" + deviceManufacturer + '\'' + + ", deviceModel='" + deviceModel + '\'' + + ", deviceSn='" + deviceSn + '\'' + + ", deptId=" + deptId + + ", gateway='" + gateway + '\'' + + '}'; + } +} diff --git a/src/main/java/com/ruoyi/device/mapper/entity/DockAircraftEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/DockAircraftEntity.java new file mode 100644 index 0000000..af5ce17 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/DockAircraftEntity.java @@ -0,0 +1,64 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 机场无人机关联表实体对象 device_dock_aircraft + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class DockAircraftEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 关联主键 */ + private Long id; + + /** 机场主键 */ + private Long dockId; + + /** 无人机主键 */ + private Long aircraftId; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getDockId() + { + return dockId; + } + + public void setDockId(Long dockId) + { + this.dockId = dockId; + } + + public Long getAircraftId() + { + return aircraftId; + } + + public void setAircraftId(Long aircraftId) + { + this.aircraftId = aircraftId; + } + + @Override + public String toString() + { + return "DockAircraftEntity{" + + "id=" + id + + ", dockId=" + dockId + + ", aircraftId=" + aircraftId + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/DockEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/DockEntity.java new file mode 100644 index 0000000..b898012 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/DockEntity.java @@ -0,0 +1,78 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 机场表实体对象 device_dock + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class DockEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 机场主键 */ + private Long dockId; + + /** 机场名称 */ + private String dockName; + + /** 机场位置 */ + private String dockLocation; + + /** 设备表主键 */ + private Long deviceId; + + public Long getDockId() + { + return dockId; + } + + public void setDockId(Long dockId) + { + this.dockId = dockId; + } + + public String getDockName() + { + return dockName; + } + + public void setDockName(String dockName) + { + this.dockName = dockName; + } + + public String getDockLocation() + { + return dockLocation; + } + + public void setDockLocation(String dockLocation) + { + this.dockLocation = dockLocation; + } + + public Long getDeviceId() + { + return deviceId; + } + + public void setDeviceId(Long deviceId) + { + this.deviceId = deviceId; + } + + @Override + public String toString() + { + return "DockEntity{" + + "dockId=" + dockId + + ", dockName='" + dockName + '\'' + + ", dockLocation='" + dockLocation + '\'' + + ", deviceId=" + deviceId + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/DockGroupEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/DockGroupEntity.java new file mode 100644 index 0000000..520b802 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/DockGroupEntity.java @@ -0,0 +1,64 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 机场分组关联表实体对象 device_dock_group + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class DockGroupEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 关联主键 */ + private Long id; + + /** 机场主键 */ + private Long dockId; + + /** 分组主键 */ + private Long groupId; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public Long getDockId() + { + return dockId; + } + + public void setDockId(Long dockId) + { + this.dockId = dockId; + } + + public Long getGroupId() + { + return groupId; + } + + public void setGroupId(Long groupId) + { + this.groupId = groupId; + } + + @Override + public String toString() + { + return "DockGroupEntity{" + + "id=" + id + + ", dockId=" + dockId + + ", groupId=" + groupId + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/GroupEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/GroupEntity.java new file mode 100644 index 0000000..82b4e46 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/GroupEntity.java @@ -0,0 +1,50 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 分组表实体对象 device_group + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class GroupEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 分组主键 */ + private Long groupId; + + /** 分组名称 */ + private String groupName; + + public Long getGroupId() + { + return groupId; + } + + public void setGroupId(Long groupId) + { + this.groupId = groupId; + } + + public String getGroupName() + { + return groupName; + } + + public void setGroupName(String groupName) + { + this.groupName = groupName; + } + + @Override + public String toString() + { + return "GroupEntity{" + + "groupId=" + groupId + + ", groupName='" + groupName + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/src/main/java/com/ruoyi/device/mapper/entity/PayloadEntity.java b/src/main/java/com/ruoyi/device/mapper/entity/PayloadEntity.java new file mode 100644 index 0000000..25ea845 --- /dev/null +++ b/src/main/java/com/ruoyi/device/mapper/entity/PayloadEntity.java @@ -0,0 +1,120 @@ +package com.ruoyi.device.mapper.entity; + +import com.ruoyi.common.core.web.domain.BaseEntity; + +/** + * 挂载表实体对象 device_payload + * Mapper 层实体,对应数据库表 + * + * @author ruoyi + * @date 2026-01-16 + */ +public class PayloadEntity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 挂载主键 */ + private Long payloadId; + + /** 挂载名称 */ + private String payloadName; + + /** 挂载类型 */ + private String payloadType; + + /** 挂载显示名称 */ + private String payloadDisplayName; + + /** 挂载动态信息 */ + private String payloadDynamicInfo; + + /** 挂载SN号 */ + private String payloadSn; + + /** IOT中的设备ID */ + private String iotDeviceId; + + public Long getPayloadId() + { + return payloadId; + } + + public void setPayloadId(Long payloadId) + { + this.payloadId = payloadId; + } + + public String getPayloadName() + { + return payloadName; + } + + public void setPayloadName(String payloadName) + { + this.payloadName = payloadName; + } + + public String getPayloadType() + { + return payloadType; + } + + public void setPayloadType(String payloadType) + { + this.payloadType = payloadType; + } + + public String getPayloadDisplayName() + { + return payloadDisplayName; + } + + public void setPayloadDisplayName(String payloadDisplayName) + { + this.payloadDisplayName = payloadDisplayName; + } + + public String getPayloadDynamicInfo() + { + return payloadDynamicInfo; + } + + public void setPayloadDynamicInfo(String payloadDynamicInfo) + { + this.payloadDynamicInfo = payloadDynamicInfo; + } + + public String getPayloadSn() + { + return payloadSn; + } + + public void setPayloadSn(String payloadSn) + { + this.payloadSn = payloadSn; + } + + public String getIotDeviceId() + { + return iotDeviceId; + } + + public void setIotDeviceId(String iotDeviceId) + { + this.iotDeviceId = iotDeviceId; + } + + @Override + public String toString() + { + return "PayloadEntity{" + + "payloadId=" + payloadId + + ", payloadName='" + payloadName + '\'' + + ", payloadType='" + payloadType + '\'' + + ", payloadDisplayName='" + payloadDisplayName + '\'' + + ", payloadDynamicInfo='" + payloadDynamicInfo + '\'' + + ", payloadSn='" + payloadSn + '\'' + + ", iotDeviceId='" + iotDeviceId + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/src/main/resources/db/migration/V2__Create_device_tables.sql b/src/main/resources/db/migration/V2__Create_device_tables.sql new file mode 100644 index 0000000..068b855 --- /dev/null +++ b/src/main/resources/db/migration/V2__Create_device_tables.sql @@ -0,0 +1,54 @@ +-- ============================================================ +-- Flyway Migration Script +-- ============================================================ +-- Version: V2 +-- Description: Create device management tables (device, dock, aircraft) +-- Author: ruoyi +-- Date: 2026-01-16 +-- ============================================================ + +-- 创建设备表 +CREATE TABLE IF NOT EXISTS device_device ( + device_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '设备主键', + device_name VARCHAR(100) COMMENT '设备名称', + iot_device_id VARCHAR(100) COMMENT 'IOT中的设备ID', + device_type VARCHAR(50) COMMENT '设备类型', + device_manufacturer VARCHAR(100) COMMENT '设备厂商', + device_model VARCHAR(100) COMMENT '设备型号', + device_sn VARCHAR(100) COMMENT '设备SN号', + dept_id BIGINT COMMENT '所属部门主键', + gateway VARCHAR(100) COMMENT '网关', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (device_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设备表'; + +-- 创建机场表 +CREATE TABLE IF NOT EXISTS device_dock ( + dock_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '机场主键', + dock_name VARCHAR(100) COMMENT '机场名称', + dock_location VARCHAR(200) COMMENT '机场位置', + device_id BIGINT COMMENT '设备表主键', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (dock_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机场表'; + +-- 创建无人机表 +CREATE TABLE IF NOT EXISTS device_aircraft ( + aircraft_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '无人机主键', + aircraft_name VARCHAR(100) COMMENT '无人机名称', + device_id BIGINT COMMENT '设备表主键', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (aircraft_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='无人机表'; \ No newline at end of file diff --git a/src/main/resources/db/migration/V3__Create_association_tables.sql b/src/main/resources/db/migration/V3__Create_association_tables.sql new file mode 100644 index 0000000..1cdad78 --- /dev/null +++ b/src/main/resources/db/migration/V3__Create_association_tables.sql @@ -0,0 +1,52 @@ +-- ============================================================ +-- Flyway Migration Script +-- ============================================================ +-- Version: V3 +-- Description: Create association tables (dock_aircraft, payload, aircraft_payload) +-- Author: ruoyi +-- Date: 2026-01-16 +-- ============================================================ + +-- 创建机场无人机关联表 +CREATE TABLE IF NOT EXISTS device_dock_aircraft ( + id BIGINT NOT NULL AUTO_INCREMENT COMMENT '关联主键', + dock_id BIGINT NOT NULL COMMENT '机场主键', + aircraft_id BIGINT NOT NULL COMMENT '无人机主键', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机场无人机关联表'; + +-- 创建挂载表 +CREATE TABLE IF NOT EXISTS device_payload ( + payload_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '挂载主键', + payload_name VARCHAR(100) COMMENT '挂载名称', + payload_type VARCHAR(50) COMMENT '挂载类型', + payload_display_name VARCHAR(100) COMMENT '挂载显示名称', + payload_dynamic_info TEXT COMMENT '挂载动态信息', + payload_sn VARCHAR(100) COMMENT '挂载SN号', + iot_device_id VARCHAR(100) COMMENT 'IOT中的设备ID', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (payload_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='挂载表'; + +-- 创建无人机挂载关联表 +CREATE TABLE IF NOT EXISTS device_aircraft_payload ( + id BIGINT NOT NULL AUTO_INCREMENT COMMENT '关联主键', + aircraft_id BIGINT NOT NULL COMMENT '无人机主键', + payload_id BIGINT NOT NULL COMMENT '挂载主键', + dock_id BIGINT NOT NULL COMMENT '机场主键', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='无人机挂载关联表'; \ No newline at end of file diff --git a/src/main/resources/db/migration/V4__Create_group_tables.sql b/src/main/resources/db/migration/V4__Create_group_tables.sql new file mode 100644 index 0000000..ea45d96 --- /dev/null +++ b/src/main/resources/db/migration/V4__Create_group_tables.sql @@ -0,0 +1,33 @@ +-- ============================================================ +-- Flyway Migration Script +-- ============================================================ +-- Version: V4 +-- Description: Create group tables (group, dock_group) +-- Author: ruoyi +-- Date: 2026-01-16 +-- ============================================================ + +-- 创建分组表 +CREATE TABLE IF NOT EXISTS device_group ( + group_id BIGINT NOT NULL AUTO_INCREMENT COMMENT '分组主键', + group_name VARCHAR(100) COMMENT '分组名称', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (group_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分组表'; + +-- 创建机场分组关联表 +CREATE TABLE IF NOT EXISTS device_dock_group ( + id BIGINT NOT NULL AUTO_INCREMENT COMMENT '关联主键', + dock_id BIGINT NOT NULL COMMENT '机场主键', + group_id BIGINT NOT NULL COMMENT '分组主键', + create_by VARCHAR(64) COMMENT '创建者', + create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + update_by VARCHAR(64) COMMENT '更新者', + update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + remark VARCHAR(500) COMMENT '备注', + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机场分组关联表'; \ No newline at end of file diff --git a/src/main/resources/mapper/device/AircraftMapper.xml b/src/main/resources/mapper/device/AircraftMapper.xml new file mode 100644 index 0000000..cc8bcd5 --- /dev/null +++ b/src/main/resources/mapper/device/AircraftMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + select aircraft_id, aircraft_name, device_id, + create_by, create_time, update_by, update_time, remark + from device_aircraft + + + + + + + + + + insert into device_aircraft + + aircraft_name, + device_id, + create_by, + remark, + create_time + + + #{aircraftName}, + #{deviceId}, + #{createBy}, + #{remark}, + now() + + + + + update device_aircraft + + aircraft_name = #{aircraftName}, + device_id = #{deviceId}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where aircraft_id = #{aircraftId} + + + + delete from device_aircraft where aircraft_id = #{aircraftId} + + + + delete from device_aircraft where aircraft_id in + + #{aircraftId} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/device/AircraftPayloadMapper.xml b/src/main/resources/mapper/device/AircraftPayloadMapper.xml new file mode 100644 index 0000000..6a8bf7c --- /dev/null +++ b/src/main/resources/mapper/device/AircraftPayloadMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + select id, aircraft_id, payload_id, dock_id, + create_by, create_time, update_by, update_time, remark + from device_aircraft_payload + + + + + + + + + + + + + + insert into device_aircraft_payload + + aircraft_id, + payload_id, + dock_id, + create_by, + remark, + create_time + + + #{aircraftId}, + #{payloadId}, + #{dockId}, + #{createBy}, + #{remark}, + now() + + + + + update device_aircraft_payload + + aircraft_id = #{aircraftId}, + payload_id = #{payloadId}, + dock_id = #{dockId}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where id = #{id} + + + + delete from device_aircraft_payload where id = #{id} + + + + delete from device_aircraft_payload where id in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/device/DeviceMapper.xml b/src/main/resources/mapper/device/DeviceMapper.xml new file mode 100644 index 0000000..2a490d6 --- /dev/null +++ b/src/main/resources/mapper/device/DeviceMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + select device_id, device_name, iot_device_id, device_type, device_manufacturer, + device_model, device_sn, dept_id, gateway, create_by, create_time, update_by, update_time, remark + from device_device + + + + + + + + insert into device_device + + device_name, + iot_device_id, + device_type, + device_manufacturer, + device_model, + device_sn, + dept_id, + gateway, + create_by, + remark, + create_time + + + #{deviceName}, + #{iotDeviceId}, + #{deviceType}, + #{deviceManufacturer}, + #{deviceModel}, + #{deviceSn}, + #{deptId}, + #{gateway}, + #{createBy}, + #{remark}, + now() + + + + + update device_device + + device_name = #{deviceName}, + iot_device_id = #{iotDeviceId}, + device_type = #{deviceType}, + device_manufacturer = #{deviceManufacturer}, + device_model = #{deviceModel}, + device_sn = #{deviceSn}, + dept_id = #{deptId}, + gateway = #{gateway}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where device_id = #{deviceId} + + + + delete from device_device where device_id = #{deviceId} + + + + delete from device_device where device_id in + + #{deviceId} + + + + diff --git a/src/main/resources/mapper/device/DockAircraftMapper.xml b/src/main/resources/mapper/device/DockAircraftMapper.xml new file mode 100644 index 0000000..00b2d47 --- /dev/null +++ b/src/main/resources/mapper/device/DockAircraftMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + select id, dock_id, aircraft_id, + create_by, create_time, update_by, update_time, remark + from device_dock_aircraft + + + + + + + + + + + + insert into device_dock_aircraft + + dock_id, + aircraft_id, + create_by, + remark, + create_time + + + #{dockId}, + #{aircraftId}, + #{createBy}, + #{remark}, + now() + + + + + update device_dock_aircraft + + dock_id = #{dockId}, + aircraft_id = #{aircraftId}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where id = #{id} + + + + delete from device_dock_aircraft where id = #{id} + + + + delete from device_dock_aircraft where id in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/device/DockGroupMapper.xml b/src/main/resources/mapper/device/DockGroupMapper.xml new file mode 100644 index 0000000..96e259d --- /dev/null +++ b/src/main/resources/mapper/device/DockGroupMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + select id, dock_id, group_id, + create_by, create_time, update_by, update_time, remark + from device_dock_group + + + + + + + + + + + + insert into device_dock_group + + dock_id, + group_id, + create_by, + remark, + create_time + + + #{dockId}, + #{groupId}, + #{createBy}, + #{remark}, + now() + + + + + update device_dock_group + + dock_id = #{dockId}, + group_id = #{groupId}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where id = #{id} + + + + delete from device_dock_group where id = #{id} + + + + delete from device_dock_group where id in + + #{id} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/device/DockMapper.xml b/src/main/resources/mapper/device/DockMapper.xml new file mode 100644 index 0000000..dad28eb --- /dev/null +++ b/src/main/resources/mapper/device/DockMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + select dock_id, dock_name, dock_location, device_id, + create_by, create_time, update_by, update_time, remark + from device_dock + + + + + + + + + + insert into device_dock + + dock_name, + dock_location, + device_id, + create_by, + remark, + create_time + + + #{dockName}, + #{dockLocation}, + #{deviceId}, + #{createBy}, + #{remark}, + now() + + + + + update device_dock + + dock_name = #{dockName}, + dock_location = #{dockLocation}, + device_id = #{deviceId}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where dock_id = #{dockId} + + + + delete from device_dock where dock_id = #{dockId} + + + + delete from device_dock where dock_id in + + #{dockId} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/device/GroupMapper.xml b/src/main/resources/mapper/device/GroupMapper.xml new file mode 100644 index 0000000..f118ade --- /dev/null +++ b/src/main/resources/mapper/device/GroupMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + select group_id, group_name, + create_by, create_time, update_by, update_time, remark + from device_group + + + + + + + + insert into device_group + + group_name, + create_by, + remark, + create_time + + + #{groupName}, + #{createBy}, + #{remark}, + now() + + + + + update device_group + + group_name = #{groupName}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where group_id = #{groupId} + + + + delete from device_group where group_id = #{groupId} + + + + delete from device_group where group_id in + + #{groupId} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/device/PayloadMapper.xml b/src/main/resources/mapper/device/PayloadMapper.xml new file mode 100644 index 0000000..d5c4d09 --- /dev/null +++ b/src/main/resources/mapper/device/PayloadMapper.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + select payload_id, payload_name, payload_type, payload_display_name, + payload_dynamic_info, payload_sn, iot_device_id, + create_by, create_time, update_by, update_time, remark + from device_payload + + + + + + + + insert into device_payload + + payload_name, + payload_type, + payload_display_name, + payload_dynamic_info, + payload_sn, + iot_device_id, + create_by, + remark, + create_time + + + #{payloadName}, + #{payloadType}, + #{payloadDisplayName}, + #{payloadDynamicInfo}, + #{payloadSn}, + #{iotDeviceId}, + #{createBy}, + #{remark}, + now() + + + + + update device_payload + + payload_name = #{payloadName}, + payload_type = #{payloadType}, + payload_display_name = #{payloadDisplayName}, + payload_dynamic_info = #{payloadDynamicInfo}, + payload_sn = #{payloadSn}, + iot_device_id = #{iotDeviceId}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = now() + + where payload_id = #{payloadId} + + + + delete from device_payload where payload_id = #{payloadId} + + + + delete from device_payload where payload_id in + + #{payloadId} + + + + \ No newline at end of file