task61-告警保护方案增删改查
This commit is contained in:
@ -0,0 +1,105 @@
|
||||
package com.xzzn.web.controller.ems;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xzzn.ems.service.IEmsFaultProtectionPlanService;
|
||||
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.xzzn.common.annotation.Log;
|
||||
import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import com.xzzn.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案Controller
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/protectPlan")
|
||||
public class EmsFaultProtectionPlanController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsFaultProtectionPlanService emsFaultProtectionPlanService;
|
||||
|
||||
/**
|
||||
* 查询故障告警保护方案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
startPage();
|
||||
List<EmsFaultProtectionPlan> list = emsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出故障告警保护方案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:export')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
List<EmsFaultProtectionPlan> list = emsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
|
||||
ExcelUtil<EmsFaultProtectionPlan> util = new ExcelUtil<EmsFaultProtectionPlan>(EmsFaultProtectionPlan.class);
|
||||
util.exportExcel(response, list, "故障告警保护方案数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取故障告警保护方案详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(emsFaultProtectionPlanService.selectEmsFaultProtectionPlanById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障告警保护方案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:add')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
return toAjax(emsFaultProtectionPlanService.insertEmsFaultProtectionPlan(emsFaultProtectionPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障告警保护方案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:edit')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
return toAjax(emsFaultProtectionPlanService.updateEmsFaultProtectionPlan(emsFaultProtectionPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障告警保护方案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:plan:remove')")
|
||||
@Log(title = "故障告警保护方案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(emsFaultProtectionPlanService.deleteEmsFaultProtectionPlanByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -102,6 +102,10 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
@Excel(name = "设备类别,例如“STACK/CLUSTER/PCS等”")
|
||||
private String deviceCategory;
|
||||
|
||||
/** 设备运行状态:0-离线、1-待机、2-运行、3-故障、4-停机 */
|
||||
@Excel(name = "设备运行状态:0-离线、1-待机、2-运行、3-故障、4-停机")
|
||||
private String runningStatus;
|
||||
|
||||
/** 设备图像地址 */
|
||||
@Excel(name = "设备图像地址")
|
||||
private String pictureUrl;
|
||||
@ -316,6 +320,14 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
return deviceCategory;
|
||||
}
|
||||
|
||||
public String getRunningStatus() {
|
||||
return runningStatus;
|
||||
}
|
||||
|
||||
public void setRunningStatus(String runningStatus) {
|
||||
this.runningStatus = runningStatus;
|
||||
}
|
||||
|
||||
public void setPictureUrl(String pictureUrl)
|
||||
{
|
||||
this.pictureUrl = pictureUrl;
|
||||
@ -350,6 +362,7 @@ public class EmsDevicesSetting extends BaseEntity
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("parentId", getParentId())
|
||||
.append("deviceCategory", getDeviceCategory())
|
||||
.append("runningStatus", getRunningStatus())
|
||||
.append("pictureUrl", getPictureUrl())
|
||||
.toString();
|
||||
}
|
||||
|
||||
@ -0,0 +1,191 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案对象 ems_fault_protection_plan
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public class EmsFaultProtectionPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
private String siteId;
|
||||
|
||||
/** 故障名称(如:总压高、放电总压过低) */
|
||||
@Excel(name = "故障名称", readConverterExp = "如=:总压高、放电总压过低")
|
||||
private String faultName;
|
||||
|
||||
/** 故障等级(1级/2级/3级) */
|
||||
@Excel(name = "故障等级", readConverterExp = "1=级/2级/3级")
|
||||
private Integer faultLevel;
|
||||
|
||||
/** 保护设置:点位/故障值/比较方式/释放值等 */
|
||||
@Excel(name = "保护设置:点位/故障值/比较方式/释放值等")
|
||||
private String protectionSettings;
|
||||
|
||||
/** 故障延时(秒,如:3S→3) */
|
||||
@Excel(name = "故障延时", readConverterExp = "秒=,如:3S→3")
|
||||
private Long faultDelaySeconds;
|
||||
|
||||
/** 保护方案:修改目标点位和值 */
|
||||
@Excel(name = "保护方案:修改目标点位和值")
|
||||
private String protectionPlan;
|
||||
|
||||
/** 释放延时(秒,如:5S→5,3级可能无) */
|
||||
@Excel(name = "释放延时", readConverterExp = "秒=,如:5S→5,3级可能无")
|
||||
private Long releaseDelaySeconds;
|
||||
|
||||
/** 处理方案描述(例如:报警,降功率50%运行) */
|
||||
@Excel(name = "处理方案描述", readConverterExp = "例=如:报警,降功率50%运行")
|
||||
private String description;
|
||||
|
||||
/** 是否触发告警(0 - 不告警;1 - 告警) */
|
||||
@Excel(name = "是否触发告警", readConverterExp = "0=不告警;1=告警")
|
||||
private Integer isAlert;
|
||||
|
||||
/** 方案是否启用 0-未启用 1-已启用 */
|
||||
@Excel(name = "方案是否启用 0-未启用 1-已启用")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId)
|
||||
{
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSiteId()
|
||||
{
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setFaultName(String faultName)
|
||||
{
|
||||
this.faultName = faultName;
|
||||
}
|
||||
|
||||
public String getFaultName()
|
||||
{
|
||||
return faultName;
|
||||
}
|
||||
|
||||
public void setFaultLevel(Integer faultLevel)
|
||||
{
|
||||
this.faultLevel = faultLevel;
|
||||
}
|
||||
|
||||
public Integer getFaultLevel()
|
||||
{
|
||||
return faultLevel;
|
||||
}
|
||||
|
||||
public void setProtectionSettings(String protectionSettings)
|
||||
{
|
||||
this.protectionSettings = protectionSettings;
|
||||
}
|
||||
|
||||
public String getProtectionSettings()
|
||||
{
|
||||
return protectionSettings;
|
||||
}
|
||||
|
||||
public void setFaultDelaySeconds(Long faultDelaySeconds)
|
||||
{
|
||||
this.faultDelaySeconds = faultDelaySeconds;
|
||||
}
|
||||
|
||||
public Long getFaultDelaySeconds()
|
||||
{
|
||||
return faultDelaySeconds;
|
||||
}
|
||||
|
||||
public void setProtectionPlan(String protectionPlan)
|
||||
{
|
||||
this.protectionPlan = protectionPlan;
|
||||
}
|
||||
|
||||
public String getProtectionPlan()
|
||||
{
|
||||
return protectionPlan;
|
||||
}
|
||||
|
||||
public void setReleaseDelaySeconds(Long releaseDelaySeconds)
|
||||
{
|
||||
this.releaseDelaySeconds = releaseDelaySeconds;
|
||||
}
|
||||
|
||||
public Long getReleaseDelaySeconds()
|
||||
{
|
||||
return releaseDelaySeconds;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setIsAlert(Integer isAlert)
|
||||
{
|
||||
this.isAlert = isAlert;
|
||||
}
|
||||
|
||||
public Integer getIsAlert()
|
||||
{
|
||||
return isAlert;
|
||||
}
|
||||
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteId", getSiteId())
|
||||
.append("faultName", getFaultName())
|
||||
.append("faultLevel", getFaultLevel())
|
||||
.append("protectionSettings", getProtectionSettings())
|
||||
.append("faultDelaySeconds", getFaultDelaySeconds())
|
||||
.append("protectionPlan", getProtectionPlan())
|
||||
.append("releaseDelaySeconds", getReleaseDelaySeconds())
|
||||
.append("description", getDescription())
|
||||
.append("isAlert", getIsAlert())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -15,8 +15,8 @@ public class SiteDeviceListVo {
|
||||
private String deviceName;
|
||||
/** 设备类型 */
|
||||
private String deviceType;
|
||||
/** 通信状态 */
|
||||
private String communicationStatus;
|
||||
/** 运行状态 */
|
||||
private String runningStatus;
|
||||
/** 设备类型 */
|
||||
private String deviceCategory;
|
||||
/** 设备类型 */
|
||||
@ -78,12 +78,12 @@ public class SiteDeviceListVo {
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
|
||||
public String getCommunicationStatus() {
|
||||
return communicationStatus;
|
||||
public String getRunningStatus() {
|
||||
return runningStatus;
|
||||
}
|
||||
|
||||
public void setCommunicationStatus(String communicationStatus) {
|
||||
this.communicationStatus = communicationStatus;
|
||||
public void setRunningStatus(String runningStatus) {
|
||||
this.runningStatus = runningStatus;
|
||||
}
|
||||
|
||||
public String getDeviceCategory() {
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案Mapper接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public interface EmsFaultProtectionPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询故障告警保护方案
|
||||
*
|
||||
* @param id 故障告警保护方案主键
|
||||
* @return 故障告警保护方案
|
||||
*/
|
||||
public EmsFaultProtectionPlan selectEmsFaultProtectionPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 查询故障告警保护方案列表
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 故障告警保护方案集合
|
||||
*/
|
||||
public List<EmsFaultProtectionPlan> selectEmsFaultProtectionPlanList(EmsFaultProtectionPlan emsFaultProtectionPlan);
|
||||
|
||||
/**
|
||||
* 新增故障告警保护方案
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsFaultProtectionPlan(EmsFaultProtectionPlan emsFaultProtectionPlan);
|
||||
|
||||
/**
|
||||
* 修改故障告警保护方案
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsFaultProtectionPlan(EmsFaultProtectionPlan emsFaultProtectionPlan);
|
||||
|
||||
/**
|
||||
* 删除故障告警保护方案
|
||||
*
|
||||
* @param id 故障告警保护方案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsFaultProtectionPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除故障告警保护方案
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsFaultProtectionPlanByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案Service接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public interface IEmsFaultProtectionPlanService
|
||||
{
|
||||
/**
|
||||
* 查询故障告警保护方案
|
||||
*
|
||||
* @param id 故障告警保护方案主键
|
||||
* @return 故障告警保护方案
|
||||
*/
|
||||
public EmsFaultProtectionPlan selectEmsFaultProtectionPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 查询故障告警保护方案列表
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 故障告警保护方案集合
|
||||
*/
|
||||
public List<EmsFaultProtectionPlan> selectEmsFaultProtectionPlanList(EmsFaultProtectionPlan emsFaultProtectionPlan);
|
||||
|
||||
/**
|
||||
* 新增故障告警保护方案
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsFaultProtectionPlan(EmsFaultProtectionPlan emsFaultProtectionPlan);
|
||||
|
||||
/**
|
||||
* 修改故障告警保护方案
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsFaultProtectionPlan(EmsFaultProtectionPlan emsFaultProtectionPlan);
|
||||
|
||||
/**
|
||||
* 批量删除故障告警保护方案
|
||||
*
|
||||
* @param ids 需要删除的故障告警保护方案主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsFaultProtectionPlanByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除故障告警保护方案信息
|
||||
*
|
||||
* @param id 故障告警保护方案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsFaultProtectionPlanById(Long id);
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xzzn.ems.mapper.EmsFaultProtectionPlanMapper;
|
||||
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
|
||||
import com.xzzn.ems.service.IEmsFaultProtectionPlanService;
|
||||
|
||||
/**
|
||||
* 故障告警保护方案Service业务层处理
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
@Service
|
||||
public class EmsFaultProtectionPlanServiceImpl implements IEmsFaultProtectionPlanService
|
||||
{
|
||||
@Autowired
|
||||
private EmsFaultProtectionPlanMapper emsFaultProtectionPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询故障告警保护方案
|
||||
*
|
||||
* @param id 故障告警保护方案主键
|
||||
* @return 故障告警保护方案
|
||||
*/
|
||||
@Override
|
||||
public EmsFaultProtectionPlan selectEmsFaultProtectionPlanById(Long id)
|
||||
{
|
||||
return emsFaultProtectionPlanMapper.selectEmsFaultProtectionPlanById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询故障告警保护方案列表
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 故障告警保护方案
|
||||
*/
|
||||
@Override
|
||||
public List<EmsFaultProtectionPlan> selectEmsFaultProtectionPlanList(EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
return emsFaultProtectionPlanMapper.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障告警保护方案
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsFaultProtectionPlan(EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
emsFaultProtectionPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return emsFaultProtectionPlanMapper.insertEmsFaultProtectionPlan(emsFaultProtectionPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障告警保护方案
|
||||
*
|
||||
* @param emsFaultProtectionPlan 故障告警保护方案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsFaultProtectionPlan(EmsFaultProtectionPlan emsFaultProtectionPlan)
|
||||
{
|
||||
emsFaultProtectionPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsFaultProtectionPlanMapper.updateEmsFaultProtectionPlan(emsFaultProtectionPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除故障告警保护方案
|
||||
*
|
||||
* @param ids 需要删除的故障告警保护方案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsFaultProtectionPlanByIds(Long[] ids)
|
||||
{
|
||||
return emsFaultProtectionPlanMapper.deleteEmsFaultProtectionPlanByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障告警保护方案信息
|
||||
*
|
||||
* @param id 故障告警保护方案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsFaultProtectionPlanById(Long id)
|
||||
{
|
||||
return emsFaultProtectionPlanMapper.deleteEmsFaultProtectionPlanById(id);
|
||||
}
|
||||
}
|
||||
@ -26,11 +26,12 @@
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deviceCategory" column="device_category" />
|
||||
<result property="runningStatus" column="running_status" />
|
||||
<result property="pictureUrl" column="picture_url" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsDevicesSettingVo">
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id, device_category, picture_url from ems_devices_setting
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id, parent_id, device_category, running_status, picture_url from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -56,6 +57,7 @@
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||
<if test="runningStatus != null and runningStatus != ''"> and running_status = #{runningStatus}</if>
|
||||
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -88,6 +90,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="deviceCategory != null">device_category,</if>
|
||||
<if test="runningStatus != null">running_status,</if>
|
||||
<if test="pictureUrl != null">picture_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -111,6 +114,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="deviceCategory != null">#{deviceCategory},</if>
|
||||
<if test="runningStatus != null">#{runningStatus},</if>
|
||||
<if test="pictureUrl != null">#{pictureUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -138,6 +142,7 @@
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="deviceCategory != null">device_category = #{deviceCategory},</if>
|
||||
<if test="runningStatus != null">running_status = #{runningStatus},</if>
|
||||
<if test="pictureUrl != null">picture_url = #{pictureUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
<?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.xzzn.ems.mapper.EmsFaultProtectionPlanMapper">
|
||||
|
||||
<resultMap type="EmsFaultProtectionPlan" id="EmsFaultProtectionPlanResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="faultName" column="fault_name" />
|
||||
<result property="faultLevel" column="fault_level" />
|
||||
<result property="protectionSettings" column="protection_settings" />
|
||||
<result property="faultDelaySeconds" column="fault_delay_seconds" />
|
||||
<result property="protectionPlan" column="protection_plan" />
|
||||
<result property="releaseDelaySeconds" column="release_delay_seconds" />
|
||||
<result property="description" column="description" />
|
||||
<result property="isAlert" column="is_alert" />
|
||||
<result property="status" column="status" />
|
||||
<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="selectEmsFaultProtectionPlanVo">
|
||||
select id, site_id, fault_name, fault_level, protection_settings, fault_delay_seconds, protection_plan, release_delay_seconds, description, is_alert, status, create_by, create_time, update_by, update_time from ems_fault_protection_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsFaultProtectionPlanList" parameterType="EmsFaultProtectionPlan" resultMap="EmsFaultProtectionPlanResult">
|
||||
<include refid="selectEmsFaultProtectionPlanVo"/>
|
||||
<where>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="faultName != null and faultName != ''"> and fault_name like concat('%', #{faultName}, '%')</if>
|
||||
<if test="faultLevel != null "> and fault_level = #{faultLevel}</if>
|
||||
<if test="protectionSettings != null and protectionSettings != ''"> and protection_settings = #{protectionSettings}</if>
|
||||
<if test="faultDelaySeconds != null "> and fault_delay_seconds = #{faultDelaySeconds}</if>
|
||||
<if test="protectionPlan != null and protectionPlan != ''"> and protection_plan = #{protectionPlan}</if>
|
||||
<if test="releaseDelaySeconds != null "> and release_delay_seconds = #{releaseDelaySeconds}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="isAlert != null "> and is_alert = #{isAlert}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsFaultProtectionPlanById" parameterType="Long" resultMap="EmsFaultProtectionPlanResult">
|
||||
<include refid="selectEmsFaultProtectionPlanVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsFaultProtectionPlan" parameterType="EmsFaultProtectionPlan" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_fault_protection_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="faultName != null and faultName != ''">fault_name,</if>
|
||||
<if test="faultLevel != null">fault_level,</if>
|
||||
<if test="protectionSettings != null">protection_settings,</if>
|
||||
<if test="faultDelaySeconds != null">fault_delay_seconds,</if>
|
||||
<if test="protectionPlan != null">protection_plan,</if>
|
||||
<if test="releaseDelaySeconds != null">release_delay_seconds,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="isAlert != null">is_alert,</if>
|
||||
<if test="status != null">status,</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="siteId != null">#{siteId},</if>
|
||||
<if test="faultName != null and faultName != ''">#{faultName},</if>
|
||||
<if test="faultLevel != null">#{faultLevel},</if>
|
||||
<if test="protectionSettings != null">#{protectionSettings},</if>
|
||||
<if test="faultDelaySeconds != null">#{faultDelaySeconds},</if>
|
||||
<if test="protectionPlan != null">#{protectionPlan},</if>
|
||||
<if test="releaseDelaySeconds != null">#{releaseDelaySeconds},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="isAlert != null">#{isAlert},</if>
|
||||
<if test="status != null">#{status},</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="updateEmsFaultProtectionPlan" parameterType="EmsFaultProtectionPlan">
|
||||
update ems_fault_protection_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="faultName != null and faultName != ''">fault_name = #{faultName},</if>
|
||||
<if test="faultLevel != null">fault_level = #{faultLevel},</if>
|
||||
<if test="protectionSettings != null">protection_settings = #{protectionSettings},</if>
|
||||
<if test="faultDelaySeconds != null">fault_delay_seconds = #{faultDelaySeconds},</if>
|
||||
<if test="protectionPlan != null">protection_plan = #{protectionPlan},</if>
|
||||
<if test="releaseDelaySeconds != null">release_delay_seconds = #{releaseDelaySeconds},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="isAlert != null">is_alert = #{isAlert},</if>
|
||||
<if test="status != null">status = #{status},</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 id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsFaultProtectionPlanById" parameterType="Long">
|
||||
delete from ems_fault_protection_plan where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsFaultProtectionPlanByIds" parameterType="String">
|
||||
delete from ems_fault_protection_plan where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -136,7 +136,7 @@
|
||||
<select id="getAllSiteDeviceList" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteDeviceListVo">
|
||||
select es.site_id as siteId,es.site_name as siteName,
|
||||
ed.device_id as deviceId,ed.device_name as deviceName,
|
||||
ed.device_type as deviceType,ed.communication_status as communicationStatus,
|
||||
ed.device_type as deviceType,ed.running_status as runningStatus,
|
||||
ed.device_category as deviceCategory,
|
||||
ed.picture_url as pictureUrl,
|
||||
ed.id,
|
||||
|
||||
Reference in New Issue
Block a user