基坑监测大屏
parent
2cff3262c3
commit
bad6e18413
|
@ -2,6 +2,7 @@ package com.ruoyi.quartz.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.quartz.domain.DevPitmonitSouthsmosData;
|
||||
import com.ruoyi.quartz.domain.DevPitmonitSouthsmosElement;
|
||||
import com.ruoyi.quartz.domain.SurProjectPitMonitCfg;
|
||||
|
||||
/**
|
||||
|
@ -60,5 +61,5 @@ public interface IDevPitmonitSouthsmosDataService
|
|||
*/
|
||||
public int deleteDevPitmonitSouthsmosDataById(Long id);
|
||||
|
||||
public void addList(List<DevPitmonitSouthsmosData> dataList, SurProjectPitMonitCfg cfg);
|
||||
public void addList(List<DevPitmonitSouthsmosData> dataList, SurProjectPitMonitCfg cfg, DevPitmonitSouthsmosElement el);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.quartz.domain.DevPitmonitSouthsmosElement;
|
||||
import com.ruoyi.quartz.domain.SurProjectPitMonitCfg;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -111,9 +112,10 @@ public class DevPitmonitSouthsmosDataServiceImpl implements IDevPitmonitSouthsmo
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addList(List<DevPitmonitSouthsmosData> dataList, SurProjectPitMonitCfg cfg) {
|
||||
public void addList(List<DevPitmonitSouthsmosData> dataList, SurProjectPitMonitCfg cfg, DevPitmonitSouthsmosElement el) {
|
||||
dataList.forEach(it->{
|
||||
it.setCfgId(cfg.getId());
|
||||
it.setDataType(el.getNameEn());
|
||||
DevPitmonitSouthsmosData old=selectDevPitmonitSouthsmosDataByDataId(it.getDataId());
|
||||
if(old==null){
|
||||
insertDevPitmonitSouthsmosData(it);
|
||||
|
|
|
@ -122,7 +122,7 @@ public class PitmonitSouthsmosTask {
|
|||
List<DevPitmonitSouthsmosElement> elList=elementService.selectDevPitmonitSouthsmosElementList(elWhere);
|
||||
elList.forEach(el->{
|
||||
List<DevPitmonitSouthsmosData> dataList=getElementData(orgId,""+el.getSrvId(),el.getNameEn(),token,date,1);
|
||||
dataService.addList(dataList,cfg);
|
||||
dataService.addList(dataList,cfg,el);
|
||||
});
|
||||
//8.获取报警信息
|
||||
List<DevPitmonitSouthsmosAlarm> alarmList=getAlarm(orgId,token,date);
|
||||
|
@ -168,9 +168,9 @@ public class PitmonitSouthsmosTask {
|
|||
//List<DevPitmonitSouthsmosSurveypoint> spList=getSurveyPoint(token,orgId);
|
||||
//System.out.println(spList);
|
||||
//6.获取测点数据
|
||||
//List<DevPitmonitSouthsmosData> dataList=getElementData(orgId,"22","horizontal",token,DateUtil.parse("2024-01-01"),1);
|
||||
//System.out.println(dataList);
|
||||
//System.out.println(dataList.size());
|
||||
List<DevPitmonitSouthsmosData> dataList=getElementData(orgId,"22","horizontal",token,DateUtil.parse("2024-01-01"),1);
|
||||
System.out.println(dataList);
|
||||
System.out.println(dataList.size());
|
||||
//7.获取报警阈值
|
||||
//List<DevPitmonitSouthsmosThreshold> thList=getThreshold("53245",token);
|
||||
//System.out.println(thList);
|
||||
|
@ -178,8 +178,8 @@ public class PitmonitSouthsmosTask {
|
|||
//List<DevPitmonitSouthsmosAlarm> alarmList=getAlarm(orgId,token,DateUtil.parse("2024-01-01"));
|
||||
//System.out.println(alarmList);
|
||||
//9.获取设备
|
||||
List<DevPitmonitSouthsmosDevice> devList=getDevices(token,orgId);
|
||||
System.out.println(devList);
|
||||
//List<DevPitmonitSouthsmosDevice> devList=getDevices(token,orgId);
|
||||
//System.out.println(devList);
|
||||
}
|
||||
|
||||
private static List<DevPitmonitSouthsmosDevice> getDevices(String token,String orgId){
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
package com.yanzhu.jh.bigscreen.web.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.yanzhu.jh.device.domain.PitmonitSouthsmosAlarm;
|
||||
import com.yanzhu.jh.device.domain.PitmonitSouthsmosData;
|
||||
import com.yanzhu.jh.device.service.*;
|
||||
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
/***
|
||||
* 基坑监测
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bgscreen/pitmonit")
|
||||
public class PitMonitController {
|
||||
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosDataService dataService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosAlarmService alarmService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosDeviceService deviceService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosDevSpService devSpService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosElementItemService elementItemService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosElementService elementService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosSurveypointService surveypointService;
|
||||
@Autowired
|
||||
private IPitmonitSouthsmosThresholdService thresholdService;
|
||||
@Autowired
|
||||
private IProjectPitMonitCfgService cfgService;
|
||||
|
||||
@GetMapping("/totalCount")
|
||||
public AjaxResult totalCount(Long prjId) {
|
||||
int dataCount=dataService.getCountByPrjId(prjId);
|
||||
int devCount=deviceService.getCountByPrjId(prjId);
|
||||
Map<String,Integer> map=new HashMap<>();
|
||||
map.put("data",dataCount);
|
||||
map.put("dev",devCount);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
@GetMapping("/alarm")
|
||||
public AjaxResult alarmList(Long prjId){
|
||||
String status="false";
|
||||
List<PitmonitSouthsmosAlarm> list=alarmService.queryByState(prjId,status);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 获取项目中测点最后一条数据
|
||||
*/
|
||||
@GetMapping("/getLastDataForElement")
|
||||
public AjaxResult getLastDataForElement(Long prjId){
|
||||
List<PitmonitSouthsmosData> list=dataService.getLastDataForElement(prjId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 按收集日期和数据类型查询数据
|
||||
*/
|
||||
@PostMapping("/selectByDate")
|
||||
public AjaxResult selectByDate(@RequestBody PitmonitSouthsmosData where){
|
||||
List<PitmonitSouthsmosData> list=dataService.selectByDate(where);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据监控天数
|
||||
*/
|
||||
@GetMapping("/monitDays")
|
||||
public AjaxResult monitDays(Long prjId){
|
||||
Long days=dataService.monitDays(prjId);
|
||||
return AjaxResult.success(days);
|
||||
}
|
||||
}
|
|
@ -41,22 +41,22 @@ public class PitmonitSouthsmosAlarm extends BaseEntity
|
|||
private Date gmtAlarm;
|
||||
|
||||
/** 报警时间,如果数据回落至正常范围或被处理,则报警结束 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "报警时间,如果数据回落至正常范围或被处理,则报警结束", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date gmtAlarmOver;
|
||||
|
||||
/** 开始后第一次产生报警的时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "开始后第一次产生报警的时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date gmtAlarmStart;
|
||||
|
||||
/** 数据库记录创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "数据库记录创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date gmtCreate;
|
||||
|
||||
/** 报警更新时间,该报警每产生一次都会更新该时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "报警更新时间,该报警每产生一次都会更新该时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date gmtModified;
|
||||
|
||||
|
@ -136,6 +136,36 @@ public class PitmonitSouthsmosAlarm extends BaseEntity
|
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDel;
|
||||
|
||||
|
||||
private Long projectId;
|
||||
private String prjName;
|
||||
private String deptName;
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getPrjName() {
|
||||
return prjName;
|
||||
}
|
||||
|
||||
public void setPrjName(String prjName) {
|
||||
this.prjName = prjName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
@ -42,7 +42,7 @@ public class PitmonitSouthsmosData extends BaseEntity
|
|||
private String spName;
|
||||
|
||||
/** 收集时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "收集时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date collectTime;
|
||||
|
||||
|
@ -86,7 +86,35 @@ public class PitmonitSouthsmosData extends BaseEntity
|
|||
@Excel(name = "")
|
||||
private Long isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
private Long projectId;
|
||||
private String prjName;
|
||||
private String deptName;
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getPrjName() {
|
||||
return prjName;
|
||||
}
|
||||
|
||||
public void setPrjName(String prjName) {
|
||||
this.prjName = prjName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface PitmonitSouthsmosAlarmMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevPitmonitSouthsmosAlarmByIds(Long[] ids);
|
||||
|
||||
public List<PitmonitSouthsmosAlarm> queryByState(PitmonitSouthsmosAlarm where);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.jh.device.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.yanzhu.jh.device.domain.PitmonitSouthsmosData;
|
||||
|
||||
|
@ -58,4 +59,21 @@ public interface PitmonitSouthsmosDataMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevPitmonitSouthsmosDataByIds(Long[] ids);
|
||||
|
||||
public int getCountByPrjId(Long prjId);
|
||||
|
||||
/**
|
||||
* 获取项目中测点最后一条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<PitmonitSouthsmosData> getLastDataForElement(Long id);
|
||||
/**
|
||||
* 按收集日期和数据类型查询数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<PitmonitSouthsmosData> selectByDate(PitmonitSouthsmosData where);
|
||||
|
||||
public Date monitDays(Long id);
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface PitmonitSouthsmosDeviceMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevPitmonitSouthsmosDeviceByIds(Long[] ids);
|
||||
|
||||
public int getCountByPrjId(Long id);
|
||||
}
|
||||
|
|
|
@ -58,4 +58,12 @@ public interface IPitmonitSouthsmosAlarmService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevPitmonitSouthsmosAlarmById(Long id);
|
||||
|
||||
/**
|
||||
* 按项目和状态来查询
|
||||
* @param prjId
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
public List<PitmonitSouthsmosAlarm> queryByState(Long prjId, String status);
|
||||
}
|
||||
|
|
|
@ -58,4 +58,24 @@ public interface IPitmonitSouthsmosDataService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevPitmonitSouthsmosDataById(Long id);
|
||||
|
||||
public int getCountByPrjId(Long prjId);
|
||||
|
||||
/**
|
||||
* 获取项目中测点最后一条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<PitmonitSouthsmosData> getLastDataForElement(Long id);
|
||||
|
||||
/**
|
||||
* 按收集日期和数据类型查询数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<PitmonitSouthsmosData> selectByDate(PitmonitSouthsmosData where);
|
||||
/**
|
||||
* 数据监控天数
|
||||
*/
|
||||
public Long monitDays(Long prjId);
|
||||
}
|
||||
|
|
|
@ -58,4 +58,6 @@ public interface IPitmonitSouthsmosDeviceService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevPitmonitSouthsmosDeviceById(Long id);
|
||||
|
||||
public int getCountByPrjId(Long prjId);
|
||||
}
|
||||
|
|
|
@ -95,4 +95,12 @@ public class PitmonitSouthsmosAlarmServiceImpl implements IPitmonitSouthsmosAlar
|
|||
{
|
||||
return pitmonitSouthsmosAlarmMapper.deleteDevPitmonitSouthsmosAlarmById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PitmonitSouthsmosAlarm> queryByState(Long prjId, String status) {
|
||||
PitmonitSouthsmosAlarm where=new PitmonitSouthsmosAlarm();
|
||||
where.setProjectId(prjId);
|
||||
where.setStatus(status);
|
||||
return pitmonitSouthsmosAlarmMapper.queryByState(where);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
package com.yanzhu.jh.device.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -95,4 +99,34 @@ public class PitmonitSouthsmosDataServiceImpl implements IPitmonitSouthsmosDataS
|
|||
{
|
||||
return pitmonitSouthsmosDataMapper.deleteDevPitmonitSouthsmosDataById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCountByPrjId(Long prjId) {
|
||||
return pitmonitSouthsmosDataMapper.getCountByPrjId(prjId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目中测点最后一条数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PitmonitSouthsmosData> getLastDataForElement(Long id) {
|
||||
return pitmonitSouthsmosDataMapper.getLastDataForElement(id);
|
||||
}
|
||||
/**
|
||||
* 按收集日期和数据类型查询数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PitmonitSouthsmosData> selectByDate(PitmonitSouthsmosData where) {
|
||||
return pitmonitSouthsmosDataMapper.selectByDate(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long monitDays(Long id) {
|
||||
Date dt= pitmonitSouthsmosDataMapper.monitDays(id);
|
||||
return DateUtil.between(new Date(),dt, DateUnit.DAY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,4 +95,9 @@ public class PitmonitSouthsmosDeviceServiceImpl implements IPitmonitSouthsmosDev
|
|||
{
|
||||
return pitmonitSouthsmosDeviceMapper.deleteDevPitmonitSouthsmosDeviceById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCountByPrjId(Long prjId) {
|
||||
return pitmonitSouthsmosDeviceMapper.getCountByPrjId(prjId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosAlarmMapper">
|
||||
|
||||
<resultMap type="DevPitmonitSouthsmosAlarm" id="DevPitmonitSouthsmosAlarmResult">
|
||||
<resultMap type="PitmonitSouthsmosAlarm" id="PitmonitSouthsmosAlarmResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="srvId" column="srvId" />
|
||||
|
@ -39,13 +39,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="deptName" column="deptName"/>
|
||||
<result property="projectId" column="projectId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDevPitmonitSouthsmosAlarmVo">
|
||||
select id, cfgId, srvId, alarmInfo, alarmSource, gmtAlarm, gmtAlarmOver, gmtAlarmStart, gmtCreate, gmtModified, level, meId, meName, monitorItemId, numbers, result, resultUrl, spId, spName, staff, staffPhone, status, structureId, structureName, threshold, type, variety, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_alarm
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosAlarmList" parameterType="PitmonitSouthsmosAlarm" resultMap="DevPitmonitSouthsmosAlarmResult">
|
||||
<select id="selectDevPitmonitSouthsmosAlarmList" parameterType="PitmonitSouthsmosAlarm" resultMap="PitmonitSouthsmosAlarmResult">
|
||||
<include refid="selectDevPitmonitSouthsmosAlarmVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -79,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosAlarmById" parameterType="Long" resultMap="DevPitmonitSouthsmosAlarmResult">
|
||||
<select id="selectDevPitmonitSouthsmosAlarmById" parameterType="Long" resultMap="PitmonitSouthsmosAlarmResult">
|
||||
<include refid="selectDevPitmonitSouthsmosAlarmVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
@ -208,4 +210,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="queryByState" parameterType="PitmonitSouthsmosAlarm" resultMap="PitmonitSouthsmosAlarmResult">
|
||||
SELECT a.*,c.unitName AS deptName,b.project_id as projectId
|
||||
FROM dev_pitmonit_southsmos_alarm a
|
||||
JOIN sur_project_pit_monit_cfg b ON a.cfgId = b.id
|
||||
JOIN sur_project_unit_info c ON b.sub_dept_id = c.unitId AND b.project_id = c.projectId
|
||||
WHERE b.project_id = 644
|
||||
AND a.is_del = 0
|
||||
AND a.status = 'false';
|
||||
</select>
|
||||
</mapper>
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosDataMapper">
|
||||
|
||||
<resultMap type="DevPitmonitSouthsmosData" id="DevPitmonitSouthsmosDataResult">
|
||||
<resultMap type="PitmonitSouthsmosData" id="PitmonitSouthsmosDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="dataType" column="dataType" />
|
||||
|
@ -27,13 +27,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="deptName" column="deptName"/>
|
||||
<result property="projectId" column="projectId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDevPitmonitSouthsmosDataVo">
|
||||
select id, cfgId, dataType, dataId, spId, spName, collectTime, changeRate, changeRate2, displace, displace2, totalize, totalize2, variation, variation2, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDataList" parameterType="PitmonitSouthsmosData" resultMap="DevPitmonitSouthsmosDataResult">
|
||||
<select id="selectDevPitmonitSouthsmosDataList" parameterType="PitmonitSouthsmosData" resultMap="PitmonitSouthsmosDataResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDataVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -55,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDataById" parameterType="Long" resultMap="DevPitmonitSouthsmosDataResult">
|
||||
<select id="selectDevPitmonitSouthsmosDataById" parameterType="Long" resultMap="PitmonitSouthsmosDataResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
@ -148,4 +150,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getCountByPrjId" resultType="Integer" parameterType="Long">
|
||||
SELECT COUNT(1)
|
||||
FROM dev_pitmonit_southsmos_data d
|
||||
JOIN sur_project_pit_monit_cfg s ON d.cfgid = s.id
|
||||
WHERE s.project_id = #{prjId}
|
||||
AND d.is_del = 0
|
||||
</select>
|
||||
|
||||
<select id="getLastDataForElement" parameterType="Long" resultMap="PitmonitSouthsmosDataResult">
|
||||
WITH LatestData AS (
|
||||
SELECT a.spid, MAX(a.id) AS max_id
|
||||
FROM dev_pitmonit_southsmos_data a
|
||||
JOIN sur_project_pit_monit_cfg b ON a.cfgId = b.id
|
||||
WHERE b.project_id = #{id}
|
||||
AND a.is_del = 0
|
||||
GROUP BY a.spid
|
||||
),
|
||||
FilteredData AS (
|
||||
SELECT a.*, c.unitName AS deptName, b.project_id AS projectId
|
||||
FROM dev_pitmonit_southsmos_data a
|
||||
JOIN sur_project_pit_monit_cfg b ON a.cfgId = b.id
|
||||
JOIN sur_project_unit_info c ON b.sub_dept_id = c.unitId AND b.project_id = c.projectId
|
||||
JOIN LatestData ld ON a.id = ld.max_id
|
||||
WHERE b.project_id = #{id}
|
||||
AND a.is_del = 0
|
||||
),
|
||||
SurveyPoints AS (
|
||||
SELECT a.cfgid, a.spId, a.NAME, a.meNameEn,c.unitName AS deptName,c.projectId,a.position as remark
|
||||
FROM dev_pitmonit_southsmos_surveypoint a
|
||||
JOIN sur_project_pit_monit_cfg b ON a.cfgId = b.id
|
||||
JOIN sur_project_unit_info c ON b.sub_dept_id=c.unitId AND b.project_id=c.projectId
|
||||
WHERE b.project_id = #{id}
|
||||
)
|
||||
SELECT sp.cfgid, sp.spId, sp.NAME AS spName, sp.meNameEn AS datatype,
|
||||
fd.id, fd.dataid, fd.collecttime, fd.changeRate, fd.changeRate2,
|
||||
fd.displace, fd.displace2, fd.totalize, fd.totalize2, fd.variation,
|
||||
fd.variation2, fd.state, sp.remark, fd.is_del, fd.create_by,
|
||||
fd.create_time, fd.update_by, fd.update_time, sp.deptName, sp.projectId
|
||||
FROM SurveyPoints sp
|
||||
LEFT JOIN FilteredData fd ON sp.spId = fd.spid;
|
||||
</select>
|
||||
|
||||
<select id="selectByDate" parameterType="PitmonitSouthsmosData" resultMap="PitmonitSouthsmosDataResult">
|
||||
select
|
||||
a.id, a.cfgId, a.dataType, a.dataId, a.spId, a.spName, a.collectTime, a.changeRate, a.changeRate2, a.displace, a.displace2, a.totalize,
|
||||
a.totalize2, a.variation, a.variation2, a.state, a.remark, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time
|
||||
from dev_pitmonit_southsmos_data a
|
||||
JOIN sur_project_pit_monit_cfg b on a.cfgId=b.id
|
||||
WHERE b.project_id = #{projectId}
|
||||
AND a.is_del = 0
|
||||
<if test="dataType != null and dataType != ''"> and a.dataType = #{dataType}</if>
|
||||
<if test="createTime != null">and a.collectTime >= #{createTime}</if>
|
||||
<if test="updateTime != null">and a.collectTime <= #{updateTime}</if>
|
||||
order by a.collectTime desc
|
||||
</select>
|
||||
|
||||
<select id="monitDays" parameterType="Long" resultType="Date">
|
||||
select min(collectTime) collectTime
|
||||
from dev_pitmonit_southsmos_data a
|
||||
JOIN sur_project_pit_monit_cfg b ON a.cfgId=b.id
|
||||
WHERE b.project_id= #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosDevSpMapper">
|
||||
|
||||
<resultMap type="PitmonitSouthsmosDevSp" id="DevPitmonitSouthsmosDevSpResult">
|
||||
<resultMap type="PitmonitSouthsmosDevSp" id="PitmonitSouthsmosDevSpResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="devId" column="devId" />
|
||||
|
@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, cfgId, devId, spId, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_dev_sp
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDevSpList" parameterType="PitmonitSouthsmosDevSp" resultMap="DevPitmonitSouthsmosDevSpResult">
|
||||
<select id="selectDevPitmonitSouthsmosDevSpList" parameterType="PitmonitSouthsmosDevSp" resultMap="PitmonitSouthsmosDevSpResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDevSpVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDevSpById" parameterType="Long" resultMap="DevPitmonitSouthsmosDevSpResult">
|
||||
<select id="selectDevPitmonitSouthsmosDevSpById" parameterType="Long" resultMap="PitmonitSouthsmosDevSpResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDevSpVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosDeviceMapper">
|
||||
|
||||
<resultMap type="DevPitmonitSouthsmosDevice" id="DevPitmonitSouthsmosDeviceResult">
|
||||
<resultMap type="PitmonitSouthsmosDevice" id="PitmonitSouthsmosDeviceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="devId" column="devId" />
|
||||
|
@ -39,10 +39,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectDevPitmonitSouthsmosDeviceVo">
|
||||
select id, cfgId, devId, autoType, certUrl, checkDate, devCode, devShadow, devType, devTypeName, key, manufacturer, name, orgId, parent, parentIds, productType, position, status, structureId, structureName, typeCategory, typeName, verifyDate, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_device
|
||||
select id, cfgId, devId, autoType, certUrl, checkDate, devCode, devShadow, devType, devTypeName, key, manufacturer, name, orgId, parent, parentIds, productType, position, status, structureId, structureName, typeCategory, typeName, verifyDate, state, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from dev_pitmonit_southsmos_device
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDeviceList" parameterType="DevPitmonitSouthsmosDevice" resultMap="DevPitmonitSouthsmosDeviceResult">
|
||||
<select id="selectDevPitmonitSouthsmosDeviceList" parameterType="DevPitmonitSouthsmosDevice" resultMap="PitmonitSouthsmosDeviceResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDeviceVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -73,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosDeviceById" parameterType="Long" resultMap="DevPitmonitSouthsmosDeviceResult">
|
||||
<select id="selectDevPitmonitSouthsmosDeviceById" parameterType="Long" resultMap="PitmonitSouthsmosDeviceResult">
|
||||
<include refid="selectDevPitmonitSouthsmosDeviceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
@ -193,4 +194,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getCountByPrjId" resultType="Integer" parameterType="Long">
|
||||
SELECT COUNT(1)
|
||||
FROM dev_pitmonit_southsmos_device d
|
||||
JOIN sur_project_pit_monit_cfg s ON d.cfgid = s.id
|
||||
WHERE s.project_id = #{id}
|
||||
AND d.is_del = 0
|
||||
</select>
|
||||
</mapper>
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosElementItemMapper">
|
||||
|
||||
<resultMap type="PitmonitSouthsmosElementItem" id="DevPitmonitSouthsmosElementItemResult">
|
||||
<resultMap type="PitmonitSouthsmosElementItem" id="PitmonitSouthsmosElementItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="srvId" column="srvId" />
|
||||
|
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, cfgId, srvId, monitorElementId, name, step, unit, valueRange, gmtCreate, gmtModified, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_element_item
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosElementItemList" parameterType="DevPitmonitSouthsmosElementItem" resultMap="DevPitmonitSouthsmosElementItemResult">
|
||||
<select id="selectDevPitmonitSouthsmosElementItemList" parameterType="DevPitmonitSouthsmosElementItem" resultMap="PitmonitSouthsmosElementItemResult">
|
||||
<include refid="selectDevPitmonitSouthsmosElementItemVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosElementItemById" parameterType="Long" resultMap="DevPitmonitSouthsmosElementItemResult">
|
||||
<select id="selectDevPitmonitSouthsmosElementItemById" parameterType="Long" resultMap="PitmonitSouthsmosElementItemResult">
|
||||
<include refid="selectDevPitmonitSouthsmosElementItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosElementMapper">
|
||||
|
||||
<resultMap type="PitmonitSouthsmosElement" id="DevPitmonitSouthsmosElementResult">
|
||||
<resultMap type="PitmonitSouthsmosElement" id="PitmonitSouthsmosElementResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="srvId" column="srvId" />
|
||||
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, cfgId, srvId, maxSp, monitorStatus, name, nameEn, type, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_element
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosElementList" parameterType="PitmonitSouthsmosElement" resultMap="DevPitmonitSouthsmosElementResult">
|
||||
<select id="selectDevPitmonitSouthsmosElementList" parameterType="PitmonitSouthsmosElement" resultMap="PitmonitSouthsmosElementResult">
|
||||
<include refid="selectDevPitmonitSouthsmosElementVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosElementById" parameterType="Long" resultMap="DevPitmonitSouthsmosElementResult">
|
||||
<select id="selectDevPitmonitSouthsmosElementById" parameterType="Long" resultMap="PitmonitSouthsmosElementResult">
|
||||
<include refid="selectDevPitmonitSouthsmosElementVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosSurveypointMapper">
|
||||
|
||||
<resultMap type="DevPitmonitSouthsmosSurveypoint" id="DevPitmonitSouthsmosSurveypointResult">
|
||||
<resultMap type="DevPitmonitSouthsmosSurveypoint" id="PitmonitSouthsmosSurveypointResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="spId" column="spId" />
|
||||
|
@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, cfgId, spId, groupId, groupName, meId, meName, meNameEn, modifyDate, name, position, dataSource, createDate, status, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_surveypoint
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosSurveypointList" parameterType="PitmonitSouthsmosSurveypoint" resultMap="DevPitmonitSouthsmosSurveypointResult">
|
||||
<select id="selectDevPitmonitSouthsmosSurveypointList" parameterType="PitmonitSouthsmosSurveypoint" resultMap="PitmonitSouthsmosSurveypointResult">
|
||||
<include refid="selectDevPitmonitSouthsmosSurveypointVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosSurveypointById" parameterType="Long" resultMap="DevPitmonitSouthsmosSurveypointResult">
|
||||
<select id="selectDevPitmonitSouthsmosSurveypointById" parameterType="Long" resultMap="PitmonitSouthsmosSurveypointResult">
|
||||
<include refid="selectDevPitmonitSouthsmosSurveypointVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.PitmonitSouthsmosThresholdMapper">
|
||||
|
||||
<resultMap type="DevPitmonitSouthsmosThreshold" id="DevPitmonitSouthsmosThresholdResult">
|
||||
<resultMap type="DevPitmonitSouthsmosThreshold" id="PitmonitSouthsmosThresholdResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgId" column="cfgId" />
|
||||
<result property="srvId" column="srvId" />
|
||||
|
@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, cfgId, srvId, alarmInfo, alarmName, intervalA, intervalB, level, monitorElementId, monitorItemId, monitorItemName, tgId, threshold, type, unit, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_threshold
|
||||
</sql>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosThresholdList" parameterType="DevPitmonitSouthsmosThreshold" resultMap="DevPitmonitSouthsmosThresholdResult">
|
||||
<select id="selectDevPitmonitSouthsmosThresholdList" parameterType="DevPitmonitSouthsmosThreshold" resultMap="PitmonitSouthsmosThresholdResult">
|
||||
<include refid="selectDevPitmonitSouthsmosThresholdVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
|
||||
|
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevPitmonitSouthsmosThresholdById" parameterType="Long" resultMap="DevPitmonitSouthsmosThresholdResult">
|
||||
<select id="selectDevPitmonitSouthsmosThresholdById" parameterType="Long" resultMap="PitmonitSouthsmosThresholdResult">
|
||||
<include refid="selectDevPitmonitSouthsmosThresholdVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.jh.device.mapper.ProjectPitMonitCfgMapper">
|
||||
|
||||
<resultMap type="ProjectPitMonitCfg" id="SurProjectPitMonitCfgResult">
|
||||
<resultMap type="ProjectPitMonitCfg" id="ProjectPitMonitCfgResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="subDeptId" column="sub_dept_id" />
|
||||
|
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, project_id, sub_dept_id, vendor_code, vendor_paramter, enabled, state, remark, is_del, create_by, create_time, update_by, update_time from sur_project_pit_monit_cfg
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectPitMonitCfgList" parameterType="SurProjectPitMonitCfg" resultMap="SurProjectPitMonitCfgResult">
|
||||
<select id="selectSurProjectPitMonitCfgList" parameterType="SurProjectPitMonitCfg" resultMap="ProjectPitMonitCfgResult">
|
||||
<include refid="selectSurProjectPitMonitCfgVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectPitMonitCfgById" parameterType="Long" resultMap="SurProjectPitMonitCfgResult">
|
||||
<select id="selectSurProjectPitMonitCfgById" parameterType="Long" resultMap="ProjectPitMonitCfgResult">
|
||||
<include refid="selectSurProjectPitMonitCfgVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
Loading…
Reference in New Issue