Commit e3133339 authored by 耿迪迪's avatar 耿迪迪

上图设备信息 gengdidi

parent 35021ef1
package com.zehong.web.controller.map;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TMapDeviceInfo;
import com.zehong.system.service.ITMapDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 上图设备信息Controller
*
* @author zehong
* @date 2022-10-08
*/
@RestController
@RequestMapping("/map/deviceInfo")
public class TMapDeviceInfoController extends BaseController
{
@Autowired
private ITMapDeviceInfoService tMapDeviceInfoService;
/**
* 查询上图设备信息列表
*/
@GetMapping("/list")
public TableDataInfo list(TMapDeviceInfo tMapDeviceInfo)
{
startPage();
List<TMapDeviceInfo> list = tMapDeviceInfoService.selectTMapDeviceInfoList(tMapDeviceInfo);
return getDataTable(list);
}
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
@GetMapping("/deviceInfoLists")
public List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo){
return tMapDeviceInfoService.deviceInfoLists(tMapDeviceInfo);
}
/**
* 导出上图设备信息列表
*/
@Log(title = "上图设备信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TMapDeviceInfo tMapDeviceInfo)
{
List<TMapDeviceInfo> list = tMapDeviceInfoService.selectTMapDeviceInfoList(tMapDeviceInfo);
ExcelUtil<TMapDeviceInfo> util = new ExcelUtil<TMapDeviceInfo>(TMapDeviceInfo.class);
return util.exportExcel(list, "上图设备信息数据");
}
/**
* 获取上图设备信息详细信息
*/
@GetMapping(value = "/{mapDeviceId}")
public AjaxResult getInfo(@PathVariable("mapDeviceId") Long mapDeviceId)
{
return AjaxResult.success(tMapDeviceInfoService.selectTMapDeviceInfoById(mapDeviceId));
}
/**
* 新增上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMapDeviceInfo tMapDeviceInfo)
{
return toAjax(tMapDeviceInfoService.insertTMapDeviceInfo(tMapDeviceInfo));
}
/**
* 修改上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMapDeviceInfo tMapDeviceInfo)
{
return toAjax(tMapDeviceInfoService.updateTMapDeviceInfo(tMapDeviceInfo));
}
/**
* 删除上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{mapDeviceIds}")
public AjaxResult remove(@PathVariable Long[] mapDeviceIds)
{
return toAjax(tMapDeviceInfoService.deleteTMapDeviceInfoByIds(mapDeviceIds));
}
}
package com.zehong.web.controller.map;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TMapDeviceMonitor;
import com.zehong.system.service.ITMapDeviceMonitorService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 上图设备监测Controller
*
* @author zehong
* @date 2022-10-08
*/
@RestController
@RequestMapping("/map/monitor")
public class TMapDeviceMonitorController extends BaseController
{
@Autowired
private ITMapDeviceMonitorService tMapDeviceMonitorService;
/**
* 查询上图设备监测列表
*/
@PreAuthorize("@ss.hasPermi('system:monitor:list')")
@GetMapping("/list")
public TableDataInfo list(TMapDeviceMonitor tMapDeviceMonitor)
{
startPage();
List<TMapDeviceMonitor> list = tMapDeviceMonitorService.selectTMapDeviceMonitorList(tMapDeviceMonitor);
return getDataTable(list);
}
/**
* 导出上图设备监测列表
*/
@PreAuthorize("@ss.hasPermi('system:monitor:export')")
@Log(title = "上图设备监测", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TMapDeviceMonitor tMapDeviceMonitor)
{
List<TMapDeviceMonitor> list = tMapDeviceMonitorService.selectTMapDeviceMonitorList(tMapDeviceMonitor);
ExcelUtil<TMapDeviceMonitor> util = new ExcelUtil<TMapDeviceMonitor>(TMapDeviceMonitor.class);
return util.exportExcel(list, "上图设备监测数据");
}
/**
* 获取上图设备监测详细信息
*/
@PreAuthorize("@ss.hasPermi('system:monitor:query')")
@GetMapping(value = "/{monitorId}")
public AjaxResult getInfo(@PathVariable("monitorId") Long monitorId)
{
return AjaxResult.success(tMapDeviceMonitorService.selectTMapDeviceMonitorById(monitorId));
}
/**
* 新增上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:add')")
@Log(title = "上图设备监测", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMapDeviceMonitor tMapDeviceMonitor)
{
return toAjax(tMapDeviceMonitorService.insertTMapDeviceMonitor(tMapDeviceMonitor));
}
/**
* 修改上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:edit')")
@Log(title = "上图设备监测", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMapDeviceMonitor tMapDeviceMonitor)
{
return toAjax(tMapDeviceMonitorService.updateTMapDeviceMonitor(tMapDeviceMonitor));
}
/**
* 删除上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:remove')")
@Log(title = "上图设备监测", businessType = BusinessType.DELETE)
@DeleteMapping("/{monitorIds}")
public AjaxResult remove(@PathVariable Long[] monitorIds)
{
return toAjax(tMapDeviceMonitorService.deleteTMapDeviceMonitorByIds(monitorIds));
}
}
package com.zehong.system.domain;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 上图设备信息对象 t_map_device_info
*
* @author zehong
* @date 2022-10-08
*/
public class TMapDeviceInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 上图设备id */
private Long mapDeviceId;
/** 上图设备名称 */
@Excel(name = "上图设备名称")
private String mapDeviceName;
/** 设备类型:1.工业探测器 2.温度变送器 3.压力监测设备 4.液位探测器 5.摄像头 */
@Excel(name = "设备类型:1.工业探测器 2.温度变送器 3.压力监测设备 4.液位探测器 5.摄像头")
private String mapDeviceType;
/** 设备编号 */
@Excel(name = "设备编号")
private String mapDeviceNum;
/** 检测介质 */
@Excel(name = "检测介质")
private String mapDeviceMedium;
/** 单位 */
@Excel(name = "单位")
private String mapDeviceUnit;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
//监测值
private BigDecimal monitorValue;
//设备状态
private String monitorDeviceStatus;
public BigDecimal getMonitorValue() {
return monitorValue;
}
public void setMonitorValue(BigDecimal monitorValue) {
this.monitorValue = monitorValue;
}
public String getMonitorDeviceStatus() {
return monitorDeviceStatus;
}
public void setMonitorDeviceStatus(String monitorDeviceStatus) {
this.monitorDeviceStatus = monitorDeviceStatus;
}
public void setMapDeviceId(Long mapDeviceId)
{
this.mapDeviceId = mapDeviceId;
}
public Long getMapDeviceId()
{
return mapDeviceId;
}
public void setMapDeviceName(String mapDeviceName)
{
this.mapDeviceName = mapDeviceName;
}
public String getMapDeviceName()
{
return mapDeviceName;
}
public void setMapDeviceType(String mapDeviceType)
{
this.mapDeviceType = mapDeviceType;
}
public String getMapDeviceType()
{
return mapDeviceType;
}
public void setMapDeviceNum(String mapDeviceNum)
{
this.mapDeviceNum = mapDeviceNum;
}
public String getMapDeviceNum()
{
return mapDeviceNum;
}
public void setMapDeviceMedium(String mapDeviceMedium)
{
this.mapDeviceMedium = mapDeviceMedium;
}
public String getMapDeviceMedium()
{
return mapDeviceMedium;
}
public void setMapDeviceUnit(String mapDeviceUnit)
{
this.mapDeviceUnit = mapDeviceUnit;
}
public String getMapDeviceUnit()
{
return mapDeviceUnit;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("mapDeviceId", getMapDeviceId())
.append("mapDeviceName", getMapDeviceName())
.append("mapDeviceType", getMapDeviceType())
.append("mapDeviceNum", getMapDeviceNum())
.append("mapDeviceMedium", getMapDeviceMedium())
.append("mapDeviceUnit", getMapDeviceUnit())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 上图设备监测对象 t_map_device_monitor
*
* @author zehong
* @date 2022-10-08
*/
public class TMapDeviceMonitor extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 监测id */
private Long monitorId;
/** 监测值 */
@Excel(name = "监测值")
private BigDecimal monitorValue;
/** 监测设备状态 */
@Excel(name = "监测设备状态")
private String monitorDeviceStatus;
/** 监测设备编号 */
@Excel(name = "监测设备编号")
private String monitorDeviceNum;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
public void setMonitorId(Long monitorId)
{
this.monitorId = monitorId;
}
public Long getMonitorId()
{
return monitorId;
}
public void setMonitorValue(BigDecimal monitorValue)
{
this.monitorValue = monitorValue;
}
public BigDecimal getMonitorValue()
{
return monitorValue;
}
public void setMonitorDeviceStatus(String monitorDeviceStatus)
{
this.monitorDeviceStatus = monitorDeviceStatus;
}
public String getMonitorDeviceStatus()
{
return monitorDeviceStatus;
}
public void setMonitorDeviceNum(String monitorDeviceNum)
{
this.monitorDeviceNum = monitorDeviceNum;
}
public String getMonitorDeviceNum()
{
return monitorDeviceNum;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("monitorId", getMonitorId())
.append("monitorValue", getMonitorValue())
.append("monitorDeviceStatus", getMonitorDeviceStatus())
.append("monitorDeviceNum", getMonitorDeviceNum())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TMapDeviceInfo;
/**
* 上图设备信息Mapper接口
*
* @author zehong
* @date 2022-10-08
*/
public interface TMapDeviceInfoMapper
{
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId);
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息集合
*/
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo);
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 删除上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoById(Long mapDeviceId);
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的数据ID
* @return 结果
*/
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds);
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TMapDeviceMonitor;
/**
* 上图设备监测Mapper接口
*
* @author zehong
* @date 2022-10-08
*/
public interface TMapDeviceMonitorMapper
{
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId);
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测集合
*/
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 删除上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorById(Long monitorId);
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的数据ID
* @return 结果
*/
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TMapDeviceInfo;
/**
* 上图设备信息Service接口
*
* @author zehong
* @date 2022-10-08
*/
public interface ITMapDeviceInfoService
{
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId);
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息集合
*/
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo);
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds);
/**
* 删除上图设备信息信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoById(Long mapDeviceId);
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TMapDeviceMonitor;
/**
* 上图设备监测Service接口
*
* @author zehong
* @date 2022-10-08
*/
public interface ITMapDeviceMonitorService
{
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId);
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测集合
*/
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds);
/**
* 删除上图设备监测信息
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorById(Long monitorId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TMapDeviceInfoMapper;
import com.zehong.system.domain.TMapDeviceInfo;
import com.zehong.system.service.ITMapDeviceInfoService;
/**
* 上图设备信息Service业务层处理
*
* @author zehong
* @date 2022-10-08
*/
@Service
public class TMapDeviceInfoServiceImpl implements ITMapDeviceInfoService
{
@Autowired
private TMapDeviceInfoMapper tMapDeviceInfoMapper;
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
@Override
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId)
{
return tMapDeviceInfoMapper.selectTMapDeviceInfoById(mapDeviceId);
}
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息
*/
@Override
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo)
{
return tMapDeviceInfoMapper.selectTMapDeviceInfoList(tMapDeviceInfo);
}
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
@Override
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo)
{
tMapDeviceInfo.setCreateTime(DateUtils.getNowDate());
return tMapDeviceInfoMapper.insertTMapDeviceInfo(tMapDeviceInfo);
}
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
@Override
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo)
{
tMapDeviceInfo.setUpdateTime(DateUtils.getNowDate());
return tMapDeviceInfoMapper.updateTMapDeviceInfo(tMapDeviceInfo);
}
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的上图设备信息ID
* @return 结果
*/
@Override
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds)
{
return tMapDeviceInfoMapper.deleteTMapDeviceInfoByIds(mapDeviceIds);
}
/**
* 删除上图设备信息信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
@Override
public int deleteTMapDeviceInfoById(Long mapDeviceId)
{
return tMapDeviceInfoMapper.deleteTMapDeviceInfoById(mapDeviceId);
}
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
@Override
public List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo){
return tMapDeviceInfoMapper.deviceInfoLists(tMapDeviceInfo);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TMapDeviceMonitorMapper;
import com.zehong.system.domain.TMapDeviceMonitor;
import com.zehong.system.service.ITMapDeviceMonitorService;
/**
* 上图设备监测Service业务层处理
*
* @author zehong
* @date 2022-10-08
*/
@Service
public class TMapDeviceMonitorServiceImpl implements ITMapDeviceMonitorService
{
@Autowired
private TMapDeviceMonitorMapper tMapDeviceMonitorMapper;
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
@Override
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId)
{
return tMapDeviceMonitorMapper.selectTMapDeviceMonitorById(monitorId);
}
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测
*/
@Override
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor)
{
return tMapDeviceMonitorMapper.selectTMapDeviceMonitorList(tMapDeviceMonitor);
}
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
@Override
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor)
{
tMapDeviceMonitor.setCreateTime(DateUtils.getNowDate());
return tMapDeviceMonitorMapper.insertTMapDeviceMonitor(tMapDeviceMonitor);
}
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
@Override
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor)
{
tMapDeviceMonitor.setUpdateTime(DateUtils.getNowDate());
return tMapDeviceMonitorMapper.updateTMapDeviceMonitor(tMapDeviceMonitor);
}
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的上图设备监测ID
* @return 结果
*/
@Override
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds)
{
return tMapDeviceMonitorMapper.deleteTMapDeviceMonitorByIds(monitorIds);
}
/**
* 删除上图设备监测信息
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
@Override
public int deleteTMapDeviceMonitorById(Long monitorId)
{
return tMapDeviceMonitorMapper.deleteTMapDeviceMonitorById(monitorId);
}
}
<?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.zehong.system.mapper.TMapDeviceInfoMapper">
<resultMap type="TMapDeviceInfo" id="TMapDeviceInfoResult">
<result property="mapDeviceId" column="map_device_id" />
<result property="mapDeviceName" column="map_device_name" />
<result property="mapDeviceType" column="map_device_type" />
<result property="mapDeviceNum" column="map_device_num" />
<result property="mapDeviceMedium" column="map_device_medium" />
<result property="mapDeviceUnit" column="map_device_unit" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<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="isDel" column="is_del" />
<result property="remark" column="remark" />
<result property="monitorDeviceStatus" column="monitor_device_status" />
<result property="monitorValue" column="monitor_value" />
</resultMap>
<sql id="selectTMapDeviceInfoVo">
select map_device_id, map_device_name, map_device_type, map_device_num, map_device_medium, map_device_unit, longitude, latitude, create_by, create_time, update_by, update_time, is_del, remark from t_map_device_info
</sql>
<select id="selectTMapDeviceInfoList" parameterType="TMapDeviceInfo" resultMap="TMapDeviceInfoResult">
<include refid="selectTMapDeviceInfoVo"/>
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and map_device_type = #{mapDeviceType}</if>
<if test="mapDeviceNum != null and mapDeviceNum != ''"> and map_device_num = #{mapDeviceNum}</if>
<if test="mapDeviceMedium != null and mapDeviceMedium != ''"> and map_device_medium = #{mapDeviceMedium}</if>
<if test="mapDeviceUnit != null and mapDeviceUnit != ''"> and map_device_unit = #{mapDeviceUnit}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTMapDeviceInfoById" parameterType="Long" resultMap="TMapDeviceInfoResult">
<include refid="selectTMapDeviceInfoVo"/>
where map_device_id = #{mapDeviceId}
</select>
<insert id="insertTMapDeviceInfo" parameterType="TMapDeviceInfo" useGeneratedKeys="true" keyProperty="mapDeviceId">
insert into t_map_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mapDeviceName != null">map_device_name,</if>
<if test="mapDeviceType != null">map_device_type,</if>
<if test="mapDeviceNum != null">map_device_num,</if>
<if test="mapDeviceMedium != null">map_device_medium,</if>
<if test="mapDeviceUnit != null">map_device_unit,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</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="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mapDeviceName != null">#{mapDeviceName},</if>
<if test="mapDeviceType != null">#{mapDeviceType},</if>
<if test="mapDeviceNum != null">#{mapDeviceNum},</if>
<if test="mapDeviceMedium != null">#{mapDeviceMedium},</if>
<if test="mapDeviceUnit != null">#{mapDeviceUnit},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</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="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTMapDeviceInfo" parameterType="TMapDeviceInfo">
update t_map_device_info
<trim prefix="SET" suffixOverrides=",">
<if test="mapDeviceName != null">map_device_name = #{mapDeviceName},</if>
<if test="mapDeviceType != null">map_device_type = #{mapDeviceType},</if>
<if test="mapDeviceNum != null">map_device_num = #{mapDeviceNum},</if>
<if test="mapDeviceMedium != null">map_device_medium = #{mapDeviceMedium},</if>
<if test="mapDeviceUnit != null">map_device_unit = #{mapDeviceUnit},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</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="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where map_device_id = #{mapDeviceId}
</update>
<delete id="deleteTMapDeviceInfoById" parameterType="Long">
delete from t_map_device_info where map_device_id = #{mapDeviceId}
</delete>
<delete id="deleteTMapDeviceInfoByIds" parameterType="String">
delete from t_map_device_info where map_device_id in
<foreach item="mapDeviceId" collection="array" open="(" separator="," close=")">
#{mapDeviceId}
</foreach>
</delete>
<select id="deviceInfoLists" parameterType="TMapDeviceInfo" resultMap="TMapDeviceInfoResult">
SELECT
device.map_device_id,
device.map_device_name,
device.map_device_type,
device.map_device_num,
device.map_device_medium,
device.map_device_unit,
device.longitude,
device.latitude,
mon.monitor_device_status,
mon.monitor_value
FROM
t_map_device_info device
LEFT JOIN (
SELECT
max(monitor.monitor_id),
monitor.monitor_value,
monitor.monitor_device_status,
monitor.monitor_device_num
FROM
t_map_device_monitor monitor
GROUP BY
monitor.monitor_device_num
)mon ON device.map_device_num = mon.monitor_device_num;
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and device.map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and device.map_device_type = #{mapDeviceType}</if>
<if test="mapDeviceNum != null and mapDeviceNum != ''"> and device.map_device_num = #{mapDeviceNum}</if>
<if test="isDel != null and isDel != ''"> and device.is_del = #{isDel}</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?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.zehong.system.mapper.TMapDeviceMonitorMapper">
<resultMap type="TMapDeviceMonitor" id="TMapDeviceMonitorResult">
<result property="monitorId" column="monitor_id" />
<result property="monitorValue" column="monitor_value" />
<result property="monitorDeviceStatus" column="monitor_device_status" />
<result property="monitorDeviceNum" column="monitor_device_num" />
<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="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTMapDeviceMonitorVo">
select monitor_id, monitor_value, monitor_device_status, monitor_device_num, create_by, create_time, update_by, update_time, is_del, remark from t_map_device_monitor
</sql>
<select id="selectTMapDeviceMonitorList" parameterType="TMapDeviceMonitor" resultMap="TMapDeviceMonitorResult">
<include refid="selectTMapDeviceMonitorVo"/>
<where>
<if test="monitorValue != null "> and monitor_value = #{monitorValue}</if>
<if test="monitorDeviceStatus != null and monitorDeviceStatus != ''"> and monitor_device_status = #{monitorDeviceStatus}</if>
<if test="monitorDeviceNum != null and monitorDeviceNum != ''"> and monitor_device_num = #{monitorDeviceNum}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTMapDeviceMonitorById" parameterType="Long" resultMap="TMapDeviceMonitorResult">
<include refid="selectTMapDeviceMonitorVo"/>
where monitor_id = #{monitorId}
</select>
<insert id="insertTMapDeviceMonitor" parameterType="TMapDeviceMonitor" useGeneratedKeys="true" keyProperty="monitorId">
insert into t_map_device_monitor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorValue != null">monitor_value,</if>
<if test="monitorDeviceStatus != null">monitor_device_status,</if>
<if test="monitorDeviceNum != null">monitor_device_num,</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="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorValue != null">#{monitorValue},</if>
<if test="monitorDeviceStatus != null">#{monitorDeviceStatus},</if>
<if test="monitorDeviceNum != null">#{monitorDeviceNum},</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="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTMapDeviceMonitor" parameterType="TMapDeviceMonitor">
update t_map_device_monitor
<trim prefix="SET" suffixOverrides=",">
<if test="monitorValue != null">monitor_value = #{monitorValue},</if>
<if test="monitorDeviceStatus != null">monitor_device_status = #{monitorDeviceStatus},</if>
<if test="monitorDeviceNum != null">monitor_device_num = #{monitorDeviceNum},</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="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where monitor_id = #{monitorId}
</update>
<delete id="deleteTMapDeviceMonitorById" parameterType="Long">
delete from t_map_device_monitor where monitor_id = #{monitorId}
</delete>
<delete id="deleteTMapDeviceMonitorByIds" parameterType="String">
delete from t_map_device_monitor where monitor_id in
<foreach item="monitorId" collection="array" open="(" separator="," close=")">
#{monitorId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询上图设备信息列表
export function listInfo(query) {
return request({
url: '/map/deviceInfo/list',
method: 'get',
params: query
})
}
//获取所有上图设备信息
export function deviceInfoLists(query) {
return request({
url: '/map/deviceInfo/deviceInfoLists',
method: 'get',
params: query
})
}
// 查询上图设备信息详细
export function getInfo(mapDeviceId) {
return request({
url: '/map/deviceInfo/' + mapDeviceId,
method: 'get'
})
}
// 新增上图设备信息
export function addInfo(data) {
return request({
url: '/map/deviceInfo',
method: 'post',
data: data
})
}
// 修改上图设备信息
export function updateInfo(data) {
return request({
url: '/map/deviceInfo',
method: 'put',
data: data
})
}
// 删除上图设备信息
export function delInfo(mapDeviceId) {
return request({
url: '/map/deviceInfo/' + mapDeviceId,
method: 'delete'
})
}
// 导出上图设备信息
export function exportInfo(query) {
return request({
url: '/map/deviceInfo/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询上图设备监测列表
export function listMonitor(query) {
return request({
url: '/map/monitor/list',
method: 'get',
params: query
})
}
// 查询上图设备监测详细
export function getMonitor(monitorId) {
return request({
url: '/map/monitor/' + monitorId,
method: 'get'
})
}
// 新增上图设备监测
export function addMonitor(data) {
return request({
url: '/map/monitor',
method: 'post',
data: data
})
}
// 修改上图设备监测
export function updateMonitor(data) {
return request({
url: '/map/monitor',
method: 'put',
data: data
})
}
// 删除上图设备监测
export function delMonitor(monitorId) {
return request({
url: '/map/monitor/' + monitorId,
method: 'delete'
})
}
// 导出上图设备监测
export function exportMonitor(query) {
return request({
url: '/map/monitor/export',
method: 'get',
params: query
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment