新增能源管理模块的实时功能后端代码
parent
83e370533c
commit
55b1f87ce7
@ -0,0 +1,103 @@
|
||||
package com.hw.ems.base.controller;
|
||||
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo;
|
||||
import com.hw.ems.base.service.IEmsBaseCollectDeviceInfoService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采集设备信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/baseCollectDeviceInfo")
|
||||
public class EmsBaseCollectDeviceInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IEmsBaseCollectDeviceInfoService emsBaseCollectDeviceInfoService;
|
||||
|
||||
/**
|
||||
* 查询采集设备信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
startPage();
|
||||
List<EmsBaseCollectDeviceInfo> list = emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采集设备信息下拉框列表
|
||||
*/
|
||||
@GetMapping("/getCollectDeviceInfo")
|
||||
public AjaxResult getCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
List<EmsBaseCollectDeviceInfo> list = emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出采集设备信息列表
|
||||
*/
|
||||
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
List<EmsBaseCollectDeviceInfo> list = emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo);
|
||||
ExcelUtil<EmsBaseCollectDeviceInfo> util = new ExcelUtil<EmsBaseCollectDeviceInfo>(EmsBaseCollectDeviceInfo.class);
|
||||
util.exportExcel(response, list, "采集设备信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采集设备信息详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(emsBaseCollectDeviceInfoService.selectEmsBaseCollectDeviceInfoByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采集设备信息
|
||||
*/
|
||||
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
// emsBaseCollectDeviceInfo.setCreateBy(getUsername());
|
||||
return toAjax(emsBaseCollectDeviceInfoService.insertEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采集设备信息
|
||||
*/
|
||||
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
// emsBaseCollectDeviceInfo.setUpdateBy(getUsername());
|
||||
return toAjax(emsBaseCollectDeviceInfoService.updateEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采集设备信息
|
||||
*/
|
||||
|
||||
@Log(title = "采集设备信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(emsBaseCollectDeviceInfoService.deleteEmsBaseCollectDeviceInfoByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.hw.ems.base.controller;
|
||||
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.ems.base.domain.EmsBaseEnergyType;
|
||||
import com.hw.ems.base.service.IEmsBaseEnergyTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能源类型信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/baseEnergyType")
|
||||
public class EmsBaseEnergyTypeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsBaseEnergyTypeService emsBaseEnergyTypeService;
|
||||
|
||||
/**
|
||||
* 查询能源类型信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
startPage();
|
||||
List<EmsBaseEnergyType> list = emsBaseEnergyTypeService.selectEmsBaseEnergyTypeList(emsBaseEnergyType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 根据能源类型id查询能源类型名称
|
||||
// * @param energyTypeId
|
||||
// * @return
|
||||
// */
|
||||
// public AjaxResult queryEnergyNameByEnergyTypeId(int energyTypeId)
|
||||
// {
|
||||
// String energyName = emsBaseEnergyTypeService.queryEnergyNameByEnergyTypeId(energyTypeId);
|
||||
// return success(energyName);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询能源类型信息下拉框列表
|
||||
*/
|
||||
@GetMapping("/getBaseEnergyTypeList")
|
||||
public AjaxResult baseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
List<EmsBaseEnergyType> list = emsBaseEnergyTypeService.selectEmsBaseEnergyTypeList(emsBaseEnergyType);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出能源类型信息列表
|
||||
*/
|
||||
|
||||
@Log(title = "能源类型信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
List<EmsBaseEnergyType> list = emsBaseEnergyTypeService.selectEmsBaseEnergyTypeList(emsBaseEnergyType);
|
||||
ExcelUtil<EmsBaseEnergyType> util = new ExcelUtil<EmsBaseEnergyType>(EmsBaseEnergyType.class);
|
||||
util.exportExcel(response, list, "能源类型信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取能源类型信息详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||
{
|
||||
return success(emsBaseEnergyTypeService.selectEmsBaseEnergyTypeByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增能源类型信息
|
||||
*/
|
||||
|
||||
@Log(title = "能源类型信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
return toAjax(emsBaseEnergyTypeService.insertEmsBaseEnergyType(emsBaseEnergyType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改能源类型信息
|
||||
*/
|
||||
|
||||
@Log(title = "能源类型信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
return toAjax(emsBaseEnergyTypeService.updateEmsBaseEnergyType(emsBaseEnergyType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除能源类型信息
|
||||
*/
|
||||
|
||||
@Log(title = "能源类型信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||
{
|
||||
return toAjax(emsBaseEnergyTypeService.deleteEmsBaseEnergyTypeByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.hw.ems.base.controller;
|
||||
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.ems.base.domain.EmsBaseMonitorInfo;
|
||||
import com.hw.ems.base.domain.TreeSelects;
|
||||
import com.hw.ems.base.service.IEmsBaseMonitorInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计量设备信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/baseMonitorInfo")
|
||||
public class EmsBaseMonitorInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsBaseMonitorInfoService emsBaseMonitorInfoService;
|
||||
|
||||
/**
|
||||
* 查询计量设备信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
List<EmsBaseMonitorInfo> list = emsBaseMonitorInfoService.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计量设备信息下拉树结构
|
||||
* */
|
||||
@PostMapping("/monitorInfoTree")
|
||||
public AjaxResult getMonitorInfoTree(@RequestBody EmsBaseMonitorInfo baseMonitorInfo) {
|
||||
List<TreeSelects> list = emsBaseMonitorInfoService.selectBaseMonitorInfoTreeList(baseMonitorInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计量设备信息列表
|
||||
*/
|
||||
|
||||
@Log(title = "计量设备信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
List<EmsBaseMonitorInfo> list = emsBaseMonitorInfoService.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo);
|
||||
ExcelUtil<EmsBaseMonitorInfo> util = new ExcelUtil<EmsBaseMonitorInfo>(EmsBaseMonitorInfo.class);
|
||||
util.exportExcel(response, list, "计量设备信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计量设备信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||
{
|
||||
return success(emsBaseMonitorInfoService.selectEmsBaseMonitorInfoByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量设备信息
|
||||
*/
|
||||
@Log(title = "计量设备信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
// emsBaseMonitorInfo.setCreateBy(getUsername());
|
||||
return toAjax(emsBaseMonitorInfoService.insertEmsBaseMonitorInfo(emsBaseMonitorInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量设备信息
|
||||
*/
|
||||
@Log(title = "计量设备信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
// emsBaseMonitorInfo.setUpdateBy(getUsername());
|
||||
return toAjax(emsBaseMonitorInfoService.updateEmsBaseMonitorInfo(emsBaseMonitorInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计量设备信息
|
||||
*/
|
||||
@Log(title = "计量设备信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||
{
|
||||
return toAjax(emsBaseMonitorInfoService.deleteEmsBaseMonitorInfoByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.hw.ems.base.domain;
|
||||
|
||||
import com.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 能源类型信息对象 ems_base_energy_type
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
public class EmsBaseEnergyType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
/** 能源类型编号 */
|
||||
@Excel(name = "能源类型编号")
|
||||
private Long energyTypeId;
|
||||
|
||||
/** 能源类型名称 */
|
||||
@Excel(name = "能源类型名称")
|
||||
private String energyName;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String measureUnit;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
public void setEnergyTypeId(Long energyTypeId)
|
||||
{
|
||||
this.energyTypeId = energyTypeId;
|
||||
}
|
||||
|
||||
public Long getEnergyTypeId()
|
||||
{
|
||||
return energyTypeId;
|
||||
}
|
||||
public void setEnergyName(String energyName)
|
||||
{
|
||||
this.energyName = energyName;
|
||||
}
|
||||
|
||||
public String getEnergyName()
|
||||
{
|
||||
return energyName;
|
||||
}
|
||||
public void setMeasureUnit(String measureUnit)
|
||||
{
|
||||
this.measureUnit = measureUnit;
|
||||
}
|
||||
|
||||
public String getMeasureUnit()
|
||||
{
|
||||
return measureUnit;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("energyTypeId", getEnergyTypeId())
|
||||
.append("energyName", getEnergyName())
|
||||
.append("measureUnit", getMeasureUnit())
|
||||
.append("price", getPrice())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.hw.ems.base.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.hw.system.api.domain.SysDept;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Treeselect树结构实体类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TreeSelects implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点ID */
|
||||
private Long id;
|
||||
|
||||
/** 节点名称 */
|
||||
private String label;
|
||||
|
||||
private String code;
|
||||
|
||||
/** 子节点 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelects> children;
|
||||
|
||||
public TreeSelects()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TreeSelects(SysDept dept)
|
||||
{
|
||||
this.id = dept.getDeptId();
|
||||
this.label = dept.getDeptName();
|
||||
this.children = dept.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public TreeSelects(EmsBaseMonitorInfo baseMonitorInfo){
|
||||
// this.id = baseMonitorInfo.getObjId();
|
||||
this.label = baseMonitorInfo.getMonitorName();
|
||||
this.code = baseMonitorInfo.getMonitorCode();
|
||||
this.children = baseMonitorInfo.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// public TreeSelects(EmsBaseWorkUnit baseWorkUnit){
|
||||
// this.id = baseWorkUnit.getObjId();
|
||||
// this.label = baseWorkUnit.getWorkUnitName();
|
||||
// this.code = baseWorkUnit.getWorkUnitCode();
|
||||
// this.children = baseWorkUnit.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||
// }
|
||||
//
|
||||
// public TreeSelects(SysMenu menu)
|
||||
// {
|
||||
// this.id = menu.getMenuId();
|
||||
// this.label = menu.getMenuName();
|
||||
// this.children = menu.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public List<TreeSelects> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeSelects> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.ems.base.mapper;
|
||||
|
||||
import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采集设备信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-20
|
||||
*/
|
||||
public interface EmsBaseCollectDeviceInfoMapper {
|
||||
/**
|
||||
* 查询采集设备信息
|
||||
*
|
||||
* @param objId 采集设备信息主键
|
||||
* @return 采集设备信息
|
||||
*/
|
||||
public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询采集设备信息列表
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 采集设备信息集合
|
||||
*/
|
||||
public List<EmsBaseCollectDeviceInfo> selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo);
|
||||
|
||||
/**
|
||||
* 新增采集设备信息
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo);
|
||||
|
||||
/**
|
||||
* 修改采集设备信息
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo);
|
||||
|
||||
/**
|
||||
* 删除采集设备信息
|
||||
*
|
||||
* @param objId 采集设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除采集设备信息
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.hw.ems.base.mapper;
|
||||
|
||||
import com.hw.ems.base.domain.EmsBaseEnergyType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能源类型信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
public interface EmsBaseEnergyTypeMapper
|
||||
{
|
||||
/**
|
||||
* 查询能源类型信息
|
||||
*
|
||||
* @param objId 能源类型信息主键
|
||||
* @return 能源类型信息
|
||||
*/
|
||||
public EmsBaseEnergyType selectEmsBaseEnergyTypeByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询能源类型信息列表
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 能源类型信息集合
|
||||
*/
|
||||
public List<EmsBaseEnergyType> selectEmsBaseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType);
|
||||
|
||||
/**
|
||||
* 新增能源类型信息
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType);
|
||||
|
||||
/**
|
||||
* 修改能源类型信息
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType);
|
||||
|
||||
/**
|
||||
* 删除能源类型信息
|
||||
*
|
||||
* @param objId 能源类型信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseEnergyTypeByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除能源类型信息
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseEnergyTypeByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 根据能源类型id查询能源类型名称
|
||||
* @param energyTypeId
|
||||
* @return
|
||||
*/
|
||||
public String selectEmsBaseEnergyNameByEnergyTypeId(int energyTypeId);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.hw.ems.base.mapper;
|
||||
|
||||
|
||||
import com.hw.ems.base.domain.EmsBaseMonitorInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计量设备信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
public interface EmsBaseMonitorInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询计量设备信息
|
||||
*
|
||||
* @param objId 计量设备信息主键
|
||||
* @return 计量设备信息
|
||||
*/
|
||||
public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询计量设备信息列表
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 计量设备信息集合
|
||||
*/
|
||||
public List<EmsBaseMonitorInfo> selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 新增计量设备信息
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 修改计量设备信息
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 删除计量设备信息
|
||||
*
|
||||
* @param objId 计量设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseMonitorInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除计量设备信息
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 根据设备编码查询本设备的能源类型
|
||||
* @param monitorCode
|
||||
* @return
|
||||
*/
|
||||
public String selectEmsBaseMonitorTypeByMonitorCode(String monitorCode);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.hw.ems.base.service;
|
||||
|
||||
import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采集设备信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-20
|
||||
*/
|
||||
public interface IEmsBaseCollectDeviceInfoService {
|
||||
/**
|
||||
* 查询采集设备信息
|
||||
*
|
||||
* @param objId 采集设备信息主键
|
||||
* @return 采集设备信息
|
||||
*/
|
||||
public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询采集设备信息列表
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 采集设备信息集合
|
||||
*/
|
||||
public List<EmsBaseCollectDeviceInfo> selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo);
|
||||
|
||||
/**
|
||||
* 新增采集设备信息
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo);
|
||||
|
||||
/**
|
||||
* 修改采集设备信息
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo);
|
||||
|
||||
/**
|
||||
* 批量删除采集设备信息
|
||||
*
|
||||
* @param objIds 需要删除的采集设备信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除采集设备信息信息
|
||||
*
|
||||
* @param objId 采集设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.hw.ems.base.service;
|
||||
|
||||
import com.hw.ems.base.domain.EmsBaseEnergyType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能源类型信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
public interface IEmsBaseEnergyTypeService
|
||||
{
|
||||
/**
|
||||
* 查询能源类型信息
|
||||
*
|
||||
* @param objId 能源类型信息主键
|
||||
* @return 能源类型信息
|
||||
*/
|
||||
public EmsBaseEnergyType selectEmsBaseEnergyTypeByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询能源类型信息列表
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 能源类型信息集合
|
||||
*/
|
||||
public List<EmsBaseEnergyType> selectEmsBaseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType);
|
||||
|
||||
/**
|
||||
* 新增能源类型信息
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType);
|
||||
|
||||
/**
|
||||
* 修改能源类型信息
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType);
|
||||
|
||||
/**
|
||||
* 批量删除能源类型信息
|
||||
*
|
||||
* @param objIds 需要删除的能源类型信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseEnergyTypeByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除能源类型信息信息
|
||||
*
|
||||
* @param objId 能源类型信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseEnergyTypeByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 根据能源类型id查询能源类型名称
|
||||
* @param energyTypeId
|
||||
* @return
|
||||
*/
|
||||
String queryEnergyNameByEnergyTypeId(int energyTypeId);
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.hw.ems.base.service;
|
||||
|
||||
|
||||
|
||||
import com.hw.ems.base.domain.EmsBaseMonitorInfo;
|
||||
import com.hw.ems.base.domain.TreeSelects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计量设备信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
public interface IEmsBaseMonitorInfoService
|
||||
{
|
||||
/**
|
||||
* 查询计量设备信息
|
||||
*
|
||||
* @param objId 计量设备信息主键
|
||||
* @return 计量设备信息
|
||||
*/
|
||||
public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询计量设备信息列表
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 计量设备信息集合
|
||||
*/
|
||||
public List<EmsBaseMonitorInfo> selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 根据设备编号查询本设备能源类型
|
||||
* @param monitorCode
|
||||
* @return
|
||||
*/
|
||||
public String selectEmsBaseMonitorTypeByMonitorCode(String monitorCode);
|
||||
|
||||
/**
|
||||
* 新增计量设备信息
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 修改计量设备信息
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 批量删除计量设备信息
|
||||
*
|
||||
* @param objIds 需要删除的计量设备信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除计量设备信息信息
|
||||
*
|
||||
* @param objId 计量设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsBaseMonitorInfoByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询计量设备信息下拉树结构
|
||||
* */
|
||||
List<TreeSelects> selectBaseMonitorInfoTreeList(EmsBaseMonitorInfo baseMonitorInfo);
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
public List<TreeSelects> buildMonitorInfoTreeSelect(List<EmsBaseMonitorInfo> baseMonitorInfos);
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
* @param
|
||||
* @return 树结构列表
|
||||
*/
|
||||
public List<EmsBaseMonitorInfo> buildMonitorInfoTree(List<EmsBaseMonitorInfo> baseMonitorInfos);
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.hw.ems.base.service.impl;
|
||||
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import com.hw.ems.base.domain.EmsBaseCollectDeviceInfo;
|
||||
import com.hw.ems.base.mapper.EmsBaseCollectDeviceInfoMapper;
|
||||
import com.hw.ems.base.service.IEmsBaseCollectDeviceInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采集设备信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-20
|
||||
*/
|
||||
@Service
|
||||
public class EmsBaseCollectDeviceInfoServiceImpl implements IEmsBaseCollectDeviceInfoService {
|
||||
@Autowired
|
||||
private EmsBaseCollectDeviceInfoMapper emsBaseCollectDeviceInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询采集设备信息
|
||||
*
|
||||
* @param objId 采集设备信息主键
|
||||
* @return 采集设备信息
|
||||
*/
|
||||
@Override
|
||||
public EmsBaseCollectDeviceInfo selectEmsBaseCollectDeviceInfoByObjId(Long objId) {
|
||||
return emsBaseCollectDeviceInfoMapper.selectEmsBaseCollectDeviceInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采集设备信息列表
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 采集设备信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmsBaseCollectDeviceInfo> selectEmsBaseCollectDeviceInfoList(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
return emsBaseCollectDeviceInfoMapper.selectEmsBaseCollectDeviceInfoList(emsBaseCollectDeviceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采集设备信息
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
emsBaseCollectDeviceInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return emsBaseCollectDeviceInfoMapper.insertEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采集设备信息
|
||||
*
|
||||
* @param emsBaseCollectDeviceInfo 采集设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsBaseCollectDeviceInfo(EmsBaseCollectDeviceInfo emsBaseCollectDeviceInfo) {
|
||||
emsBaseCollectDeviceInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsBaseCollectDeviceInfoMapper.updateEmsBaseCollectDeviceInfo(emsBaseCollectDeviceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除采集设备信息
|
||||
*
|
||||
* @param objIds 需要删除的采集设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsBaseCollectDeviceInfoByObjIds(Long[] objIds) {
|
||||
return emsBaseCollectDeviceInfoMapper.deleteEmsBaseCollectDeviceInfoByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采集设备信息信息
|
||||
*
|
||||
* @param objId 采集设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsBaseCollectDeviceInfoByObjId(Long objId) {
|
||||
return emsBaseCollectDeviceInfoMapper.deleteEmsBaseCollectDeviceInfoByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.hw.ems.base.service.impl;
|
||||
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import com.hw.ems.base.domain.EmsBaseEnergyType;
|
||||
import com.hw.ems.base.mapper.EmsBaseEnergyTypeMapper;
|
||||
import com.hw.ems.base.service.IEmsBaseEnergyTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 能源类型信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
@Service
|
||||
public class EmsBaseEnergyTypeServiceImpl implements IEmsBaseEnergyTypeService
|
||||
{
|
||||
@Autowired
|
||||
private EmsBaseEnergyTypeMapper emsBaseEnergyTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询能源类型信息
|
||||
*
|
||||
* @param objId 能源类型信息主键
|
||||
* @return 能源类型信息
|
||||
*/
|
||||
@Override
|
||||
public EmsBaseEnergyType selectEmsBaseEnergyTypeByObjId(Long objId)
|
||||
{
|
||||
return emsBaseEnergyTypeMapper.selectEmsBaseEnergyTypeByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询能源类型信息列表
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 能源类型信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmsBaseEnergyType> selectEmsBaseEnergyTypeList(EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
return emsBaseEnergyTypeMapper.selectEmsBaseEnergyTypeList(emsBaseEnergyType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增能源类型信息
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
emsBaseEnergyType.setCreateTime(DateUtils.getNowDate());
|
||||
return emsBaseEnergyTypeMapper.insertEmsBaseEnergyType(emsBaseEnergyType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改能源类型信息
|
||||
*
|
||||
* @param emsBaseEnergyType 能源类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsBaseEnergyType(EmsBaseEnergyType emsBaseEnergyType)
|
||||
{
|
||||
emsBaseEnergyType.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsBaseEnergyTypeMapper.updateEmsBaseEnergyType(emsBaseEnergyType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除能源类型信息
|
||||
*
|
||||
* @param objIds 需要删除的能源类型信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsBaseEnergyTypeByObjIds(Long[] objIds)
|
||||
{
|
||||
return emsBaseEnergyTypeMapper.deleteEmsBaseEnergyTypeByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除能源类型信息信息
|
||||
*
|
||||
* @param objId 能源类型信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsBaseEnergyTypeByObjId(Long objId)
|
||||
{
|
||||
return emsBaseEnergyTypeMapper.deleteEmsBaseEnergyTypeByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据能源类型id查询能源类型名称
|
||||
* @param energyTypeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String queryEnergyNameByEnergyTypeId(int energyTypeId) {
|
||||
return emsBaseEnergyTypeMapper.selectEmsBaseEnergyNameByEnergyTypeId(energyTypeId);
|
||||
}
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
package com.hw.ems.base.service.impl;
|
||||
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import com.hw.ems.base.domain.EmsBaseMonitorInfo;
|
||||
import com.hw.ems.base.domain.TreeSelects;
|
||||
import com.hw.ems.base.mapper.EmsBaseMonitorInfoMapper;
|
||||
import com.hw.ems.base.service.IEmsBaseMonitorInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 计量设备信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-08
|
||||
*/
|
||||
@Service
|
||||
public class EmsBaseMonitorInfoServiceImpl implements IEmsBaseMonitorInfoService
|
||||
{
|
||||
@Autowired
|
||||
private EmsBaseMonitorInfoMapper emsBaseMonitorInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询计量设备信息
|
||||
*
|
||||
* @param objId 计量设备信息主键
|
||||
* @return 计量设备信息
|
||||
*/
|
||||
@Override
|
||||
public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId)
|
||||
{
|
||||
return emsBaseMonitorInfoMapper.selectEmsBaseMonitorInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计量设备信息列表
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 计量设备信息
|
||||
*/
|
||||
@Override
|
||||
public List<EmsBaseMonitorInfo> selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
return emsBaseMonitorInfoMapper.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编号查询本设备能源类型
|
||||
* @param monitorCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String selectEmsBaseMonitorTypeByMonitorCode(String monitorCode) {
|
||||
return emsBaseMonitorInfoMapper.selectEmsBaseMonitorTypeByMonitorCode(monitorCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量设备信息
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
emsBaseMonitorInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return emsBaseMonitorInfoMapper.insertEmsBaseMonitorInfo(emsBaseMonitorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量设备信息
|
||||
*
|
||||
* @param emsBaseMonitorInfo 计量设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||
{
|
||||
emsBaseMonitorInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsBaseMonitorInfoMapper.updateEmsBaseMonitorInfo(emsBaseMonitorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计量设备信息
|
||||
*
|
||||
* @param objIds 需要删除的计量设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds)
|
||||
{
|
||||
return emsBaseMonitorInfoMapper.deleteEmsBaseMonitorInfoByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计量设备信息信息
|
||||
*
|
||||
* @param objId 计量设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsBaseMonitorInfoByObjId(Long objId)
|
||||
{
|
||||
return emsBaseMonitorInfoMapper.deleteEmsBaseMonitorInfoByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计量设备信息下拉树结构
|
||||
* */
|
||||
@Override
|
||||
public List<TreeSelects> selectBaseMonitorInfoTreeList(EmsBaseMonitorInfo baseMonitorInfo) {
|
||||
List<EmsBaseMonitorInfo> baseMonitorInfos = selectEmsBaseMonitorInfoList(baseMonitorInfo);
|
||||
return buildMonitorInfoTreeSelect(baseMonitorInfos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<TreeSelects> buildMonitorInfoTreeSelect(List<EmsBaseMonitorInfo> baseMonitorInfos)
|
||||
{
|
||||
List<EmsBaseMonitorInfo> deptTrees = buildMonitorInfoTree(baseMonitorInfos);
|
||||
return deptTrees.stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
* @param
|
||||
* @return 树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<EmsBaseMonitorInfo> buildMonitorInfoTree(List<EmsBaseMonitorInfo> baseMonitorInfos)
|
||||
{
|
||||
List<EmsBaseMonitorInfo> returnList = new ArrayList<EmsBaseMonitorInfo>();
|
||||
List<Long> tempList = baseMonitorInfos.stream().map(EmsBaseMonitorInfo::getObjId).collect(Collectors.toList());
|
||||
for (EmsBaseMonitorInfo baseMonitorInfo : baseMonitorInfos)
|
||||
{
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(baseMonitorInfo.getParentId()))
|
||||
{
|
||||
recursionFn(baseMonitorInfos, baseMonitorInfo);
|
||||
returnList.add(baseMonitorInfo);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
returnList = baseMonitorInfos;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
private void recursionFn(List<EmsBaseMonitorInfo> list, EmsBaseMonitorInfo t)
|
||||
{
|
||||
// 得到子节点列表
|
||||
List<EmsBaseMonitorInfo> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (EmsBaseMonitorInfo tChild : childList)
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<EmsBaseMonitorInfo> getChildList(List<EmsBaseMonitorInfo> list, EmsBaseMonitorInfo t)
|
||||
{
|
||||
List<EmsBaseMonitorInfo> tlist = new ArrayList<EmsBaseMonitorInfo>();
|
||||
Iterator<EmsBaseMonitorInfo> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
EmsBaseMonitorInfo n = (EmsBaseMonitorInfo) it.next();
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getObjId().longValue())
|
||||
{
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<EmsBaseMonitorInfo> list, EmsBaseMonitorInfo t)
|
||||
{
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
package com.hw.ems.record.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.ems.base.service.IEmsBaseEnergyTypeService;
|
||||
import com.hw.ems.base.service.IEmsBaseMonitorInfoService;
|
||||
import com.hw.ems.record.domain.EmsIOTData;
|
||||
import com.hw.ems.record.domain.TWTempertureData;
|
||||
import com.hw.ems.record.service.ITWTempertureDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 物联网实时数据Controller
|
||||
*
|
||||
* @author Caoql
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/record/recordIOTInstant")
|
||||
public class TWTempertureDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITWTempertureDataService tWTempertureDataService;
|
||||
@Autowired
|
||||
private IEmsBaseMonitorInfoService emsBaseMonitorInfoService;
|
||||
@Autowired
|
||||
private IEmsBaseEnergyTypeService emsBaseEnergyTypeService;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
/**
|
||||
* 查询物联网实时数据列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TWTempertureData tWTempertureData)
|
||||
{
|
||||
startPage();
|
||||
List<TWTempertureData> list = tWTempertureDataService.selectTWTempertureDataList(tWTempertureData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物联网设备实时数据
|
||||
* @param tWTempertureData
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/iotInstantList")
|
||||
public AjaxResult iotInstantList(TWTempertureData tWTempertureData){
|
||||
EmsIOTData emsIOTData = new EmsIOTData();
|
||||
int energyTypeid = Integer.parseInt(emsBaseMonitorInfoService.selectEmsBaseMonitorTypeByMonitorCode(tWTempertureData.getMonitorId()));
|
||||
String energyName = emsBaseEnergyTypeService.queryEnergyNameByEnergyTypeId(energyTypeid);
|
||||
if("温湿度".equals(energyName)){
|
||||
emsIOTData.monitorTypeArr.add("温度");
|
||||
emsIOTData.monitorTypeArr.add("湿度");
|
||||
}
|
||||
else{
|
||||
emsIOTData.monitorTypeArr.add(energyName);
|
||||
}
|
||||
emsIOTData.setType("line");
|
||||
emsIOTData.setSmooth(true);
|
||||
emsIOTData.setShowAllSymbol(true);
|
||||
emsIOTData.setSymbol("circle");
|
||||
emsIOTData.setSymbolSize(2);
|
||||
List<TWTempertureData> list = tWTempertureDataService.selectIotInstantList(tWTempertureData);
|
||||
emsIOTData.setDataList(list);
|
||||
return success(emsIOTData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物联网设备实时监控数据
|
||||
* @param monitorCodeList
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/iotInstantMonitoring")
|
||||
public AjaxResult iotInstantMonitoring(String monitorCodeList){
|
||||
List<TWTempertureData> list = new ArrayList<TWTempertureData>();
|
||||
if(StringUtils.isNotEmpty(monitorCodeList)){
|
||||
String[] split = monitorCodeList.split(",");
|
||||
for (String monitorId : split) {
|
||||
|
||||
TWTempertureData tWTempertureData = new TWTempertureData();
|
||||
tWTempertureData.setMonitorId(monitorId);
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MINUTE,-5);
|
||||
Calendar startTime = (Calendar) calendar.clone();
|
||||
params.put("beginRecordTime",sdf.format(startTime.getTime()));
|
||||
params.put("endRecordTime",sdf.format(new Date()));
|
||||
tWTempertureData.setParams(params);
|
||||
|
||||
List<TWTempertureData> twTempertureData = tWTempertureDataService.selectIotInstantList(tWTempertureData);
|
||||
if(twTempertureData.size()>0){
|
||||
Optional<TWTempertureData> first = twTempertureData.stream().sorted(Comparator.comparing(TWTempertureData::getRecodeTime)).findFirst();
|
||||
|
||||
list.add(first.get());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(JSONArray.toJSONString(list));
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物联网实时数据列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:export')")
|
||||
@Log(title = "物联网实时数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TWTempertureData tWTempertureData)
|
||||
{
|
||||
List<TWTempertureData> list = tWTempertureDataService.selectTWTempertureDataList(tWTempertureData);
|
||||
ExcelUtil<TWTempertureData> util = new ExcelUtil<TWTempertureData>(TWTempertureData.class);
|
||||
util.exportExcel(response, list, "物联网实时数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物联网实时数据详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:query')")
|
||||
@GetMapping(value = "/{objid}")
|
||||
public AjaxResult getInfo(@PathVariable("objid") Long objid)
|
||||
{
|
||||
return success(tWTempertureDataService.selectTWTempertureDataByObjid(objid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物联网实时数据
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:add')")
|
||||
@Log(title = "物联网实时数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TWTempertureData tWTempertureData)
|
||||
{
|
||||
// tWTempertureData.setCreateBy(getUsername());
|
||||
return toAjax(tWTempertureDataService.insertTWTempertureData(tWTempertureData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物联网实时数据
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:edit')")
|
||||
@Log(title = "物联网实时数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TWTempertureData tWTempertureData)
|
||||
{
|
||||
// tWTempertureData.setUpdateBy(getUsername());
|
||||
return toAjax(tWTempertureDataService.updateTWTempertureData(tWTempertureData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物联网实时数据
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:remove')")
|
||||
@Log(title = "物联网实时数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objids}")
|
||||
public AjaxResult remove(@PathVariable Long[] objids)
|
||||
{
|
||||
return toAjax(tWTempertureDataService.deleteTWTempertureDataByObjids(objids));
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.hw.ems.record.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EmsIOTData {
|
||||
|
||||
/**
|
||||
* 能源类型
|
||||
*/
|
||||
public ArrayList<String> monitorTypeArr;
|
||||
private String name;
|
||||
private String type;
|
||||
private boolean smooth;
|
||||
private boolean showAllSymbol;
|
||||
private String symbol;
|
||||
private int symbolSize;
|
||||
private String symbolType;
|
||||
private List<TWTempertureData> dataList;
|
||||
|
||||
public EmsIOTData() {
|
||||
this.monitorTypeArr = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ArrayList<String> getMonitorTypeArr() {
|
||||
return monitorTypeArr;
|
||||
}
|
||||
|
||||
public void setMonitorTypeArr(ArrayList<String> monitorTypeArr) {
|
||||
this.monitorTypeArr = monitorTypeArr;
|
||||
}
|
||||
|
||||
public List<TWTempertureData> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setDataList(List<TWTempertureData> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isSmooth() {
|
||||
return smooth;
|
||||
}
|
||||
|
||||
public void setSmooth(boolean smooth) {
|
||||
this.smooth = smooth;
|
||||
}
|
||||
|
||||
public boolean isShowAllSymbol() {
|
||||
return showAllSymbol;
|
||||
}
|
||||
|
||||
public void setShowAllSymbol(boolean showAllSymbol) {
|
||||
this.showAllSymbol = showAllSymbol;
|
||||
}
|
||||
|
||||
public String getSymbol() {
|
||||
return symbol;
|
||||
}
|
||||
|
||||
public void setSymbol(String symbol) {
|
||||
this.symbol = symbol;
|
||||
}
|
||||
|
||||
public int getSymbolSize() {
|
||||
return symbolSize;
|
||||
}
|
||||
|
||||
public void setSymbolSize(int symbolSize) {
|
||||
this.symbolSize = symbolSize;
|
||||
}
|
||||
|
||||
public String getSymbolType() {
|
||||
return symbolType;
|
||||
}
|
||||
|
||||
public void setSymbolType(String symbolType) {
|
||||
this.symbolType = symbolType;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,230 @@
|
||||
package com.hw.ems.record.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物联网实时数据对象 T_W_TempertureData
|
||||
*
|
||||
* @author Caoql
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
public class TWTempertureData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private Long objid;
|
||||
|
||||
/** 计量设备编号 */
|
||||
@Excel(name = "计量设备编号")
|
||||
private String monitorId;
|
||||
|
||||
/**计量设备名称**/
|
||||
@Excel(name = "计量设备名称")
|
||||
private String monitorName;
|
||||
|
||||
/** 采集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date collectTime;
|
||||
|
||||
/** 温度 */
|
||||
@Excel(name = "温度")
|
||||
private BigDecimal tempreture;
|
||||
|
||||
/** 湿度 */
|
||||
@Excel(name = "湿度")
|
||||
private BigDecimal humidity;
|
||||
|
||||
/** 照度 */
|
||||
@Excel(name = "照度")
|
||||
private BigDecimal illuminance;
|
||||
|
||||
/** 噪声 */
|
||||
@Excel(name = "噪声")
|
||||
private BigDecimal noise;
|
||||
|
||||
/** 硫化氢浓度 */
|
||||
@Excel(name = "硫化氢浓度")
|
||||
private BigDecimal concentration;
|
||||
|
||||
/** 记录时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date recodeTime;
|
||||
private BigDecimal pm1;
|
||||
private BigDecimal pm2;
|
||||
private BigDecimal pm10;
|
||||
private BigDecimal standby;
|
||||
|
||||
/** 报警类型 */
|
||||
@Excel(name = "报警类型")
|
||||
private Long alarmType;
|
||||
|
||||
/** */
|
||||
@Excel(name = " ")
|
||||
private Long confirmPersonID;
|
||||
|
||||
/** */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = " ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date confirmTime;
|
||||
|
||||
/** */
|
||||
@Excel(name = " ")
|
||||
private Long confirmFlag;
|
||||
|
||||
public void setObjid(Long objid)
|
||||
{
|
||||
this.objid = objid;
|
||||
}
|
||||
|
||||
public Long getObjid()
|
||||
{
|
||||
return objid;
|
||||
}
|
||||
public void setMonitorId(String monitorId)
|
||||
{
|
||||
this.monitorId = monitorId;
|
||||
}
|
||||
|
||||
public String getMonitorId()
|
||||
{
|
||||
return monitorId;
|
||||
}
|
||||
public void setCollectTime(Date collectTime)
|
||||
{
|
||||
this.collectTime = collectTime;
|
||||
}
|
||||
|
||||
public Date getCollectTime()
|
||||
{
|
||||
return collectTime;
|
||||
}
|
||||
public void setTempreture(BigDecimal tempreture)
|
||||
{
|
||||
this.tempreture = tempreture;
|
||||
}
|
||||
|
||||
public BigDecimal getTempreture()
|
||||
{
|
||||
return tempreture;
|
||||
}
|
||||
public void setHumidity(BigDecimal humidity)
|
||||
{
|
||||
this.humidity = humidity;
|
||||
}
|
||||
|
||||
public BigDecimal getHumidity()
|
||||
{
|
||||
return humidity;
|
||||
}
|
||||
public void setIlluminance(BigDecimal illuminance)
|
||||
{
|
||||
this.illuminance = illuminance;
|
||||
}
|
||||
|
||||
public String getMonitorName() {
|
||||
return monitorName;
|
||||
}
|
||||
|
||||
public void setMonitorName(String monitorName) {
|
||||
this.monitorName = monitorName;
|
||||
}
|
||||
|
||||
public BigDecimal getIlluminance()
|
||||
{
|
||||
return illuminance;
|
||||
}
|
||||
public void setNoise(BigDecimal noise)
|
||||
{
|
||||
this.noise = noise;
|
||||
}
|
||||
|
||||
public BigDecimal getNoise()
|
||||
{
|
||||
return noise;
|
||||
}
|
||||
public void setConcentration(BigDecimal concentration)
|
||||
{
|
||||
this.concentration = concentration;
|
||||
}
|
||||
|
||||
public BigDecimal getConcentration()
|
||||
{
|
||||
return concentration;
|
||||
}
|
||||
public void setRecodeTime(Date recodeTime)
|
||||
{
|
||||
this.recodeTime = recodeTime;
|
||||
}
|
||||
|
||||
public Date getRecodeTime()
|
||||
{
|
||||
return recodeTime;
|
||||
}
|
||||
public void setAlarmType(Long alarmType)
|
||||
{
|
||||
this.alarmType = alarmType;
|
||||
}
|
||||
|
||||
public Long getAlarmType()
|
||||
{
|
||||
return alarmType;
|
||||
}
|
||||
public void setConfirmPersonID(Long confirmPersonID)
|
||||
{
|
||||
this.confirmPersonID = confirmPersonID;
|
||||
}
|
||||
|
||||
public Long getConfirmPersonID()
|
||||
{
|
||||
return confirmPersonID;
|
||||
}
|
||||
public void setConfirmTime(Date confirmTime)
|
||||
{
|
||||
this.confirmTime = confirmTime;
|
||||
}
|
||||
|
||||
public Date getConfirmTime()
|
||||
{
|
||||
return confirmTime;
|
||||
}
|
||||
public void setConfirmFlag(Long confirmFlag)
|
||||
{
|
||||
this.confirmFlag = confirmFlag;
|
||||
}
|
||||
|
||||
public Long getConfirmFlag()
|
||||
{
|
||||
return confirmFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objid", getObjid())
|
||||
.append("monitorId", getMonitorId())
|
||||
.append("collectTime", getCollectTime())
|
||||
.append("tempreture", getTempreture())
|
||||
.append("humidity", getHumidity())
|
||||
.append("illuminance", getIlluminance())
|
||||
.append("noise", getNoise())
|
||||
.append("concentration", getConcentration())
|
||||
.append("recodeTime", getRecodeTime())
|
||||
.append("alarmType", getAlarmType())
|
||||
.append("confirmPersonID", getConfirmPersonID())
|
||||
.append("confirmTime", getConfirmTime())
|
||||
.append("confirmFlag", getConfirmFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.hw.ems.record.mapper;
|
||||
|
||||
|
||||
|
||||
import com.hw.ems.record.domain.TWTempertureData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物联网实时数据Mapper接口
|
||||
*
|
||||
* @author Caoql
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface TWTempertureDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询物联网实时数据
|
||||
*
|
||||
* @param objid 物联网实时数据主键
|
||||
* @return 物联网实时数据
|
||||
*/
|
||||
public TWTempertureData selectTWTempertureDataByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询物联网实时数据列表
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 物联网实时数据集合
|
||||
*/
|
||||
public List<TWTempertureData> selectTWTempertureDataList(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 新增物联网实时数据
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTWTempertureData(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 修改物联网实时数据
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTWTempertureData(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 删除物联网实时数据
|
||||
*
|
||||
* @param objid 物联网实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTWTempertureDataByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 批量删除物联网实时数据
|
||||
*
|
||||
* @param objids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTWTempertureDataByObjids(Long[] objids);
|
||||
|
||||
/**
|
||||
* 查询物联网实时数据
|
||||
* @param tWTempertureData
|
||||
* @return
|
||||
*/
|
||||
List<TWTempertureData> selectIotInstantList(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 根据设备编号查询实时物联网设备监控数据
|
||||
* @param monitorId
|
||||
* @return
|
||||
*/
|
||||
TWTempertureData selectIotInstantMinitoringData(String monitorId);
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.hw.ems.record.service;
|
||||
|
||||
|
||||
import com.hw.ems.record.domain.TWTempertureData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物联网实时数据Service接口
|
||||
*
|
||||
* @author Caoql
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface ITWTempertureDataService
|
||||
{
|
||||
/**
|
||||
* 查询物联网实时数据
|
||||
*
|
||||
* @param objid 物联网实时数据主键
|
||||
* @return 物联网实时数据
|
||||
*/
|
||||
public TWTempertureData selectTWTempertureDataByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询物联网实时数据列表
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 物联网实时数据集合
|
||||
*/
|
||||
public List<TWTempertureData> selectTWTempertureDataList(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 新增物联网实时数据
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertTWTempertureData(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 修改物联网实时数据
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateTWTempertureData(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 批量删除物联网实时数据
|
||||
*
|
||||
* @param objids 需要删除的物联网实时数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTWTempertureDataByObjids(Long[] objids);
|
||||
|
||||
/**
|
||||
* 删除物联网实时数据信息
|
||||
*
|
||||
* @param objid 物联网实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteTWTempertureDataByObjid(Long objid);
|
||||
|
||||
/**
|
||||
* 查询实时物联网数据
|
||||
* @param tWTempertureData
|
||||
* @return
|
||||
*/
|
||||
List<TWTempertureData> selectIotInstantList(TWTempertureData tWTempertureData);
|
||||
|
||||
/**
|
||||
* 根据设备编号查询实时物联网设备监控数据
|
||||
* @param monitorId
|
||||
* @return
|
||||
*/
|
||||
TWTempertureData selectIotInstantMinitoringData(String monitorId);
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.hw.ems.record.service.impl;
|
||||
|
||||
import com.hw.ems.record.domain.TWTempertureData;
|
||||
import com.hw.ems.record.mapper.TWTempertureDataMapper;
|
||||
import com.hw.ems.record.service.ITWTempertureDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物联网实时数据Service业务层处理
|
||||
*
|
||||
* @author Caoql
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class TWTempertureDataServiceImpl implements ITWTempertureDataService
|
||||
{
|
||||
@Autowired
|
||||
private TWTempertureDataMapper tWTempertureDataMapper;
|
||||
|
||||
/**
|
||||
* 查询物联网实时数据
|
||||
*
|
||||
* @param objid 物联网实时数据主键
|
||||
* @return 物联网实时数据
|
||||
*/
|
||||
@Override
|
||||
public TWTempertureData selectTWTempertureDataByObjid(Long objid)
|
||||
{
|
||||
return tWTempertureDataMapper.selectTWTempertureDataByObjid(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物联网实时数据列表
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 物联网实时数据
|
||||
*/
|
||||
@Override
|
||||
public List<TWTempertureData> selectTWTempertureDataList(TWTempertureData tWTempertureData)
|
||||
{
|
||||
return tWTempertureDataMapper.selectTWTempertureDataList(tWTempertureData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物联网实时数据
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTWTempertureData(TWTempertureData tWTempertureData)
|
||||
{
|
||||
return tWTempertureDataMapper.insertTWTempertureData(tWTempertureData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物联网实时数据
|
||||
*
|
||||
* @param tWTempertureData 物联网实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTWTempertureData(TWTempertureData tWTempertureData)
|
||||
{
|
||||
return tWTempertureDataMapper.updateTWTempertureData(tWTempertureData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物联网实时数据
|
||||
*
|
||||
* @param objids 需要删除的物联网实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTWTempertureDataByObjids(Long[] objids)
|
||||
{
|
||||
return tWTempertureDataMapper.deleteTWTempertureDataByObjids(objids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物联网实时数据信息
|
||||
*
|
||||
* @param objid 物联网实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTWTempertureDataByObjid(Long objid)
|
||||
{
|
||||
return tWTempertureDataMapper.deleteTWTempertureDataByObjid(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询实时物联网数据
|
||||
* @param tWTempertureData
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TWTempertureData> selectIotInstantList(TWTempertureData tWTempertureData) {
|
||||
return tWTempertureDataMapper.selectIotInstantList(tWTempertureData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编号查询实时物联网设备监控数据
|
||||
* @param monitorId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TWTempertureData selectIotInstantMinitoringData(String monitorId) {
|
||||
return tWTempertureDataMapper.selectIotInstantMinitoringData(monitorId);
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hw.ems.base.mapper.EmsBaseCollectDeviceInfoMapper">
|
||||
|
||||
<resultMap type="EmsBaseCollectDeviceInfo" id="EmsBaseCollectDeviceInfoResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="collectDeviceId" column="collect_device_id"/>
|
||||
<result property="collectDeviceName" column="collect_device_name"/>
|
||||
<result property="energyTypeId" column="energy_type_id"/>
|
||||
<result property="energyTypeName" column="energy_name"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="manufacturer" column="manufacturer"/>
|
||||
<result property="ipAddress" column="ip_address"/>
|
||||
<result property="produceDate" column="produce_date"/>
|
||||
<result property="settingAddress" column="setting_address"/>
|
||||
<result property="isFlag" column="is_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsBaseCollectDeviceInfoVo">
|
||||
select ebcdi.collect_device_id,
|
||||
ebcdi.collect_device_name,
|
||||
ebcdi.energy_type_id,
|
||||
ebet.energy_name,
|
||||
ebcdi.model,
|
||||
ebcdi.manufacturer,
|
||||
ebcdi.ip_address,
|
||||
ebcdi.produce_date,
|
||||
ebcdi.setting_address,
|
||||
ebcdi.is_flag,
|
||||
ebcdi.create_by,
|
||||
ebcdi.create_time,
|
||||
ebcdi.update_by,
|
||||
ebcdi.update_time,
|
||||
ebcdi.remark
|
||||
from ems_base_collect_device_info ebcdi
|
||||
left join ems_base_energy_type ebet on ebcdi.energy_type_id = ebet.energy_type_id
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsBaseCollectDeviceInfoList" parameterType="EmsBaseCollectDeviceInfo"
|
||||
resultMap="EmsBaseCollectDeviceInfoResult">
|
||||
<include refid="selectEmsBaseCollectDeviceInfoVo"/>
|
||||
<where>
|
||||
<if test="collectDeviceId != null and collectDeviceId != ''">and ebcdi.collect_device_id = #{collectDeviceId}
|
||||
</if>
|
||||
<if test="collectDeviceName != null and collectDeviceName != ''">and ebcdi.collect_device_name like concat('%',
|
||||
#{collectDeviceName}, '%')
|
||||
</if>
|
||||
<if test="energyTypeId != null ">and ebcdi.energy_type_id = #{energyTypeId}</if>
|
||||
<if test="model != null and model != ''">and ebcdi.model = #{model}</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">and ebcdi.manufacturer = #{manufacturer}</if>
|
||||
<if test="ipAddress != null and ipAddress != ''">and ebcdi.ip_address = #{ipAddress}</if>
|
||||
<if test="produceDate != null ">and ebcdi.produce_date = #{produceDate}</if>
|
||||
<if test="settingAddress != null and settingAddress != ''">and ebcdi.setting_address = #{settingAddress}</if>
|
||||
<if test="isFlag != null and isFlag != ''">and ebcdi.is_flag = #{isFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsBaseCollectDeviceInfoByObjId" parameterType="Long" resultMap="EmsBaseCollectDeviceInfoResult">
|
||||
<include refid="selectEmsBaseCollectDeviceInfoVo"/>
|
||||
where ebcdi.obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsBaseCollectDeviceInfo" parameterType="EmsBaseCollectDeviceInfo" useGeneratedKeys="true"
|
||||
keyProperty="objId">
|
||||
insert into ems_base_collect_device_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="collectDeviceId != null">collect_device_id,</if>
|
||||
<if test="collectDeviceName != null">collect_device_name,</if>
|
||||
<if test="energyTypeId != null">energy_type_id,</if>
|
||||
<if test="model != null">model,</if>
|
||||
<if test="manufacturer != null">manufacturer,</if>
|
||||
<if test="ipAddress != null">ip_address,</if>
|
||||
<if test="produceDate != null">produce_date,</if>
|
||||
<if test="settingAddress != null">setting_address,</if>
|
||||
<if test="isFlag != null">is_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="collectDeviceId != null">#{collectDeviceId},</if>
|
||||
<if test="collectDeviceName != null">#{collectDeviceName},</if>
|
||||
<if test="energyTypeId != null">#{energyTypeId},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
<if test="manufacturer != null">#{manufacturer},</if>
|
||||
<if test="ipAddress != null">#{ipAddress},</if>
|
||||
<if test="produceDate != null">#{produceDate},</if>
|
||||
<if test="settingAddress != null">#{settingAddress},</if>
|
||||
<if test="isFlag != null">#{isFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsBaseCollectDeviceInfo" parameterType="EmsBaseCollectDeviceInfo">
|
||||
update ems_base_collect_device_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="collectDeviceId != null">collect_device_id = #{collectDeviceId},</if>
|
||||
<if test="collectDeviceName != null">collect_device_name = #{collectDeviceName},</if>
|
||||
<if test="energyTypeId != null">energy_type_id = #{energyTypeId},</if>
|
||||
<if test="model != null">model = #{model},</if>
|
||||
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
||||
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||
<if test="produceDate != null">produce_date = #{produceDate},</if>
|
||||
<if test="settingAddress != null">setting_address = #{settingAddress},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsBaseCollectDeviceInfoByObjId" parameterType="Long">
|
||||
delete
|
||||
from ems_base_collect_device_info
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsBaseCollectDeviceInfoByObjIds" parameterType="String">
|
||||
delete from ems_base_collect_device_info where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hw.ems.base.mapper.EmsBaseEnergyTypeMapper">
|
||||
|
||||
<resultMap type="EmsBaseEnergyType" id="EmsBaseEnergyTypeResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="energyTypeId" column="energy_type_id"/>
|
||||
<result property="energyName" column="energy_name"/>
|
||||
<result property="measureUnit" column="measure_unit"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsBaseEnergyTypeVo">
|
||||
select energy_type_id,
|
||||
energy_name,
|
||||
measure_unit,
|
||||
price,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from ems_base_energy_type
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsBaseEnergyTypeList" parameterType="EmsBaseEnergyType" resultMap="EmsBaseEnergyTypeResult">
|
||||
<include refid="selectEmsBaseEnergyTypeVo"/>
|
||||
<where>
|
||||
<if test="energyTypeId != null ">and energy_type_id = #{energyTypeId}</if>
|
||||
<if test="energyName != null and energyName != ''">and energy_name like concat('%', #{energyName}, '%')
|
||||
</if>
|
||||
<if test="measureUnit != null and measureUnit != ''">and measure_unit = #{measureUnit}</if>
|
||||
<if test="price != null ">and price = #{price}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsBaseEnergyTypeByObjId" parameterType="Long" resultMap="EmsBaseEnergyTypeResult">
|
||||
<include refid="selectEmsBaseEnergyTypeVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmsBaseEnergyNameByEnergyTypeId">
|
||||
select energy_name
|
||||
from ems_base_energy_type
|
||||
where energy_type_id = #{energyTypeId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsBaseEnergyType" parameterType="EmsBaseEnergyType" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into ems_base_energy_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="energyTypeId != null">energy_type_id,</if>
|
||||
<if test="energyName != null">energy_name,</if>
|
||||
<if test="measureUnit != null">measure_unit,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="energyTypeId != null">#{energyTypeId},</if>
|
||||
<if test="energyName != null">#{energyName},</if>
|
||||
<if test="measureUnit != null">#{measureUnit},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsBaseEnergyType" parameterType="EmsBaseEnergyType">
|
||||
update ems_base_energy_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="energyTypeId != null">energy_type_id = #{energyTypeId},</if>
|
||||
<if test="energyName != null">energy_name = #{energyName},</if>
|
||||
<if test="measureUnit != null">measure_unit = #{measureUnit},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsBaseEnergyTypeByObjId" parameterType="Long">
|
||||
delete
|
||||
from ems_base_energy_type
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsBaseEnergyTypeByObjIds" parameterType="String">
|
||||
delete from ems_base_energy_type where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hw.ems.base.mapper.EmsBaseMonitorInfoMapper">
|
||||
|
||||
<resultMap type="EmsBaseMonitorInfo" id="EmsBaseMonitorInfoResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="monitorCode" column="monitor_code" />
|
||||
<result property="monitorName" column="monitor_name" />
|
||||
<result property="monitorAddr" column="monitor_addr" />
|
||||
<result property="monitorType" column="monitor_type" />
|
||||
<result property="monitorStatus" column="monitor_status" />
|
||||
<result property="collectDeviceId" column="collect_device_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="grade" column="grade" />
|
||||
<result property="meterTypeId" column="meter_type_id" />
|
||||
<result property="correctValue" column="correct_value" />
|
||||
<result property="pt" column="pt" />
|
||||
<result property="ct" column="ct" />
|
||||
<result property="isAmmeter" column="is_ammeter" />
|
||||
<result property="isKeyMonitor" column="is_key_monitor" />
|
||||
<result property="isCircuit" column="is_circuit" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="publicShareType" column="public_share_type" />
|
||||
<result property="monitorHierarchy" column="monitor_hierarchy" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsBaseMonitorInfoVo">
|
||||
select obj_id, parent_id, monitor_code, monitor_name, monitor_addr, monitor_type, monitor_status, collect_device_id, ancestors, grade, meter_type_id, correct_value, pt, ct, is_ammeter, is_key_monitor, is_circuit, create_by, create_time, update_by, update_time, public_share_type, monitor_hierarchy from ems_base_monitor_info
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsBaseMonitorInfoList" parameterType="EmsBaseMonitorInfo" resultMap="EmsBaseMonitorInfoResult">
|
||||
<include refid="selectEmsBaseMonitorInfoVo"/>
|
||||
<where>
|
||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||
<if test="monitorCode != null and monitorCode != ''"> and monitor_code = #{monitorCode}</if>
|
||||
<if test="monitorName != null and monitorName != ''"> and monitor_name like concat('%', #{monitorName}, '%')</if>
|
||||
<if test="monitorTypeList != null and monitorTypeList.size > 0">
|
||||
and monitor_type IN
|
||||
<foreach item="monitorId" collection="monitorTypeList" open="(" separator="," close=")">
|
||||
#{monitorId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="monitorAddr != null and monitorAddr != ''"> and monitor_addr = #{monitorAddr}</if>
|
||||
<if test="monitorType != null "> and monitor_type = #{monitorType}</if>
|
||||
<if test="monitorStatus != null "> and monitor_status = #{monitorStatus}</if>
|
||||
<if test="collectDeviceId != null and collectDeviceId != ''"> and collect_device_id = #{collectDeviceId}</if>
|
||||
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||
<if test="grade != null "> and grade = #{grade}</if>
|
||||
<if test="meterTypeId != null and meterTypeId != ''"> and meter_type_id = #{meterTypeId}</if>
|
||||
<if test="correctValue != null "> and correct_value = #{correctValue}</if>
|
||||
<if test="pt != null "> and pt = #{pt}</if>
|
||||
<if test="ct != null "> and ct = #{ct}</if>
|
||||
<if test="isAmmeter != null and isAmmeter != ''"> and is_ammeter = #{isAmmeter}</if>
|
||||
<if test="isKeyMonitor != null "> and is_key_monitor = #{isKeyMonitor}</if>
|
||||
<if test="isCircuit != null "> and is_circuit = #{isCircuit}</if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
||||
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
|
||||
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
||||
<if test="publicShareType != null "> and public_share_type = #{publicShareType}</if>
|
||||
<if test="monitorHierarchy != null "> and monitor_hierarchy = #{monitorHierarchy}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsBaseMonitorInfoByObjId" parameterType="Long" resultMap="EmsBaseMonitorInfoResult">
|
||||
<include refid="selectEmsBaseMonitorInfoVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmsBaseMonitorTypeByMonitorCode" parameterType="String">
|
||||
select monitor_type
|
||||
from ems_base_monitor_info
|
||||
where monitor_code = #{monitorType}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertEmsBaseMonitorInfo" parameterType="EmsBaseMonitorInfo" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into ems_base_monitor_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="monitorCode != null and monitorCode != ''">monitor_code,</if>
|
||||
<if test="monitorName != null">monitor_name,</if>
|
||||
<if test="monitorAddr != null">monitor_addr,</if>
|
||||
<if test="monitorType != null">monitor_type,</if>
|
||||
<if test="monitorStatus != null">monitor_status,</if>
|
||||
<if test="collectDeviceId != null">collect_device_id,</if>
|
||||
<if test="ancestors != null">ancestors,</if>
|
||||
<if test="grade != null">grade,</if>
|
||||
<if test="meterTypeId != null">meter_type_id,</if>
|
||||
<if test="correctValue != null">correct_value,</if>
|
||||
<if test="pt != null">pt,</if>
|
||||
<if test="ct != null">ct,</if>
|
||||
<if test="isAmmeter != null">is_ammeter,</if>
|
||||
<if test="isKeyMonitor != null">is_key_monitor,</if>
|
||||
<if test="isCircuit != null">is_circuit,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="publicShareType != null">public_share_type,</if>
|
||||
<if test="monitorHierarchy != null">monitor_hierarchy,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="monitorCode != null and monitorCode != ''">#{monitorCode},</if>
|
||||
<if test="monitorName != null">#{monitorName},</if>
|
||||
<if test="monitorAddr != null">#{monitorAddr},</if>
|
||||
<if test="monitorType != null">#{monitorType},</if>
|
||||
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||
<if test="collectDeviceId != null">#{collectDeviceId},</if>
|
||||
<if test="ancestors != null">#{ancestors},</if>
|
||||
<if test="grade != null">#{grade},</if>
|
||||
<if test="meterTypeId != null">#{meterTypeId},</if>
|
||||
<if test="correctValue != null">#{correctValue},</if>
|
||||
<if test="pt != null">#{pt},</if>
|
||||
<if test="ct != null">#{ct},</if>
|
||||
<if test="isAmmeter != null">#{isAmmeter},</if>
|
||||
<if test="isKeyMonitor != null">#{isKeyMonitor},</if>
|
||||
<if test="isCircuit != null">#{isCircuit},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="publicShareType != null">#{publicShareType},</if>
|
||||
<if test="monitorHierarchy != null">#{monitorHierarchy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsBaseMonitorInfo" parameterType="EmsBaseMonitorInfo">
|
||||
update ems_base_monitor_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="monitorCode != null and monitorCode != ''">monitor_code = #{monitorCode},</if>
|
||||
<if test="monitorName != null">monitor_name = #{monitorName},</if>
|
||||
<if test="monitorAddr != null">monitor_addr = #{monitorAddr},</if>
|
||||
<if test="monitorType != null">monitor_type = #{monitorType},</if>
|
||||
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||
<if test="collectDeviceId != null">collect_device_id = #{collectDeviceId},</if>
|
||||
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||
<if test="grade != null">grade = #{grade},</if>
|
||||
<if test="meterTypeId != null">meter_type_id = #{meterTypeId},</if>
|
||||
<if test="correctValue != null">correct_value = #{correctValue},</if>
|
||||
<if test="pt != null">pt = #{pt},</if>
|
||||
<if test="ct != null">ct = #{ct},</if>
|
||||
<if test="isAmmeter != null">is_ammeter = #{isAmmeter},</if>
|
||||
<if test="isKeyMonitor != null">is_key_monitor = #{isKeyMonitor},</if>
|
||||
<if test="isCircuit != null">is_circuit = #{isCircuit},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="publicShareType != null">public_share_type = #{publicShareType},</if>
|
||||
<if test="monitorHierarchy != null">monitor_hierarchy = #{monitorHierarchy},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsBaseMonitorInfoByObjId" parameterType="Long">
|
||||
delete from ems_base_monitor_info where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsBaseMonitorInfoByObjIds" parameterType="String">
|
||||
delete from ems_base_monitor_info where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hw.ems.record.mapper.TWTempertureDataMapper">
|
||||
|
||||
<resultMap type="TWTempertureData" id="TWTempertureDataResult">
|
||||
<result property="objid" column="objid" />
|
||||
<result property="monitorId" column="monitorId" />
|
||||
<result property="collectTime" column="collectTime" />
|
||||
<result property="tempreture" column="tempreture" />
|
||||
<result property="humidity" column="humidity" />
|
||||
<result property="illuminance" column="illuminance" />
|
||||
<result property="noise" column="noise" />
|
||||
<result property="concentration" column="concentration" />
|
||||
<result property="recodeTime" column="recodeTime" />
|
||||
<result property="alarmType" column="alarmType" />
|
||||
<result property="confirmPersonID" column="confirmPersonID" />
|
||||
<result property="confirmTime" column="confirmTime" />
|
||||
<result property="confirmFlag" column="confirmFlag" />
|
||||
<result property="monitorName" column="monitor_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTWTempertureDataVo">
|
||||
select twtd.objid,
|
||||
twtd.monitorId,
|
||||
twtd.collectTime,
|
||||
twtd.tempreture,
|
||||
twtd.humidity,
|
||||
twtd.illuminance,
|
||||
twtd.noise,
|
||||
twtd.concentration,
|
||||
twtd.recodeTime,
|
||||
twtd.pm1,
|
||||
twtd.pm2,
|
||||
twtd.pm10,
|
||||
twtd.standBy,
|
||||
-- twtd.alarmType,
|
||||
-- twtd.confirmPersonID,
|
||||
-- twtd.confirmTime,
|
||||
-- twtd.confirmFlag,
|
||||
ebmi.monitor_name
|
||||
from record_iotenv_instant twtd
|
||||
left join ems_base_monitor_info ebmi on twtd.monitorId = ebmi.monitor_code
|
||||
</sql>
|
||||
|
||||
<select id="selectTWTempertureDataList" parameterType="TWTempertureData" resultMap="TWTempertureDataResult">
|
||||
<include refid="selectTWTempertureDataVo"/>
|
||||
<where>
|
||||
<if test="monitorId != null and monitorId != ''"> and twtd.monitorId = #{monitorId}</if>
|
||||
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
|
||||
and twtd.collectTime between #{params.beginCollectTime} and #{params.endCollectTime}
|
||||
</if>
|
||||
<if test="tempreture != null "> and twtd.tempreture = #{tempreture}</if>
|
||||
<if test="humidity != null "> and twtd.humidity = #{humidity}</if>
|
||||
<if test="illuminance != null "> and twtd.illuminance = #{illuminance}</if>
|
||||
<if test="noise != null "> and twtd.noise = #{noise}</if>
|
||||
<if test="concentration != null "> and twtd.concentration = #{concentration}</if>
|
||||
<if test="recodeTime != null "> and twtd.recodeTime = #{recodeTime}</if>
|
||||
<if test="alarmType != null "> and twtd.alarmType = #{alarmType}</if>
|
||||
<if test="confirmPersonID != null "> and twtd.confirmPersonID = #{confirmPersonID}</if>
|
||||
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
||||
and twtd.recodeTime between #{params.beginRecordTime} and #{params.endRecordTime}
|
||||
</if>
|
||||
<if test="confirmFlag != null "> and twtd.confirmFlag = #{confirmFlag}</if>
|
||||
</where>
|
||||
order by twtd.recodeTime desc
|
||||
</select>
|
||||
|
||||
<select id="selectTWTempertureDataByObjid" parameterType="Long" resultMap="TWTempertureDataResult">
|
||||
<include refid="selectTWTempertureDataVo"/>
|
||||
where objid = #{objid}
|
||||
</select>
|
||||
<select id="selectIotInstantList" parameterType="TWTempertureData" resultMap="TWTempertureDataResult">
|
||||
<include refid="selectTWTempertureDataVo"></include>
|
||||
<where>
|
||||
<if test="monitorId != null and monitorId != ''">and twtd.monitorId = #{monitorId}</if>
|
||||
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
|
||||
and collectTime between #{params.beginCollectTime} and #{params.endCollectTime}</if>
|
||||
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
||||
and recodeTime between #{params.beginRecordTime} and #{params.endRecordTime}</if>
|
||||
</where>
|
||||
order by twtd.collectTime
|
||||
</select>
|
||||
|
||||
<select id="selectIotInstantMinitoringData" parameterType="TWTempertureData" resultMap="TWTempertureDataResult">
|
||||
<include refid="selectTWTempertureDataVo"></include>
|
||||
<where>
|
||||
<if test="monitorId != null and monitorId != ''"> and twtd.monitorId = #{monitorId}</if>
|
||||
</where>
|
||||
order by twtd.recordTime desc
|
||||
</select>
|
||||
|
||||
<insert id="insertTWTempertureData" parameterType="TWTempertureData" useGeneratedKeys="true" keyProperty="objid">
|
||||
insert into T_W_TempertureData
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitorId,</if>
|
||||
<if test="collectTime != null">collectTime,</if>
|
||||
<if test="tempreture != null">tempreture,</if>
|
||||
<if test="humidity != null">humidity,</if>
|
||||
<if test="illuminance != null">illuminance,</if>
|
||||
<if test="noise != null">noise,</if>
|
||||
<if test="concentration != null">concentration,</if>
|
||||
<if test="recodeTime != null">recodeTime,</if>
|
||||
<if test="alarmType != null">alarmType,</if>
|
||||
<if test="confirmPersonID != null">confirmPersonID,</if>
|
||||
<if test="confirmTime != null">confirmTime,</if>
|
||||
<if test="confirmFlag != null">confirmFlag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="monitorId != null">#{monitorId},</if>
|
||||
<if test="collectTime != null">#{collectTime},</if>
|
||||
<if test="tempreture != null">#{tempreture},</if>
|
||||
<if test="humidity != null">#{humidity},</if>
|
||||
<if test="illuminance != null">#{illuminance},</if>
|
||||
<if test="noise != null">#{noise},</if>
|
||||
<if test="concentration != null">#{concentration},</if>
|
||||
<if test="recodeTime != null">#{recodeTime},</if>
|
||||
<if test="alarmType != null">#{alarmType},</if>
|
||||
<if test="confirmPersonID != null">#{confirmPersonID},</if>
|
||||
<if test="confirmTime != null">#{confirmTime},</if>
|
||||
<if test="confirmFlag != null">#{confirmFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTWTempertureData" parameterType="TWTempertureData">
|
||||
update T_W_TempertureData
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitorId = #{monitorId},</if>
|
||||
<if test="collectTime != null">collectTime = #{collectTime},</if>
|
||||
<if test="tempreture != null">tempreture = #{tempreture},</if>
|
||||
<if test="humidity != null">humidity = #{humidity},</if>
|
||||
<if test="illuminance != null">illuminance = #{illuminance},</if>
|
||||
<if test="noise != null">noise = #{noise},</if>
|
||||
<if test="concentration != null">concentration = #{concentration},</if>
|
||||
<if test="recodeTime != null">recodeTime = #{recodeTime},</if>
|
||||
<if test="alarmType != null">alarmType = #{alarmType},</if>
|
||||
<if test="confirmPersonID != null">confirmPersonID = #{confirmPersonID},</if>
|
||||
<if test="confirmTime != null">confirmTime = #{confirmTime},</if>
|
||||
<if test="confirmFlag != null">confirmFlag = #{confirmFlag},</if>
|
||||
</trim>
|
||||
where objid = #{objid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTWTempertureDataByObjid" parameterType="Long">
|
||||
delete from T_W_TempertureData where objid = #{objid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTWTempertureDataByObjids" parameterType="String">
|
||||
delete from T_W_TempertureData where objid in
|
||||
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||
#{objid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue