35 changed files with 2004 additions and 4 deletions
@ -0,0 +1,52 @@
|
||||
package com.mh.web.controller.monitor; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.dto.PumpInfoDTO; |
||||
import com.mh.common.core.domain.entity.ChillersEntity; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.system.service.device.ICollectionParamsManageService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 生活热水监控 |
||||
* @date 2025-02-17 14:23:33 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device/hotWater") |
||||
public class HotWaterMonitorController extends BaseController { |
||||
|
||||
private final ICollectionParamsManageService iCollectionParamsManageService; |
||||
|
||||
@Autowired |
||||
public HotWaterMonitorController(ICollectionParamsManageService iCollectionParamsManageService) { |
||||
this.iCollectionParamsManageService = iCollectionParamsManageService; |
||||
} |
||||
|
||||
@GetMapping("/pumpListInfo") |
||||
public TableDataInfo list(@RequestParam("registerAddr") String registerAddr, |
||||
@RequestParam("mtType") String mtType) { |
||||
List<PumpInfoDTO> list = iCollectionParamsManageService.selectPumpListInfo(registerAddr, mtType); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 获取水温,压力曲线数据 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/lineData") |
||||
public TableDataInfo lineData(@RequestParam("registerAddr") String registerAddr, |
||||
@RequestParam("mtType") String mtType) { |
||||
List<ChillersEntity> list = iCollectionParamsManageService.lineData(registerAddr, mtType); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.mh.web.controller.monitor; |
||||
|
||||
import com.mh.common.core.controller.BaseController; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 室内温度监测 |
||||
* @date 2025-02-18 15:43:47 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device/indoorTemp") |
||||
public class IndoorTempMonitorController extends BaseController { |
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.mh.web.controller.space; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.AreaInfo; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.space.IAreaInfoService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 区域管理 |
||||
* @date 2025-02-19 16:35:22 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/space/area") |
||||
public class AreaInfoController extends BaseController { |
||||
|
||||
@Autowired |
||||
private IAreaInfoService areaInfoService; |
||||
|
||||
/** |
||||
* 获取区域管理列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:area:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(AreaInfo areaInfo) |
||||
{ |
||||
startPage(); |
||||
List<AreaInfo> list = areaInfoService.selectAreaInfoList(areaInfo); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据区域管理id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:area:query')") |
||||
@GetMapping(value = "/{areaId}") |
||||
public AjaxResult getInfo(@PathVariable String areaId) |
||||
{ |
||||
return success(areaInfoService.selectAreaInfoById(areaId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增区域管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:area:add')") |
||||
@Log(title = "区域管理管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody AreaInfo AreaInfo) |
||||
{ |
||||
AreaInfo.setCreateBy(getUsername()); |
||||
return toAjax(areaInfoService.insertAreaInfo(AreaInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改区域管理信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:area:edit')") |
||||
@Log(title = "区域管理管理", businessType = BusinessType.UPDATE) |
||||
@PutMapping |
||||
public AjaxResult edit(@Validated @RequestBody AreaInfo AreaInfo) |
||||
{ |
||||
AreaInfo.setUpdateBy(getUsername()); |
||||
return toAjax(areaInfoService.updateAreaInfo(AreaInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除区域管理管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:area:remove')") |
||||
@Log(title = "区域管理管理", businessType = BusinessType.DELETE) |
||||
@DeleteMapping("/{areaIds}") |
||||
public AjaxResult remove(@PathVariable String[] areaIds) |
||||
{ |
||||
return toAjax(areaInfoService.deleteAreaInfoByIds(areaIds)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.mh.web.controller.space; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.BuildingInfo; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.space.IBuildingInfoService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼栋管理 |
||||
* @date 2025-02-19 16:35:22 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/space/building") |
||||
public class BuildingInfoController extends BaseController { |
||||
|
||||
@Autowired |
||||
private IBuildingInfoService buildingInfoService; |
||||
|
||||
/** |
||||
* 获取楼栋管理列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:building:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(BuildingInfo buildingInfo) |
||||
{ |
||||
startPage(); |
||||
List<BuildingInfo> list = buildingInfoService.selectBuildingInfoList(buildingInfo); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据楼栋管理id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:building:query')") |
||||
@GetMapping(value = "/{buildingId}") |
||||
public AjaxResult getInfo(@PathVariable String buildingId) |
||||
{ |
||||
return success(buildingInfoService.selectBuildingInfoById(buildingId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增楼栋管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:building:add')") |
||||
@Log(title = "楼栋管理管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody BuildingInfo BuildingInfo) |
||||
{ |
||||
BuildingInfo.setCreateBy(getUsername()); |
||||
return toAjax(buildingInfoService.insertBuildingInfo(BuildingInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改楼栋管理信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:building:edit')") |
||||
@Log(title = "楼栋管理管理", businessType = BusinessType.UPDATE) |
||||
@PutMapping |
||||
public AjaxResult edit(@Validated @RequestBody BuildingInfo BuildingInfo) |
||||
{ |
||||
BuildingInfo.setUpdateBy(getUsername()); |
||||
return toAjax(buildingInfoService.updateBuildingInfo(BuildingInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除楼栋管理管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:building:remove')") |
||||
@Log(title = "楼栋管理管理", businessType = BusinessType.DELETE) |
||||
@DeleteMapping("/{buildingIds}") |
||||
public AjaxResult remove(@PathVariable String[] buildingIds) |
||||
{ |
||||
return toAjax(buildingInfoService.deleteBuildingInfoByIds(buildingIds)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.mh.web.controller.space; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.FloorInfo; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.space.IFloorInfoService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼层管理 |
||||
* @date 2025-02-19 16:35:22 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/space/floor") |
||||
public class FloorInfoController extends BaseController { |
||||
|
||||
@Autowired |
||||
private IFloorInfoService floorInfoService; |
||||
|
||||
/** |
||||
* 获取楼层管理列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:floor:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(FloorInfo floorInfo) |
||||
{ |
||||
startPage(); |
||||
List<FloorInfo> list = floorInfoService.selectFloorInfoList(floorInfo); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据楼层管理id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:floor:query')") |
||||
@GetMapping(value = "/{floorId}") |
||||
public AjaxResult getInfo(@PathVariable String floorId) |
||||
{ |
||||
return success(floorInfoService.selectFloorInfoById(floorId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增楼层管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:floor:add')") |
||||
@Log(title = "楼层管理管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody FloorInfo FloorInfo) |
||||
{ |
||||
FloorInfo.setCreateBy(getUsername()); |
||||
return toAjax(floorInfoService.insertFloorInfo(FloorInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改楼层管理信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:floor:edit')") |
||||
@Log(title = "楼层管理管理", businessType = BusinessType.UPDATE) |
||||
@PutMapping |
||||
public AjaxResult edit(@Validated @RequestBody FloorInfo FloorInfo) |
||||
{ |
||||
FloorInfo.setUpdateBy(getUsername()); |
||||
return toAjax(floorInfoService.updateFloorInfo(FloorInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除楼层管理管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:floor:remove')") |
||||
@Log(title = "楼层管理管理", businessType = BusinessType.DELETE) |
||||
@DeleteMapping("/{floorIds}") |
||||
public AjaxResult remove(@PathVariable String[] floorIds) |
||||
{ |
||||
return toAjax(floorInfoService.deleteFloorInfoByIds(floorIds)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.mh.web.controller.space; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.HouseInfo; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.space.IHouseInfoService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 房间管理 |
||||
* @date 2025-02-19 16:35:22 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/space/house") |
||||
public class HouseInfoController extends BaseController { |
||||
|
||||
@Autowired |
||||
private IHouseInfoService houseInfoService; |
||||
|
||||
/** |
||||
* 获取房间列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:house:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(HouseInfo houseInfo) |
||||
{ |
||||
startPage(); |
||||
List<HouseInfo> list = houseInfoService.selectHouseInfoList(houseInfo); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据房间id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:house:query')") |
||||
@GetMapping(value = "/{houseId}") |
||||
public AjaxResult getInfo(@PathVariable String houseId) |
||||
{ |
||||
return success(houseInfoService.selectHouseInfoById(houseId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增房间 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:house:add')") |
||||
@Log(title = "房间信息管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody HouseInfo HouseInfo) |
||||
{ |
||||
HouseInfo.setCreateBy(getUsername()); |
||||
return toAjax(houseInfoService.insertHouseInfo(HouseInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 修改房间信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:house:edit')") |
||||
@Log(title = "房间信息管理", businessType = BusinessType.UPDATE) |
||||
@PutMapping |
||||
public AjaxResult edit(@Validated @RequestBody HouseInfo HouseInfo) |
||||
{ |
||||
HouseInfo.setUpdateBy(getUsername()); |
||||
return toAjax(houseInfoService.updateHouseInfo(HouseInfo)); |
||||
} |
||||
|
||||
/** |
||||
* 删除房间信息管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:house:remove')") |
||||
@Log(title = "房间信息管理", businessType = BusinessType.DELETE) |
||||
@DeleteMapping("/{houseIds}") |
||||
public AjaxResult remove(@PathVariable String[] houseIds) |
||||
{ |
||||
return toAjax(houseInfoService.deleteHouseInfoByIds(houseIds)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,75 @@
|
||||
package com.mh.common.core.domain.dto; |
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 返回热泵信息内容 |
||||
* @date 2025-02-17 14:39:44 |
||||
*/ |
||||
public class PumpInfoDTO { |
||||
|
||||
/** |
||||
* 名称 |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* 开关状态 |
||||
*/ |
||||
private String switchStatus; |
||||
|
||||
/** |
||||
* 控制状态 |
||||
*/ |
||||
private String controlStatus; |
||||
|
||||
/** |
||||
* 报警状态 |
||||
*/ |
||||
private String alertStatus; |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getSwitchStatus() { |
||||
return switchStatus; |
||||
} |
||||
|
||||
public void setSwitchStatus(String switchStatus) { |
||||
this.switchStatus = switchStatus; |
||||
} |
||||
|
||||
public String getControlStatus() { |
||||
return controlStatus; |
||||
} |
||||
|
||||
public void setControlStatus(String controlStatus) { |
||||
this.controlStatus = controlStatus; |
||||
} |
||||
|
||||
public String getAlertStatus() { |
||||
return alertStatus; |
||||
} |
||||
|
||||
public void setAlertStatus(String alertStatus) { |
||||
this.alertStatus = alertStatus; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("name", name) |
||||
.append("switchStatus", switchStatus) |
||||
.append("controlStatus", controlStatus) |
||||
.append("alertStatus", alertStatus) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,165 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 报警实时记录表 |
||||
* @date 2025-02-18 11:45:49 |
||||
*/ |
||||
@TableName("alarm_records") |
||||
public class AlarmRecords implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 100L; |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 报警内容 |
||||
*/ |
||||
private String content; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private String createTime; |
||||
|
||||
/** |
||||
* 报警类型 |
||||
*/ |
||||
private String alarmType; |
||||
|
||||
/** |
||||
* 事件类型 |
||||
*/ |
||||
private String eventType; |
||||
|
||||
/** |
||||
* 报警级别 |
||||
*/ |
||||
private String alarmLevel; |
||||
|
||||
/** |
||||
* 设备编号 |
||||
*/ |
||||
private String ledgerId; |
||||
|
||||
/** |
||||
* 设备名称 |
||||
*/ |
||||
private String deviceName; |
||||
|
||||
/** |
||||
* 通讯参数id |
||||
*/ |
||||
private String cpmId; |
||||
|
||||
/** |
||||
* 通讯参数名称 |
||||
*/ |
||||
private String cpmName; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getContent() { |
||||
return content; |
||||
} |
||||
|
||||
public void setContent(String content) { |
||||
this.content = content; |
||||
} |
||||
|
||||
public String getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(String createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public String getAlarmType() { |
||||
return alarmType; |
||||
} |
||||
|
||||
public void setAlarmType(String alarmType) { |
||||
this.alarmType = alarmType; |
||||
} |
||||
|
||||
public String getEventType() { |
||||
return eventType; |
||||
} |
||||
|
||||
public void setEventType(String eventType) { |
||||
this.eventType = eventType; |
||||
} |
||||
|
||||
public String getAlarmLevel() { |
||||
return alarmLevel; |
||||
} |
||||
|
||||
public void setAlarmLevel(String alarmLevel) { |
||||
this.alarmLevel = alarmLevel; |
||||
} |
||||
|
||||
public String getLedgerId() { |
||||
return ledgerId; |
||||
} |
||||
|
||||
public void setLedgerId(String ledgerId) { |
||||
this.ledgerId = ledgerId; |
||||
} |
||||
|
||||
public String getDeviceName() { |
||||
return deviceName; |
||||
} |
||||
|
||||
public void setDeviceName(String deviceName) { |
||||
this.deviceName = deviceName; |
||||
} |
||||
|
||||
public String getCpmId() { |
||||
return cpmId; |
||||
} |
||||
|
||||
public void setCpmId(String cpmId) { |
||||
this.cpmId = cpmId; |
||||
} |
||||
|
||||
public String getCpmName() { |
||||
return cpmName; |
||||
} |
||||
|
||||
public void setCpmName(String cpmName) { |
||||
this.cpmName = cpmName; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("content", content) |
||||
.append("createTime", createTime) |
||||
.append("alarmType", alarmType) |
||||
.append("eventType", eventType) |
||||
.append("alarmLevel", alarmLevel) |
||||
.append("ledgerId", ledgerId) |
||||
.append("deviceName", deviceName) |
||||
.append("cpmId", cpmId) |
||||
.append("cpmName", cpmName) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,112 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 区域表 |
||||
* @date 2025-02-19 15:40:10 |
||||
*/ |
||||
@TableName("area_info") |
||||
public class AreaInfo extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 区域名称 |
||||
*/ |
||||
private String areaName; |
||||
|
||||
/** |
||||
* 排序 |
||||
*/ |
||||
private Integer orderNum; |
||||
|
||||
/** |
||||
* 父级区域ID |
||||
*/ |
||||
private String parentId; |
||||
|
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** 请求参数 */ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getAreaName() { |
||||
return areaName; |
||||
} |
||||
|
||||
public void setAreaName(String areaName) { |
||||
this.areaName = areaName; |
||||
} |
||||
|
||||
public Integer getOrderNum() { |
||||
return orderNum; |
||||
} |
||||
|
||||
public void setOrderNum(Integer orderNum) { |
||||
this.orderNum = orderNum; |
||||
} |
||||
|
||||
public String getParentId() { |
||||
return parentId; |
||||
} |
||||
|
||||
public void setParentId(String parentId) { |
||||
this.parentId = parentId; |
||||
} |
||||
|
||||
@Override |
||||
public String getSearchValue() { |
||||
return searchValue; |
||||
} |
||||
|
||||
@Override |
||||
public void setSearchValue(String searchValue) { |
||||
this.searchValue = searchValue; |
||||
} |
||||
|
||||
@Override |
||||
public Map<String, Object> getParams() { |
||||
return params; |
||||
} |
||||
|
||||
@Override |
||||
public void setParams(Map<String, Object> params) { |
||||
this.params = params; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("areaName", areaName) |
||||
.append("orderNum", orderNum) |
||||
.append("parentId", parentId) |
||||
.append("searchValue", searchValue) |
||||
.append("params", params) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,191 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼栋信息 |
||||
* @date 2025-02-19 15:49:33 |
||||
*/ |
||||
@TableName("building_info") |
||||
public class BuildingInfo extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; // 楼栋唯一标识符,作为主键使用。
|
||||
private String buildingName; // 楼栋名称,用于标识具体的楼栋。
|
||||
private String parentId; // 父级楼栋id,默认值为"0",表示顶级楼栋。
|
||||
private Integer levelsCount; // 楼层数量,表示该楼栋有多少层。
|
||||
private Integer beginLevel; // 起始楼层号,表示楼栋的第一层编号。
|
||||
private Integer houseCount; // 每层房间数,记录每层楼有多少个房间。
|
||||
private Integer bedCount; // 床位总数,记录楼栋内的总床位数量。
|
||||
private Integer checkInCount; // 实际入住数,记录当前已入住的人数或床位数。
|
||||
private String areaId; // 区域id,标识楼栋所属的地理或管理区域。
|
||||
private Integer orderNum; // 排序号,用于定义楼栋显示顺序。
|
||||
private BigDecimal tankHeight; // 水箱高度,记录楼栋内水箱的高度信息。
|
||||
private Integer pumpCount; // 水泵数量,记录楼栋内安装的水泵数量。
|
||||
private BigDecimal lowTankHeight; // 低区水箱高度,记录低区水箱的具体高度。
|
||||
|
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** 请求参数 */ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getBuildingName() { |
||||
return buildingName; |
||||
} |
||||
|
||||
public void setBuildingName(String buildingName) { |
||||
this.buildingName = buildingName; |
||||
} |
||||
|
||||
public String getParentId() { |
||||
return parentId; |
||||
} |
||||
|
||||
public void setParentId(String parentId) { |
||||
this.parentId = parentId; |
||||
} |
||||
|
||||
public Integer getLevelsCount() { |
||||
return levelsCount; |
||||
} |
||||
|
||||
public void setLevelsCount(Integer levelsCount) { |
||||
this.levelsCount = levelsCount; |
||||
} |
||||
|
||||
public Integer getBeginLevel() { |
||||
return beginLevel; |
||||
} |
||||
|
||||
public void setBeginLevel(Integer beginLevel) { |
||||
this.beginLevel = beginLevel; |
||||
} |
||||
|
||||
public Integer getHouseCount() { |
||||
return houseCount; |
||||
} |
||||
|
||||
public void setHouseCount(Integer houseCount) { |
||||
this.houseCount = houseCount; |
||||
} |
||||
|
||||
public Integer getBedCount() { |
||||
return bedCount; |
||||
} |
||||
|
||||
public void setBedCount(Integer bedCount) { |
||||
this.bedCount = bedCount; |
||||
} |
||||
|
||||
public Integer getCheckInCount() { |
||||
return checkInCount; |
||||
} |
||||
|
||||
public void setCheckInCount(Integer checkInCount) { |
||||
this.checkInCount = checkInCount; |
||||
} |
||||
|
||||
public String getAreaId() { |
||||
return areaId; |
||||
} |
||||
|
||||
public void setAreaId(String areaId) { |
||||
this.areaId = areaId; |
||||
} |
||||
|
||||
public Integer getOrderNum() { |
||||
return orderNum; |
||||
} |
||||
|
||||
public void setOrderNum(Integer orderNum) { |
||||
this.orderNum = orderNum; |
||||
} |
||||
|
||||
public BigDecimal getTankHeight() { |
||||
return tankHeight; |
||||
} |
||||
|
||||
public void setTankHeight(BigDecimal tankHeight) { |
||||
this.tankHeight = tankHeight; |
||||
} |
||||
|
||||
public Integer getPumpCount() { |
||||
return pumpCount; |
||||
} |
||||
|
||||
public void setPumpCount(Integer pumpCount) { |
||||
this.pumpCount = pumpCount; |
||||
} |
||||
|
||||
public BigDecimal getLowTankHeight() { |
||||
return lowTankHeight; |
||||
} |
||||
|
||||
public void setLowTankHeight(BigDecimal lowTankHeight) { |
||||
this.lowTankHeight = lowTankHeight; |
||||
} |
||||
|
||||
@Override |
||||
public String getSearchValue() { |
||||
return searchValue; |
||||
} |
||||
|
||||
@Override |
||||
public void setSearchValue(String searchValue) { |
||||
this.searchValue = searchValue; |
||||
} |
||||
|
||||
@Override |
||||
public Map<String, Object> getParams() { |
||||
return params; |
||||
} |
||||
|
||||
@Override |
||||
public void setParams(Map<String, Object> params) { |
||||
this.params = params; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("buildingName", buildingName) |
||||
.append("parentId", parentId) |
||||
.append("levelsCount", levelsCount) |
||||
.append("beginLevel", beginLevel) |
||||
.append("houseCount", houseCount) |
||||
.append("bedCount", bedCount) |
||||
.append("checkInCount", checkInCount) |
||||
.append("areaId", areaId) |
||||
.append("orderNum", orderNum) |
||||
.append("tankHeight", tankHeight) |
||||
.append("pumpCount", pumpCount) |
||||
.append("lowTankHeight", lowTankHeight) |
||||
.append("searchValue", searchValue) |
||||
.append("params", params) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,95 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼层信息表 |
||||
* @date 2025-02-19 16:00:57 |
||||
*/ |
||||
@Setter |
||||
@Getter |
||||
@TableName("floor_info") |
||||
public class FloorInfo extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 区域id |
||||
*/ |
||||
private String areaId; |
||||
|
||||
/** |
||||
* 楼栋id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 楼层名称 |
||||
*/ |
||||
private String floorName; |
||||
|
||||
/** |
||||
* 楼层编号 |
||||
*/ |
||||
private Integer floorNum; |
||||
|
||||
/** |
||||
* 楼层用处 |
||||
*/ |
||||
private String floorPurpose; |
||||
|
||||
/** |
||||
* 楼层面积 |
||||
*/ |
||||
private BigDecimal floorArea; |
||||
|
||||
/** |
||||
* 排序 |
||||
*/ |
||||
private Integer orderNum; |
||||
|
||||
/** |
||||
* 父id |
||||
*/ |
||||
private String parentId = "0"; |
||||
|
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** 请求参数 */ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("areaId", areaId) |
||||
.append("buildingId", buildingId) |
||||
.append("floorName", floorName) |
||||
.append("floorNum", floorNum) |
||||
.append("floorPurpose", floorPurpose) |
||||
.append("floorArea", floorArea) |
||||
.append("orderNum", orderNum) |
||||
.append("parentId", parentId) |
||||
.append("searchValue", searchValue) |
||||
.append("params", params) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,108 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 房间信息表 |
||||
* @date 2025-02-19 16:13:15 |
||||
*/ |
||||
@Setter |
||||
@Getter |
||||
@TableName("house_info") |
||||
public class HouseInfo extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 区域id |
||||
*/ |
||||
private String areaId; |
||||
|
||||
/** |
||||
* 楼栋id |
||||
*/ |
||||
private String buildingId; |
||||
|
||||
/** |
||||
* 楼层id |
||||
*/ |
||||
private String floorId; |
||||
|
||||
/** |
||||
* 房间名称 |
||||
*/ |
||||
private String houseName; |
||||
|
||||
/** |
||||
* 房屋详细地址 |
||||
*/ |
||||
private String address; |
||||
|
||||
/** |
||||
* 房屋价格,保留两位小数 |
||||
*/ |
||||
private BigDecimal price; |
||||
|
||||
/** |
||||
* 房屋总面积 |
||||
*/ |
||||
private BigDecimal totalArea; |
||||
|
||||
/** |
||||
* 房屋使用面积(可居住部分) |
||||
*/ |
||||
private BigDecimal usableArea; |
||||
|
||||
/** |
||||
*建造年份 |
||||
*/ |
||||
private String builtYear; |
||||
|
||||
/** |
||||
* 0:正常,1:禁用 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
@TableField(exist = false) |
||||
private String searchValue; |
||||
|
||||
/** 请求参数 */ |
||||
@TableField(exist = false) |
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY) |
||||
private Map<String, Object> params; |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("areaId", areaId) |
||||
.append("buildingId", buildingId) |
||||
.append("floorId", floorId) |
||||
.append("houseName", houseName) |
||||
.append("address", address) |
||||
.append("price", price) |
||||
.append("totalArea", totalArea) |
||||
.append("usableArea", usableArea) |
||||
.append("builtYear", builtYear) |
||||
.append("status", status) |
||||
.append("searchValue", searchValue) |
||||
.append("params", params) |
||||
.toString(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.mh.system.mapper.space; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.AreaInfo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 区域管理 |
||||
* @date 2025-02-19 18:41:31 |
||||
*/ |
||||
@Mapper |
||||
public interface AreaInfoMapper extends BaseMapper<AreaInfo> { |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.mh.system.mapper.space; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.BuildingInfo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼栋管理 |
||||
* @date 2025-02-19 18:41:31 |
||||
*/ |
||||
@Mapper |
||||
public interface BuildingInfoMapper extends BaseMapper<BuildingInfo> { |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.mh.system.mapper.space; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.FloorInfo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼层管理 |
||||
* @date 2025-02-19 18:41:31 |
||||
*/ |
||||
@Mapper |
||||
public interface FloorInfoMapper extends BaseMapper<FloorInfo> { |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.mh.system.mapper.space; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.FloorInfo; |
||||
import com.mh.common.core.domain.entity.HouseInfo; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 房间管理 |
||||
* @date 2025-02-19 18:41:31 |
||||
*/ |
||||
@Mapper |
||||
public interface HouseInfoMapper extends BaseMapper<HouseInfo> { |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.mh.system.service.space; |
||||
|
||||
import com.mh.common.core.domain.entity.AreaInfo; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 区域管理 |
||||
* @date 2025-02-19 16:37:19 |
||||
*/ |
||||
public interface IAreaInfoService { |
||||
|
||||
List<AreaInfo> selectAreaInfoList(AreaInfo ledgerInfo); |
||||
|
||||
AreaInfo selectAreaInfoById(String ledgerId); |
||||
|
||||
int insertAreaInfo(AreaInfo gatewayManage); |
||||
|
||||
int updateAreaInfo(AreaInfo gatewayManage); |
||||
|
||||
int deleteAreaInfoByIds(String[] ledgerIds); |
||||
|
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.mh.system.service.space; |
||||
|
||||
import com.mh.common.core.domain.entity.BuildingInfo; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼栋管理管理 |
||||
* @date 2025-02-19 16:37:19 |
||||
*/ |
||||
public interface IBuildingInfoService { |
||||
|
||||
List<BuildingInfo> selectBuildingInfoList(BuildingInfo buildingInfo); |
||||
|
||||
BuildingInfo selectBuildingInfoById(String buildingId); |
||||
|
||||
int insertBuildingInfo(BuildingInfo buildingInfo); |
||||
|
||||
int updateBuildingInfo(BuildingInfo buildingInfo); |
||||
|
||||
int deleteBuildingInfoByIds(String[] buildingIds); |
||||
|
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.mh.system.service.space; |
||||
|
||||
import com.mh.common.core.domain.entity.FloorInfo; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼栋管理管理 |
||||
* @date 2025-02-19 16:37:19 |
||||
*/ |
||||
public interface IFloorInfoService { |
||||
|
||||
List<FloorInfo> selectFloorInfoList(FloorInfo floorInfo); |
||||
|
||||
FloorInfo selectFloorInfoById(String buildingId); |
||||
|
||||
int insertFloorInfo(FloorInfo floorInfo); |
||||
|
||||
int updateFloorInfo(FloorInfo floorInfo); |
||||
|
||||
int deleteFloorInfoByIds(String[] buildingIds); |
||||
|
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.mh.system.service.space; |
||||
|
||||
import com.mh.common.core.domain.entity.HouseInfo; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 房间管理管理 |
||||
* @date 2025-02-19 16:37:19 |
||||
*/ |
||||
public interface IHouseInfoService { |
||||
|
||||
List<HouseInfo> selectHouseInfoList(HouseInfo houseInfo); |
||||
|
||||
HouseInfo selectHouseInfoById(String buildingId); |
||||
|
||||
int insertHouseInfo(HouseInfo houseInfo); |
||||
|
||||
int updateHouseInfo(HouseInfo houseInfo); |
||||
|
||||
int deleteHouseInfoByIds(String[] buildingIds); |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
package com.mh.system.service.space.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.AreaInfo; |
||||
import com.mh.common.core.domain.entity.DeviceLedger; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.system.mapper.space.AreaInfoMapper; |
||||
import com.mh.system.service.space.IAreaInfoService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 区域管理实现类 |
||||
* @date 2025-02-19 16:46:38 |
||||
*/ |
||||
@Service |
||||
public class AreaInfoServiceImpl implements IAreaInfoService { |
||||
|
||||
@Resource |
||||
private AreaInfoMapper areaInfoMapper; |
||||
|
||||
@Override |
||||
public List<AreaInfo> selectAreaInfoList(AreaInfo areaInfo) { |
||||
if (areaInfo == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<AreaInfo> queryWrapper = new QueryWrapper<>(); |
||||
// 区域名称
|
||||
if (!StringUtils.isEmpty(areaInfo.getAreaName())) { |
||||
queryWrapper.like("area_name", areaInfo.getAreaName()); |
||||
} |
||||
// 备注
|
||||
if (!StringUtils.isEmpty(areaInfo.getRemark())) { |
||||
queryWrapper.like("remark", areaInfo.getRemark()); |
||||
} |
||||
queryWrapper.orderByAsc("order_num"); |
||||
return areaInfoMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public AreaInfo selectAreaInfoById(String areaInfo) { |
||||
return areaInfoMapper.selectById(areaInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int insertAreaInfo(AreaInfo areaInfo) { |
||||
return areaInfoMapper.insert(areaInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int updateAreaInfo(AreaInfo areaInfo) { |
||||
return areaInfoMapper.updateById(areaInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int deleteAreaInfoByIds(String[] areaInfos) { |
||||
if (areaInfos != null && areaInfos.length > 0) { |
||||
for (String areaInfo : areaInfos) { |
||||
areaInfoMapper.deleteById(areaInfo); |
||||
} |
||||
return areaInfos.length; |
||||
} |
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,80 @@
|
||||
package com.mh.system.service.space.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.AreaInfo; |
||||
import com.mh.common.core.domain.entity.BuildingInfo; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.system.mapper.space.BuildingInfoMapper; |
||||
import com.mh.system.service.space.IBuildingInfoService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 区域管理实现类 |
||||
* @date 2025-02-19 16:46:38 |
||||
*/ |
||||
@Service |
||||
public class BuildingInfoServiceImpl implements IBuildingInfoService { |
||||
|
||||
@Resource |
||||
private BuildingInfoMapper buildingInfoMapper; |
||||
|
||||
@Override |
||||
public List<BuildingInfo> selectBuildingInfoList(BuildingInfo buildingInfo) { |
||||
if (buildingInfo == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<BuildingInfo> queryWrapper = new QueryWrapper<>(); |
||||
// 区域id
|
||||
if (!StringUtils.isEmpty(buildingInfo.getAreaId())) { |
||||
queryWrapper.eq("area_id", buildingInfo.getAreaId()); |
||||
} |
||||
// 楼栋名称
|
||||
if (!StringUtils.isEmpty(buildingInfo.getBuildingName())) { |
||||
queryWrapper.like("building_name", buildingInfo.getBuildingName()); |
||||
} |
||||
// 备注
|
||||
if (!StringUtils.isEmpty(buildingInfo.getRemark())) { |
||||
queryWrapper.like("remark", buildingInfo.getRemark()); |
||||
} |
||||
queryWrapper.orderByAsc("order_num"); |
||||
return buildingInfoMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public BuildingInfo selectBuildingInfoById(String buildingId) { |
||||
return buildingInfoMapper.selectById(buildingId); |
||||
} |
||||
|
||||
@Override |
||||
public int insertBuildingInfo(BuildingInfo buildingInfo) { |
||||
if (StringUtils.isEmpty(buildingInfo.getAreaId())) { |
||||
throw new RuntimeException("没有对应的区域id"); |
||||
} |
||||
return buildingInfoMapper.insert(buildingInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int updateBuildingInfo(BuildingInfo buildingInfo) { |
||||
if (StringUtils.isEmpty(buildingInfo.getAreaId())) { |
||||
throw new RuntimeException("没有对应的区域id"); |
||||
} |
||||
return buildingInfoMapper.updateById(buildingInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int deleteBuildingInfoByIds(String[] buildingIds) { |
||||
if (buildingIds != null && buildingIds.length > 0) { |
||||
for (String buildingId : buildingIds) { |
||||
buildingInfoMapper.deleteById(buildingId); |
||||
} |
||||
return buildingIds.length; |
||||
} |
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,89 @@
|
||||
package com.mh.system.service.space.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.FloorInfo; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.system.mapper.space.FloorInfoMapper; |
||||
import com.mh.system.service.space.IFloorInfoService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 楼层实现类 |
||||
* @date 2025-02-19 17:28:13 |
||||
*/ |
||||
@Service |
||||
public class FloorInfoServiceImpl implements IFloorInfoService { |
||||
|
||||
@Resource |
||||
private FloorInfoMapper floorInfoMapper; |
||||
|
||||
@Override |
||||
public List<FloorInfo> selectFloorInfoList(FloorInfo floorInfo) { |
||||
if (floorInfo == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<FloorInfo> queryWrapper = new QueryWrapper<>(); |
||||
// 区域id
|
||||
if (!StringUtils.isEmpty(floorInfo.getAreaId())) { |
||||
queryWrapper.eq("area_id", floorInfo.getAreaId()); |
||||
} |
||||
// 楼栋id
|
||||
if (!StringUtils.isEmpty(floorInfo.getBuildingId())) { |
||||
queryWrapper.like("building_id", floorInfo.getBuildingId()); |
||||
} |
||||
// 楼层名称
|
||||
if (!StringUtils.isEmpty(floorInfo.getFloorName())) { |
||||
queryWrapper.like("floor_name", floorInfo.getFloorName()); |
||||
} |
||||
// 备注
|
||||
if (!StringUtils.isEmpty(floorInfo.getRemark())) { |
||||
queryWrapper.like("remark", floorInfo.getRemark()); |
||||
} |
||||
queryWrapper.orderByAsc("order_num"); |
||||
return floorInfoMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public FloorInfo selectFloorInfoById(String floorId) { |
||||
return floorInfoMapper.selectById(floorId); |
||||
} |
||||
|
||||
@Override |
||||
public int insertFloorInfo(FloorInfo floorInfo) { |
||||
if(StringUtils.isEmpty(floorInfo.getAreaId())) { |
||||
throw new RuntimeException("没有对应的区域id"); |
||||
} |
||||
if(StringUtils.isEmpty(floorInfo.getBuildingId())) { |
||||
throw new RuntimeException("没有对应的楼栋id"); |
||||
} |
||||
return floorInfoMapper.insert(floorInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int updateFloorInfo(FloorInfo floorInfo) { |
||||
if(StringUtils.isEmpty(floorInfo.getAreaId())) { |
||||
throw new RuntimeException("没有对应的区域id"); |
||||
} |
||||
if(StringUtils.isEmpty(floorInfo.getBuildingId())) { |
||||
throw new RuntimeException("没有对应的楼栋id"); |
||||
} |
||||
return floorInfoMapper.updateById(floorInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int deleteFloorInfoByIds(String[] floorIds) { |
||||
if (floorIds != null && floorIds.length > 0) { |
||||
for (String floorId : floorIds) { |
||||
floorInfoMapper.deleteById(floorId); |
||||
} |
||||
return floorIds.length; |
||||
} |
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,99 @@
|
||||
package com.mh.system.service.space.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.HouseInfo; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.system.mapper.space.HouseInfoMapper; |
||||
import com.mh.system.service.space.IHouseInfoService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 房间管理 |
||||
* @date 2025-02-19 18:34:42 |
||||
*/ |
||||
@Service |
||||
public class HouseInfoServiceImpl implements IHouseInfoService { |
||||
|
||||
@Resource |
||||
private HouseInfoMapper houseInfoMapper; |
||||
|
||||
@Override |
||||
public List<HouseInfo> selectHouseInfoList(HouseInfo houseInfo) { |
||||
if (houseInfo == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<HouseInfo> queryWrapper = new QueryWrapper<>(); |
||||
// 区域id
|
||||
if (!StringUtils.isEmpty(houseInfo.getAreaId())) { |
||||
queryWrapper.eq("area_id", houseInfo.getAreaId()); |
||||
} |
||||
// 楼栋id
|
||||
if (!StringUtils.isEmpty(houseInfo.getBuildingId())) { |
||||
queryWrapper.eq("building_id", houseInfo.getBuildingId()); |
||||
} |
||||
// 楼层id
|
||||
if (!StringUtils.isEmpty(houseInfo.getFloorId())) { |
||||
queryWrapper.eq("floor_id", houseInfo.getFloorId()); |
||||
} |
||||
// 房间名称
|
||||
if (!StringUtils.isEmpty(houseInfo.getHouseName())) { |
||||
queryWrapper.like("house_name", houseInfo.getHouseName()); |
||||
} |
||||
// 备注
|
||||
if (!StringUtils.isEmpty(houseInfo.getRemark())) { |
||||
queryWrapper.like("remark", houseInfo.getRemark()); |
||||
} |
||||
queryWrapper.orderByAsc("order_num"); |
||||
return houseInfoMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public HouseInfo selectHouseInfoById(String buildingId) { |
||||
return houseInfoMapper.selectById(buildingId); |
||||
} |
||||
|
||||
@Override |
||||
public int insertHouseInfo(HouseInfo houseInfo) { |
||||
if (StringUtils.isEmpty(houseInfo.getAreaId())) { |
||||
throw new RuntimeException("没有对应的区域id"); |
||||
} |
||||
if (StringUtils.isEmpty(houseInfo.getBuildingId())) { |
||||
throw new RuntimeException("没有对应的楼栋id"); |
||||
} |
||||
if (StringUtils.isEmpty(houseInfo.getFloorId())) { |
||||
throw new RuntimeException("没有对应的楼层id"); |
||||
} |
||||
return houseInfoMapper.insert(houseInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int updateHouseInfo(HouseInfo houseInfo) { |
||||
if (StringUtils.isEmpty(houseInfo.getAreaId())) { |
||||
throw new RuntimeException("没有对应的区域id"); |
||||
} |
||||
if (StringUtils.isEmpty(houseInfo.getBuildingId())) { |
||||
throw new RuntimeException("没有对应的楼栋id"); |
||||
} |
||||
if (StringUtils.isEmpty(houseInfo.getFloorId())) { |
||||
throw new RuntimeException("没有对应的楼层id"); |
||||
} |
||||
return houseInfoMapper.updateById(houseInfo); |
||||
} |
||||
|
||||
@Override |
||||
public int deleteHouseInfoByIds(String[] buildingIds) { |
||||
if (buildingIds != null && buildingIds.length > 0) { |
||||
for (String buildingId : buildingIds) { |
||||
houseInfoMapper.deleteById(buildingId); |
||||
} |
||||
return buildingIds.length; |
||||
} |
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,162 @@
|
||||
-- 区域表 |
||||
create table area_info ( |
||||
id varchar(36) not null primary key, |
||||
area_name varchar(200) not null, |
||||
order_num int4, |
||||
parent_id varchar(36) default 0, |
||||
remark varchar(500), |
||||
create_by varchar(200), |
||||
update_by varchar(200), |
||||
created_time timestamp default current_timestamp, |
||||
updated_time timestamp default current_timestamp |
||||
); |
||||
comment on table area_info is '区域信息表,用于存储系统中的所有区域数据'; |
||||
comment on column area_info.id is '区域唯一标识符,使用uuid格式确保全局唯一性[ty-reference](2)'; |
||||
comment on column area_info.area_name is '区域名称,最长支持200个字符'; |
||||
comment on column area_info.order_num is '排序号,用于定义区域显示顺序'; |
||||
comment on column area_info.parent_id is '父级区域id,默认值为0表示顶级区域'; |
||||
comment on column area_info.remark is '备注信息,允许存储长达500个字符的额外说明'; |
||||
comment on column area_info.create_by is '创建者,记录创建该区域的用户信息'; |
||||
comment on column area_info.update_by is '最后更新者,记录最近一次修改该区域的用户信息'; |
||||
comment on column area_info.created_time is '创建时间,默认值为当前时间戳'; |
||||
comment on column area_info.updated_time is '最后更新时间,默认值为当前时间戳'; |
||||
create index idx_area_name on area_info (area_name); |
||||
create index idx_area_parent_id on area_info (parent_id); |
||||
create index idx_area_parent_order on area_info (parent_id, order_num); |
||||
create index idx_area_remark_fulltext on area_info using gin(to_tsvector('english', remark)); |
||||
create index idx_area_created_time on area_info (created_time); |
||||
create index idx_area_updated_time on area_info (updated_time); |
||||
|
||||
-- 楼栋表 |
||||
create table building_info ( |
||||
id varchar(36) not null, |
||||
building_name varchar(100) null, |
||||
parent_id varchar(36) default 0, |
||||
levels_count int null, |
||||
begin_level int null, |
||||
house_count int null, |
||||
bed_count int null, |
||||
check_in_count int null, |
||||
area_id varchar(36) null, |
||||
remark varchar(128) null, |
||||
order_num int4, |
||||
tank_height numeric(24,2) null, |
||||
pump_count int null, |
||||
low_tank_height numeric(24,2) null, |
||||
create_by varchar(200), |
||||
update_by varchar(200), |
||||
created_time timestamp default current_timestamp, |
||||
updated_time timestamp default current_timestamp, |
||||
constraint pk_building primary key (id) |
||||
); |
||||
-- 表的注释 |
||||
comment on table building_info is '楼栋信息表,记录了每个楼栋的基本信息及关联数据。'; |
||||
|
||||
-- 列的注释 |
||||
comment on column building_info.id is '楼栋唯一标识符,作为主键使用。'; |
||||
comment on column building_info.building_name is '楼栋名称,用于标识具体的楼栋。'; |
||||
comment on column building_info.parent_id is '父级楼栋id,默认值为"0",表示顶级楼栋。'; |
||||
comment on column building_info.levels_count is '楼层数量,表示该楼栋有多少层。'; |
||||
comment on column building_info.begin_level is '起始楼层号,表示楼栋的第一层编号。'; |
||||
comment on column building_info.house_count is '每层房间数,记录每层楼有多少个房间。'; |
||||
comment on column building_info.bed_count is '床位总数,记录楼栋内的总床位数量。'; |
||||
comment on column building_info.check_in_count is '实际入住数,记录当前已入住的人数或床位数。'; |
||||
comment on column building_info.area_id is '区域id,标识楼栋所属的地理或管理区域。'; |
||||
comment on column building_info.remark is '备注信息,用于存储额外的说明或注释。'; |
||||
comment on column building_info.order_num is '排序号,用于定义楼栋显示顺序。'; |
||||
comment on column building_info.tank_height is '水箱高度,记录楼栋内水箱的高度信息。'; |
||||
comment on column building_info.pump_count is '水泵数量,记录楼栋内安装的水泵数量。'; |
||||
comment on column building_info.low_tank_height is '低区水箱高度,记录低区水箱的具体高度。'; |
||||
comment on column building_info.create_by is '创建者,记录谁创建了这条记录。'; |
||||
comment on column building_info.update_by is '更新者,记录最近一次修改该记录的用户。'; |
||||
comment on column building_info.created_time is '创建时间,自动设置为记录创建时的时间戳。'; |
||||
comment on column building_info.updated_time is '更新时间,自动设置为记录最后一次修改的时间戳。'; |
||||
|
||||
create index idx_building_name on building_info (building_name); |
||||
create index idx_area_id on building_info (area_id); |
||||
create index idx_order_num on building_info (order_num); |
||||
create index idx_area_building on building_info (area_id, building_name); |
||||
|
||||
-- 楼层表 |
||||
create table floor_info ( |
||||
id varchar(36) not null primary key, |
||||
area_id varchar(36) not null, |
||||
building_id varchar(36) not null, |
||||
floor_name varchar(200) null, |
||||
floor_num int4 null, |
||||
floor_purpose varchar(100) null, |
||||
floor_area numeric(24, 2) null, |
||||
order_num int4, |
||||
parent_id varchar(36) default '0', |
||||
remark varchar(500), |
||||
create_by varchar(200), |
||||
update_by varchar(200), |
||||
created_time timestamp default current_timestamp, |
||||
updated_time timestamp default current_timestamp |
||||
); |
||||
|
||||
-- 添加表注释 |
||||
comment on table floor_info is '楼层信息表,用于记录建筑物内各楼层的基本信息和属性'; |
||||
|
||||
-- 为每个字段添加注释 |
||||
comment on column floor_info.id is '楼层唯一标识符,作为主键使用'; |
||||
comment on column floor_info.area_id is '所属区域id,关联到区域表'; |
||||
comment on column floor_info.building_id is '所属建筑物id,关联到建筑物表'; |
||||
comment on column floor_info.floor_name is '楼层名称,如“ground floor”或“basement”'; |
||||
comment on column floor_info.floor_num is '楼层编号,在同一建筑物内必须唯一'; |
||||
comment on column floor_info.floor_purpose is '楼层用途,例如办公、住宅、停车场等'; |
||||
comment on column floor_info.floor_area is '楼层总面积,单位为平方米'; |
||||
comment on column floor_info.order_num is '楼层排序号,用于定义楼层显示顺序'; |
||||
comment on column floor_info.parent_id is '父级楼层id,默认值为“0”,表示无父级楼层'; |
||||
comment on column floor_info.remark is '备注信息,用于记录额外说明'; |
||||
comment on column floor_info.create_by is '创建者,记录谁创建了这条记录'; |
||||
comment on column floor_info.update_by is '更新者,记录最近一次修改该记录的用户'; |
||||
comment on column floor_info.created_time is '创建时间,自动设置为记录创建时的时间戳'; |
||||
comment on column floor_info.updated_time is '更新时间,自动设置为记录最后一次修改的时间戳'; |
||||
create index idx_floor_info_area_id on floor_info (area_id); |
||||
create index idx_floor_info_building_id on floor_info (building_id); |
||||
create index idx_floor_info_floor_purpose on floor_info (floor_purpose); |
||||
create index idx_floor_info_building_floor on floor_info (building_id, floor_num); |
||||
create index idx_floor_info_area_purpose on floor_info (area_id, floor_purpose); |
||||
|
||||
create table house_info ( |
||||
id varchar(36) primary key not null, -- 房屋唯一标识符,自增主键 |
||||
area_id varchar(36) not null, -- 所属区域id,外键关联到area表 |
||||
building_id varchar(36) not null, -- 所属建筑物id,外键关联到building表 |
||||
floor_id varchar(36) not null, -- 所属楼层id,外键关联到floor_info表 |
||||
house_name varchar(100) null, -- 房间名称 |
||||
address varchar(200) null, -- 房屋详细地址 |
||||
price decimal(10, 2), -- 房屋价格,保留两位小数 |
||||
total_area numeric(24, 2), -- 房屋总面积 |
||||
usable_area numeric(24, 2), -- 房屋使用面积(可居住部分) |
||||
built_year varchar(20), -- 建造年份 |
||||
status int default 0, -- 0:正常,1:禁用 |
||||
remark varchar(500) null, -- 备注信息 |
||||
create_by varchar(200) null, -- 创建者 |
||||
update_by varchar(200) null, -- 更新者 |
||||
created_time timestamp default current_timestamp, -- 创建时间 |
||||
updated_time timestamp default current_timestamp -- 更新时间 |
||||
); |
||||
comment on table house_info is '房屋信息表,用于存储房屋的基本信息及属性'; |
||||
|
||||
comment on column house_info.id is '房屋唯一标识符'; |
||||
comment on column house_info.area_id is '所属区域id,外键关联到area表'; |
||||
comment on column house_info.building_id is '所属建筑物id,外键关联到building表'; |
||||
comment on column house_info.floor_id is '所属楼层id,外键关联到floor_info表'; |
||||
comment on column house_info.house_name is '房间名称'; |
||||
comment on column house_info.address is '房屋详细地址'; |
||||
comment on column house_info.price is '房屋价格,保留两位小数'; |
||||
comment on column house_info.total_area is '房屋总面积'; |
||||
comment on column house_info.usable_area is '房屋使用面积(可居住部分)'; |
||||
comment on column house_info.built_year is '建造年份'; |
||||
comment on column house_info.status is '状态:0:正常,1:禁用'; |
||||
comment on column house_info.remark is '备注信息'; |
||||
comment on column house_info.create_by is '创建者'; |
||||
comment on column house_info.update_by is '更新者'; |
||||
comment on column house_info.created_time is '创建时间'; |
||||
comment on column house_info.updated_time is '更新时间'; |
||||
create index idx_house_info_area_id on house_info (area_id); |
||||
create index idx_house_info_building_id on house_info (building_id); |
||||
create index idx_house_info_floor_id on house_info (floor_id); |
||||
create index idx_house_info_area_building on house_info (area_id, building_id); |
||||
create index idx_house_info_building_floor on house_info (building_id, floor_id); |
Loading…
Reference in new issue