add(ems): 添加报警规则措施步骤及图片相关功能
- 新增 EmsAlarmActionStep 和 EmsAlarmActionStepImage 模型类 - 实现报警规则措施步骤的 CRUD 操作 - 添加措施步骤图片的 CRUD 操作 - 开发批量保存措施步骤的功能,包括删除现有步骤和图片并保存新的步骤和图片 - 提供根据报警规则 ID 和报警数据信息查询措施步骤列表的接口boardTest
parent
5fe810b279
commit
3ced9d3f2a
@ -0,0 +1,106 @@
|
||||
package com.os.ems.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.ems.base.domain.EmsAlarmActionStepImage;
|
||||
import com.os.ems.base.service.IEmsAlarmActionStepImageService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 报警措施步骤图片Controller
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/base/emsAlarmActionStepImage")
|
||||
public class EmsAlarmActionStepImageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsAlarmActionStepImageService emsAlarmActionStepImageService;
|
||||
|
||||
/**
|
||||
* 查询报警措施步骤图片列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/base:emsAlarmActionStepImage:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
startPage();
|
||||
List<EmsAlarmActionStepImage> list = emsAlarmActionStepImageService.selectEmsAlarmActionStepImageList(emsAlarmActionStepImage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报警措施步骤图片列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/base:emsAlarmActionStepImage:export')")
|
||||
@Log(title = "报警措施步骤图片", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
List<EmsAlarmActionStepImage> list = emsAlarmActionStepImageService.selectEmsAlarmActionStepImageList(emsAlarmActionStepImage);
|
||||
ExcelUtil<EmsAlarmActionStepImage> util = new ExcelUtil<EmsAlarmActionStepImage>(EmsAlarmActionStepImage.class);
|
||||
util.exportExcel(response, list, "报警措施步骤图片数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报警措施步骤图片详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/base:emsAlarmActionStepImage:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") String objId)
|
||||
{
|
||||
return success(emsAlarmActionStepImageService.selectEmsAlarmActionStepImageByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警措施步骤图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/base:emsAlarmActionStepImage:add')")
|
||||
@Log(title = "报警措施步骤图片", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
emsAlarmActionStepImage.setCreateBy(getUsername());
|
||||
return toAjax(emsAlarmActionStepImageService.insertEmsAlarmActionStepImage(emsAlarmActionStepImage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警措施步骤图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/base:emsAlarmActionStepImage:edit')")
|
||||
@Log(title = "报警措施步骤图片", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
emsAlarmActionStepImage.setUpdateBy(getUsername());
|
||||
return toAjax(emsAlarmActionStepImageService.updateEmsAlarmActionStepImage(emsAlarmActionStepImage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警措施步骤图片
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/base:emsAlarmActionStepImage:remove')")
|
||||
@Log(title = "报警措施步骤图片", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable String[] objIds)
|
||||
{
|
||||
return toAjax(emsAlarmActionStepImageService.deleteEmsAlarmActionStepImageByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.os.ems.base.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.os.common.annotation.Excel;
|
||||
import com.os.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 报警规则措施步骤图片对象 ems_alarm_action_step_image
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public class EmsAlarmActionStepImage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private String objId;
|
||||
|
||||
/** 关联的措施步骤ID */
|
||||
@Excel(name = "关联的措施步骤ID")
|
||||
private String actionStepObjId;
|
||||
|
||||
/** 图片URL */
|
||||
@Excel(name = "图片URL")
|
||||
private String imageUrl;
|
||||
|
||||
/** 图片顺序 */
|
||||
@Excel(name = "图片顺序")
|
||||
private Long imageSequence;
|
||||
|
||||
/** 图片描述 */
|
||||
@Excel(name = "图片描述")
|
||||
private String description;
|
||||
|
||||
public void setObjId(String objId)
|
||||
{
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public String getObjId()
|
||||
{
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setActionStepObjId(String actionStepObjId)
|
||||
{
|
||||
this.actionStepObjId = actionStepObjId;
|
||||
}
|
||||
|
||||
public String getActionStepObjId()
|
||||
{
|
||||
return actionStepObjId;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl)
|
||||
{
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl()
|
||||
{
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageSequence(Long imageSequence)
|
||||
{
|
||||
this.imageSequence = imageSequence;
|
||||
}
|
||||
|
||||
public Long getImageSequence()
|
||||
{
|
||||
return imageSequence;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId", getObjId())
|
||||
.append("actionStepObjId", getActionStepObjId())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.append("imageSequence", getImageSequence())
|
||||
.append("description", getDescription())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.ems.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.ems.base.domain.EmsAlarmActionStepImage;
|
||||
|
||||
/**
|
||||
* 报警措施步骤图片Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface EmsAlarmActionStepImageMapper
|
||||
{
|
||||
/**
|
||||
* 查询报警措施步骤图片
|
||||
*
|
||||
* @param objId 报警措施步骤图片主键
|
||||
* @return 报警措施步骤图片
|
||||
*/
|
||||
public EmsAlarmActionStepImage selectEmsAlarmActionStepImageByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 查询报警措施步骤图片列表
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 报警措施步骤图片集合
|
||||
*/
|
||||
public List<EmsAlarmActionStepImage> selectEmsAlarmActionStepImageList(EmsAlarmActionStepImage emsAlarmActionStepImage);
|
||||
|
||||
/**
|
||||
* 新增报警措施步骤图片
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsAlarmActionStepImage(EmsAlarmActionStepImage emsAlarmActionStepImage);
|
||||
|
||||
/**
|
||||
* 修改报警措施步骤图片
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsAlarmActionStepImage(EmsAlarmActionStepImage emsAlarmActionStepImage);
|
||||
|
||||
/**
|
||||
* 删除报警措施步骤图片
|
||||
*
|
||||
* @param objId 报警措施步骤图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAlarmActionStepImageByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 批量删除报警措施步骤图片
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAlarmActionStepImageByObjIds(String[] objIds);
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.os.ems.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.ems.base.domain.EmsAlarmActionStep;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 报警规则具体措施步骤Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface EmsAlarmActionStepMapper
|
||||
{
|
||||
/**
|
||||
* 查询报警规则具体措施步骤
|
||||
*
|
||||
* @param objId 报警规则具体措施步骤主键
|
||||
* @return 报警规则具体措施步骤
|
||||
*/
|
||||
public EmsAlarmActionStep selectEmsAlarmActionStepByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 查询报警规则具体措施步骤列表
|
||||
*
|
||||
* @param emsAlarmActionStep 报警规则具体措施步骤
|
||||
* @return 报警规则具体措施步骤集合
|
||||
*/
|
||||
public List<EmsAlarmActionStep> selectEmsAlarmActionStepList(EmsAlarmActionStep emsAlarmActionStep);
|
||||
|
||||
/**
|
||||
* 新增报警规则具体措施步骤
|
||||
*
|
||||
* @param emsAlarmActionStep 报警规则具体措施步骤
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsAlarmActionStep(EmsAlarmActionStep emsAlarmActionStep);
|
||||
|
||||
/**
|
||||
* 修改报警规则具体措施步骤
|
||||
*
|
||||
* @param emsAlarmActionStep 报警规则具体措施步骤
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsAlarmActionStep(EmsAlarmActionStep emsAlarmActionStep);
|
||||
|
||||
/**
|
||||
* 删除报警规则具体措施步骤
|
||||
*
|
||||
* @param objId 报警规则具体措施步骤主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAlarmActionStepByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 批量删除报警规则具体措施步骤
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAlarmActionStepByObjIds(String[] objIds);
|
||||
|
||||
/**
|
||||
* 根据报警规则ID查询措施步骤列表
|
||||
*
|
||||
* @param ruleObjId 报警规则ID
|
||||
* @return 措施步骤列表
|
||||
*/
|
||||
public List<EmsAlarmActionStep> selectEmsAlarmActionStepByRuleObjId(String ruleObjId);
|
||||
|
||||
/**
|
||||
* 根据报警数据信息查询对应的措施步骤列表
|
||||
*
|
||||
* @param monitorId 设备编号
|
||||
* @param cause 异常原因
|
||||
* @return 措施步骤列表
|
||||
*/
|
||||
public List<EmsAlarmActionStep> selectActionStepsByAlarmInfo(@Param("monitorId") String monitorId, @Param("cause") String cause);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.ems.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.ems.base.domain.EmsAlarmActionStepImage;
|
||||
|
||||
/**
|
||||
* 报警措施步骤图片Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface IEmsAlarmActionStepImageService
|
||||
{
|
||||
/**
|
||||
* 查询报警措施步骤图片
|
||||
*
|
||||
* @param objId 报警措施步骤图片主键
|
||||
* @return 报警措施步骤图片
|
||||
*/
|
||||
public EmsAlarmActionStepImage selectEmsAlarmActionStepImageByObjId(String objId);
|
||||
|
||||
/**
|
||||
* 查询报警措施步骤图片列表
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 报警措施步骤图片集合
|
||||
*/
|
||||
public List<EmsAlarmActionStepImage> selectEmsAlarmActionStepImageList(EmsAlarmActionStepImage emsAlarmActionStepImage);
|
||||
|
||||
/**
|
||||
* 新增报警措施步骤图片
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsAlarmActionStepImage(EmsAlarmActionStepImage emsAlarmActionStepImage);
|
||||
|
||||
/**
|
||||
* 修改报警措施步骤图片
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsAlarmActionStepImage(EmsAlarmActionStepImage emsAlarmActionStepImage);
|
||||
|
||||
/**
|
||||
* 批量删除报警措施步骤图片
|
||||
*
|
||||
* @param objIds 需要删除的报警措施步骤图片主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAlarmActionStepImageByObjIds(String[] objIds);
|
||||
|
||||
/**
|
||||
* 删除报警措施步骤图片信息
|
||||
*
|
||||
* @param objId 报警措施步骤图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsAlarmActionStepImageByObjId(String objId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.os.ems.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.ems.base.mapper.EmsAlarmActionStepImageMapper;
|
||||
import com.os.ems.base.domain.EmsAlarmActionStepImage;
|
||||
import com.os.ems.base.service.IEmsAlarmActionStepImageService;
|
||||
|
||||
/**
|
||||
* 报警措施步骤图片Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@Service
|
||||
public class EmsAlarmActionStepImageServiceImpl implements IEmsAlarmActionStepImageService
|
||||
{
|
||||
@Autowired
|
||||
private EmsAlarmActionStepImageMapper emsAlarmActionStepImageMapper;
|
||||
|
||||
/**
|
||||
* 查询报警措施步骤图片
|
||||
*
|
||||
* @param objId 报警措施步骤图片主键
|
||||
* @return 报警措施步骤图片
|
||||
*/
|
||||
@Override
|
||||
public EmsAlarmActionStepImage selectEmsAlarmActionStepImageByObjId(String objId)
|
||||
{
|
||||
return emsAlarmActionStepImageMapper.selectEmsAlarmActionStepImageByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报警措施步骤图片列表
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 报警措施步骤图片
|
||||
*/
|
||||
@Override
|
||||
public List<EmsAlarmActionStepImage> selectEmsAlarmActionStepImageList(EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
return emsAlarmActionStepImageMapper.selectEmsAlarmActionStepImageList(emsAlarmActionStepImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警措施步骤图片
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsAlarmActionStepImage(EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
emsAlarmActionStepImage.setCreateTime(DateUtils.getNowDate());
|
||||
return emsAlarmActionStepImageMapper.insertEmsAlarmActionStepImage(emsAlarmActionStepImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警措施步骤图片
|
||||
*
|
||||
* @param emsAlarmActionStepImage 报警措施步骤图片
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsAlarmActionStepImage(EmsAlarmActionStepImage emsAlarmActionStepImage)
|
||||
{
|
||||
emsAlarmActionStepImage.setUpdateTime(DateUtils.getNowDate());
|
||||
return emsAlarmActionStepImageMapper.updateEmsAlarmActionStepImage(emsAlarmActionStepImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除报警措施步骤图片
|
||||
*
|
||||
* @param objIds 需要删除的报警措施步骤图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsAlarmActionStepImageByObjIds(String[] objIds)
|
||||
{
|
||||
return emsAlarmActionStepImageMapper.deleteEmsAlarmActionStepImageByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警措施步骤图片信息
|
||||
*
|
||||
* @param objId 报警措施步骤图片主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsAlarmActionStepImageByObjId(String objId)
|
||||
{
|
||||
return emsAlarmActionStepImageMapper.deleteEmsAlarmActionStepImageByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
<?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.os.ems.base.mapper.EmsAlarmActionStepImageMapper">
|
||||
|
||||
<resultMap type="EmsAlarmActionStepImage" id="EmsAlarmActionStepImageResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="actionStepObjId" column="action_step_obj_id" />
|
||||
<result property="imageUrl" column="image_url" />
|
||||
<result property="imageSequence" column="image_sequence" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsAlarmActionStepImageVo">
|
||||
select obj_id, action_step_obj_id, image_url, image_sequence, description, create_by, create_time, update_by, update_time, remark from ems_alarm_action_step_image
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsAlarmActionStepImageList" parameterType="EmsAlarmActionStepImage" resultMap="EmsAlarmActionStepImageResult">
|
||||
<include refid="selectEmsAlarmActionStepImageVo"/>
|
||||
<where>
|
||||
<if test="actionStepObjId != null and actionStepObjId != ''"> and action_step_obj_id = #{actionStepObjId}</if>
|
||||
<if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if>
|
||||
<if test="imageSequence != null "> and image_sequence = #{imageSequence}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsAlarmActionStepImageByObjId" parameterType="String" resultMap="EmsAlarmActionStepImageResult">
|
||||
<include refid="selectEmsAlarmActionStepImageVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsAlarmActionStepImage" parameterType="EmsAlarmActionStepImage" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into ems_alarm_action_step_image
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="actionStepObjId != null and actionStepObjId != ''">action_step_obj_id,</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">image_url,</if>
|
||||
<if test="imageSequence != null">image_sequence,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="actionStepObjId != null and actionStepObjId != ''">#{actionStepObjId},</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">#{imageUrl},</if>
|
||||
<if test="imageSequence != null">#{imageSequence},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsAlarmActionStepImage" parameterType="EmsAlarmActionStepImage">
|
||||
update ems_alarm_action_step_image
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="actionStepObjId != null and actionStepObjId != ''">action_step_obj_id = #{actionStepObjId},</if>
|
||||
<if test="imageUrl != null and imageUrl != ''">image_url = #{imageUrl},</if>
|
||||
<if test="imageSequence != null">image_sequence = #{imageSequence},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsAlarmActionStepImageByObjId" parameterType="String">
|
||||
delete from ems_alarm_action_step_image where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsAlarmActionStepImageByObjIds" parameterType="String">
|
||||
delete from ems_alarm_action_step_image where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,153 @@
|
||||
<?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.os.ems.base.mapper.EmsAlarmActionStepMapper">
|
||||
|
||||
<resultMap type="EmsAlarmActionStep" id="EmsAlarmActionStepResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="ruleObjId" column="rule_obj_id" />
|
||||
<result property="stepSequence" column="step_sequence" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="EmsAlarmActionStep" id="EmsAlarmActionStepWithImagesResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="ruleObjId" column="rule_obj_id" />
|
||||
<result property="stepSequence" column="step_sequence" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<collection property="stepImages" ofType="EmsAlarmActionStepImage">
|
||||
<result property="objId" column="img_obj_id" />
|
||||
<result property="actionStepObjId" column="img_action_step_obj_id" />
|
||||
<result property="imageUrl" column="img_image_url" />
|
||||
<result property="imageSequence" column="img_image_sequence" />
|
||||
<result property="description" column="img_description" />
|
||||
<result property="remark" column="img_remark" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsAlarmActionStepVo">
|
||||
select obj_id, rule_obj_id, step_sequence, description, create_by, create_time, update_by, update_time, remark from ems_alarm_action_step
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsAlarmActionStepList" parameterType="EmsAlarmActionStep" resultMap="EmsAlarmActionStepResult">
|
||||
<include refid="selectEmsAlarmActionStepVo"/>
|
||||
<where>
|
||||
<if test="ruleObjId != null and ruleObjId != ''"> and rule_obj_id = #{ruleObjId}</if>
|
||||
<if test="stepSequence != null "> and step_sequence = #{stepSequence}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsAlarmActionStepByObjId" parameterType="String" resultMap="EmsAlarmActionStepResult">
|
||||
<include refid="selectEmsAlarmActionStepVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmsAlarmActionStepByRuleObjId" parameterType="String" resultMap="EmsAlarmActionStepWithImagesResult">
|
||||
SELECT
|
||||
step.obj_id,
|
||||
step.rule_obj_id,
|
||||
step.step_sequence,
|
||||
step.description,
|
||||
step.create_by,
|
||||
step.create_time,
|
||||
step.update_by,
|
||||
step.update_time,
|
||||
step.remark,
|
||||
img.obj_id as img_obj_id,
|
||||
img.action_step_obj_id as img_action_step_obj_id,
|
||||
img.image_url as img_image_url,
|
||||
img.image_sequence as img_image_sequence,
|
||||
img.description as img_description,
|
||||
img.remark as img_remark
|
||||
FROM ems_alarm_action_step step
|
||||
LEFT JOIN ems_alarm_action_step_image img ON step.obj_id = img.action_step_obj_id
|
||||
WHERE step.rule_obj_id = #{ruleObjId}
|
||||
ORDER BY step.step_sequence ASC, img.image_sequence ASC
|
||||
</select>
|
||||
|
||||
<select id="selectActionStepsByAlarmInfo" resultMap="EmsAlarmActionStepWithImagesResult">
|
||||
SELECT
|
||||
step.obj_id,
|
||||
step.rule_obj_id,
|
||||
step.step_sequence,
|
||||
step.description,
|
||||
step.create_by,
|
||||
step.create_time,
|
||||
step.update_by,
|
||||
step.update_time,
|
||||
step.remark,
|
||||
img.obj_id as img_obj_id,
|
||||
img.action_step_obj_id as img_action_step_obj_id,
|
||||
img.image_url as img_image_url,
|
||||
img.image_sequence as img_image_sequence,
|
||||
img.description as img_description,
|
||||
img.remark as img_remark
|
||||
FROM ems_alarm_action_step step
|
||||
LEFT JOIN ems_alarm_action_step_image img ON step.obj_id = img.action_step_obj_id
|
||||
INNER JOIN ems_record_alarm_rule rule ON step.rule_obj_id = rule.obj_id
|
||||
WHERE rule.monitor_id = #{monitorId} AND rule.cause = #{cause}
|
||||
ORDER BY step.step_sequence ASC, img.image_sequence ASC
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsAlarmActionStep" parameterType="EmsAlarmActionStep" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into ems_alarm_action_step
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleObjId != null and ruleObjId != ''">rule_obj_id,</if>
|
||||
<if test="stepSequence != null">step_sequence,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleObjId != null and ruleObjId != ''">#{ruleObjId},</if>
|
||||
<if test="stepSequence != null">#{stepSequence},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsAlarmActionStep" parameterType="EmsAlarmActionStep">
|
||||
update ems_alarm_action_step
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ruleObjId != null and ruleObjId != ''">rule_obj_id = #{ruleObjId},</if>
|
||||
<if test="stepSequence != null">step_sequence = #{stepSequence},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsAlarmActionStepByObjId" parameterType="String">
|
||||
delete from ems_alarm_action_step where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsAlarmActionStepByObjIds" parameterType="String">
|
||||
delete from ems_alarm_action_step where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue