数据20250904优化-点位列表分页&点位查询
This commit is contained in:
@ -7,8 +7,10 @@ import com.xzzn.common.core.page.TableDataInfo;
|
|||||||
import com.xzzn.common.utils.file.FileUploadUtils;
|
import com.xzzn.common.utils.file.FileUploadUtils;
|
||||||
import com.xzzn.common.utils.file.MimeTypeUtils;
|
import com.xzzn.common.utils.file.MimeTypeUtils;
|
||||||
import com.xzzn.ems.domain.EmsDevicesSetting;
|
import com.xzzn.ems.domain.EmsDevicesSetting;
|
||||||
|
import com.xzzn.ems.domain.EmsPointMatch;
|
||||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||||
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
|
import com.xzzn.ems.domain.vo.SiteDeviceListVo;
|
||||||
|
import com.xzzn.ems.mapper.EmsPointMatchMapper;
|
||||||
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
import com.xzzn.ems.service.IEmsDeviceSettingService;
|
||||||
import com.xzzn.ems.service.IEmsSiteService;
|
import com.xzzn.ems.service.IEmsSiteService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -31,6 +33,8 @@ public class EmsSiteConfigController extends BaseController{
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEmsDeviceSettingService iEmsDeviceSettingService;
|
private IEmsDeviceSettingService iEmsDeviceSettingService;
|
||||||
|
@Autowired
|
||||||
|
private EmsPointMatchMapper emsPointMatchMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取站点列表
|
* 获取站点列表
|
||||||
@ -136,4 +140,15 @@ public class EmsSiteConfigController extends BaseController{
|
|||||||
{
|
{
|
||||||
return toAjax(iEmsDeviceSettingService.deleteEmsDevicesSettingById(id));
|
return toAjax(iEmsDeviceSettingService.deleteEmsDevicesSettingById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单个站点单个设备点位查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/getDevicePointList")
|
||||||
|
public TableDataInfo getDevicePointList(@RequestParam String siteId,@RequestParam String deviceCategory)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EmsPointMatch> pointList = emsPointMatchMapper.getSingleSiteDevicePoints(siteId,deviceCategory);
|
||||||
|
return getDataTable(pointList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import com.xzzn.common.annotation.Excel;
|
|||||||
* 点位匹配对象 ems_point_match
|
* 点位匹配对象 ems_point_match
|
||||||
*
|
*
|
||||||
* @author xzzn
|
* @author xzzn
|
||||||
* @date 2025-09-02
|
* @date 2025-09-13
|
||||||
*/
|
*/
|
||||||
public class EmsPointMatch extends BaseEntity
|
public class EmsPointMatch extends BaseEntity
|
||||||
{
|
{
|
||||||
@ -38,6 +38,18 @@ public class EmsPointMatch extends BaseEntity
|
|||||||
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
||||||
private String deviceCategory;
|
private String deviceCategory;
|
||||||
|
|
||||||
|
/** 数据点位 */
|
||||||
|
@Excel(name = "数据点位")
|
||||||
|
private String dataPoint;
|
||||||
|
|
||||||
|
/** 数据点位名称 */
|
||||||
|
@Excel(name = "数据点位名称")
|
||||||
|
private String dataPointName;
|
||||||
|
|
||||||
|
/** 数据点位来源设备 */
|
||||||
|
@Excel(name = "数据点位来源设备")
|
||||||
|
private String dataDevice;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -98,6 +110,36 @@ public class EmsPointMatch extends BaseEntity
|
|||||||
return deviceCategory;
|
return deviceCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDataPoint(String dataPoint)
|
||||||
|
{
|
||||||
|
this.dataPoint = dataPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataPoint()
|
||||||
|
{
|
||||||
|
return dataPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataPointName(String dataPointName)
|
||||||
|
{
|
||||||
|
this.dataPointName = dataPointName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataPointName()
|
||||||
|
{
|
||||||
|
return dataPointName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataDevice(String dataDevice)
|
||||||
|
{
|
||||||
|
this.dataDevice = dataDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataDevice()
|
||||||
|
{
|
||||||
|
return dataDevice;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
@ -107,6 +149,9 @@ public class EmsPointMatch extends BaseEntity
|
|||||||
.append("matchField", getMatchField())
|
.append("matchField", getMatchField())
|
||||||
.append("siteId", getSiteId())
|
.append("siteId", getSiteId())
|
||||||
.append("deviceCategory", getDeviceCategory())
|
.append("deviceCategory", getDeviceCategory())
|
||||||
|
.append("dataPoint", getDataPoint())
|
||||||
|
.append("dataPointName", getDataPointName())
|
||||||
|
.append("dataDevice", getDataDevice())
|
||||||
.append("createBy", getCreateBy())
|
.append("createBy", getCreateBy())
|
||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
|
|||||||
@ -13,6 +13,9 @@ public class AmmeterLoadDataVo {
|
|||||||
/** 电表名称 */
|
/** 电表名称 */
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
|
|
||||||
|
/** 设备id */
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
/** 通信状态 */
|
/** 通信状态 */
|
||||||
private String emsCommunicationStatus;
|
private String emsCommunicationStatus;
|
||||||
|
|
||||||
@ -54,4 +57,12 @@ public class AmmeterLoadDataVo {
|
|||||||
public void setLoadDataDetailInfo(List<LoadDataDetailInfo> loadDataDetailInfo) {
|
public void setLoadDataDetailInfo(List<LoadDataDetailInfo> loadDataDetailInfo) {
|
||||||
this.loadDataDetailInfo = loadDataDetailInfo;
|
this.loadDataDetailInfo = loadDataDetailInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDeviceId() {
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceId(String deviceId) {
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,8 @@ public class AmmeterMeteDataVo {
|
|||||||
|
|
||||||
/** 电表名称 */
|
/** 电表名称 */
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
|
/** 设备id */
|
||||||
|
private String deviceId;
|
||||||
/** 通信状态 */
|
/** 通信状态 */
|
||||||
private String emsCommunicationStatus;
|
private String emsCommunicationStatus;
|
||||||
|
|
||||||
@ -54,4 +55,12 @@ public class AmmeterMeteDataVo {
|
|||||||
public void setMeteDataDetailInfo(List<MeteDataDetailInfo> meteDataDetailInfo) {
|
public void setMeteDataDetailInfo(List<MeteDataDetailInfo> meteDataDetailInfo) {
|
||||||
this.meteDataDetailInfo = meteDataDetailInfo;
|
this.meteDataDetailInfo = meteDataDetailInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDeviceId() {
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceId(String deviceId) {
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,4 +116,7 @@ public interface EmsPointMatchMapper
|
|||||||
@Param("startDate")Date startDate,
|
@Param("startDate")Date startDate,
|
||||||
@Param("endDate")Date endDate,
|
@Param("endDate")Date endDate,
|
||||||
@Param("deviceId")String deviceId);
|
@Param("deviceId")String deviceId);
|
||||||
|
|
||||||
|
// 单个站点单个设备点位查询
|
||||||
|
public List<EmsPointMatch> getSingleSiteDevicePoints(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -456,6 +456,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
if (AMMETER_DEVICE_LOAD.equals(ammeterId)) {
|
if (AMMETER_DEVICE_LOAD.equals(ammeterId)) {
|
||||||
AmmeterLoadDataVo ammeterLoadDataVo = new AmmeterLoadDataVo();
|
AmmeterLoadDataVo ammeterLoadDataVo = new AmmeterLoadDataVo();
|
||||||
ammeterLoadDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
|
ammeterLoadDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
|
||||||
|
ammeterLoadDataVo.setDeviceId(ammeterDevice.get("id").toString());
|
||||||
ammeterLoadDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
ammeterLoadDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
||||||
ammeterDevice.get("communicationStatus").toString());
|
ammeterDevice.get("communicationStatus").toString());
|
||||||
// 处理总表数据
|
// 处理总表数据
|
||||||
@ -464,6 +465,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
} else if (AMMETER_DEVICE_METE.equals(ammeterId)) {
|
} else if (AMMETER_DEVICE_METE.equals(ammeterId)) {
|
||||||
AmmeterMeteDataVo ammeterMeteDataVo = new AmmeterMeteDataVo();
|
AmmeterMeteDataVo ammeterMeteDataVo = new AmmeterMeteDataVo();
|
||||||
ammeterMeteDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
|
ammeterMeteDataVo.setDeviceName(ammeterDevice.get("deviceName").toString());
|
||||||
|
ammeterMeteDataVo.setDeviceId(ammeterDevice.get("id").toString());
|
||||||
ammeterMeteDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
ammeterMeteDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus") == null? "" :
|
||||||
ammeterDevice.get("communicationStatus").toString());
|
ammeterDevice.get("communicationStatus").toString());
|
||||||
// 处理储能表数据
|
// 处理储能表数据
|
||||||
|
|||||||
@ -348,7 +348,7 @@
|
|||||||
SELECT p.device_id, MAX(p.data_update_time) AS max_update_time
|
SELECT p.device_id, MAX(p.data_update_time) AS max_update_time
|
||||||
FROM ems_pcs_data p
|
FROM ems_pcs_data p
|
||||||
where p.site_id = #{siteId}
|
where p.site_id = #{siteId}
|
||||||
and p.data_update_time >= CURDATE()
|
and p.data_update_time <= CURDATE()
|
||||||
GROUP BY p.device_id
|
GROUP BY p.device_id
|
||||||
) latest inner join ems_pcs_data t ON latest.device_id = t.device_id
|
) latest inner join ems_pcs_data t ON latest.device_id = t.device_id
|
||||||
AND latest.max_update_time = t.data_update_time
|
AND latest.max_update_time = t.data_update_time
|
||||||
|
|||||||
@ -11,6 +11,9 @@
|
|||||||
<result property="matchField" column="match_field" />
|
<result property="matchField" column="match_field" />
|
||||||
<result property="siteId" column="site_id" />
|
<result property="siteId" column="site_id" />
|
||||||
<result property="deviceCategory" column="device_category" />
|
<result property="deviceCategory" column="device_category" />
|
||||||
|
<result property="dataPoint" column="data_point" />
|
||||||
|
<result property="dataPointName" column="data_point_name" />
|
||||||
|
<result property="dataDevice" column="data_device" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
@ -19,7 +22,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEmsPointMatchVo">
|
<sql id="selectEmsPointMatchVo">
|
||||||
select id, point_name, match_table, match_field, site_id, device_category, create_by, create_time, update_by, update_time, remark from ems_point_match
|
select id, point_name, match_table, match_field, site_id, device_category, data_point, data_point_name, data_device, create_by, create_time, update_by, update_time, remark from ems_point_match
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEmsPointMatchList" parameterType="EmsPointMatch" resultMap="EmsPointMatchResult">
|
<select id="selectEmsPointMatchList" parameterType="EmsPointMatch" resultMap="EmsPointMatchResult">
|
||||||
@ -30,6 +33,9 @@
|
|||||||
<if test="matchField != null and matchField != ''"> and match_field = #{matchField}</if>
|
<if test="matchField != null and matchField != ''"> and match_field = #{matchField}</if>
|
||||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||||
|
<if test="dataPoint != null and dataPoint != ''"> and data_point = #{dataPoint}</if>
|
||||||
|
<if test="dataPointName != null and dataPointName != ''"> and data_point_name like concat('%', #{dataPointName}, '%')</if>
|
||||||
|
<if test="dataDevice != null and dataDevice != ''"> and data_device = #{dataDevice}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -46,6 +52,9 @@
|
|||||||
<if test="matchField != null">match_field,</if>
|
<if test="matchField != null">match_field,</if>
|
||||||
<if test="siteId != null">site_id,</if>
|
<if test="siteId != null">site_id,</if>
|
||||||
<if test="deviceCategory != null">device_category,</if>
|
<if test="deviceCategory != null">device_category,</if>
|
||||||
|
<if test="dataPoint != null">data_point,</if>
|
||||||
|
<if test="dataPointName != null">data_point_name,</if>
|
||||||
|
<if test="dataDevice != null">data_device,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
@ -58,6 +67,9 @@
|
|||||||
<if test="matchField != null">#{matchField},</if>
|
<if test="matchField != null">#{matchField},</if>
|
||||||
<if test="siteId != null">#{siteId},</if>
|
<if test="siteId != null">#{siteId},</if>
|
||||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||||
|
<if test="dataPoint != null">#{dataPoint},</if>
|
||||||
|
<if test="dataPointName != null">#{dataPointName},</if>
|
||||||
|
<if test="dataDevice != null">#{dataDevice},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
@ -74,6 +86,9 @@
|
|||||||
<if test="matchField != null">match_field = #{matchField},</if>
|
<if test="matchField != null">match_field = #{matchField},</if>
|
||||||
<if test="siteId != null">site_id = #{siteId},</if>
|
<if test="siteId != null">site_id = #{siteId},</if>
|
||||||
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
|
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
|
||||||
|
<if test="dataPoint != null">data_point = #{dataPoint},</if>
|
||||||
|
<if test="dataPointName != null">data_point_name = #{dataPointName},</if>
|
||||||
|
<if test="dataDevice != null">data_device = #{dataDevice},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
@ -302,4 +317,15 @@
|
|||||||
WHERE t.${tableField} is not null
|
WHERE t.${tableField} is not null
|
||||||
ORDER BY t.site_id, t.device_id, valueDate ASC
|
ORDER BY t.site_id, t.device_id, valueDate ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getSingleSiteDevicePoints" resultMap="EmsPointMatchResult">
|
||||||
|
<include refid="selectEmsPointMatchVo"/>
|
||||||
|
where 1=1
|
||||||
|
<if test="siteId != null and siteId != ''">
|
||||||
|
and site_id = #{siteId}
|
||||||
|
</if>
|
||||||
|
<if test="deviceCategory != null and deviceCategory != ''">
|
||||||
|
and device_category = #{deviceCategory}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user