change - 添加设备报警记录
parent
84944acb80
commit
c9e27123dd
@ -0,0 +1,101 @@
|
|||||||
|
package com.aucma.report.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.aucma.common.utils.DateUtils;
|
||||||
|
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.aucma.common.annotation.Log;
|
||||||
|
import com.aucma.common.core.controller.BaseController;
|
||||||
|
import com.aucma.common.core.domain.AjaxResult;
|
||||||
|
import com.aucma.common.enums.BusinessType;
|
||||||
|
import com.aucma.report.domain.DeviceAlarmRecord;
|
||||||
|
import com.aucma.report.service.IDeviceAlarmRecordService;
|
||||||
|
import com.aucma.common.utils.poi.ExcelUtil;
|
||||||
|
import com.aucma.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备报警记录Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-03-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/report/deviceAlarmRecord")
|
||||||
|
public class DeviceAlarmRecordController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IDeviceAlarmRecordService deviceAlarmRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:deviceAlarmRecord:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(DeviceAlarmRecord deviceAlarmRecord) {
|
||||||
|
startPage();
|
||||||
|
List<DeviceAlarmRecord> list = deviceAlarmRecordService.selectDeviceAlarmRecordList(deviceAlarmRecord);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备报警记录列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:deviceAlarmRecord:export')")
|
||||||
|
@Log(title = "设备报警记录", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, DeviceAlarmRecord deviceAlarmRecord) {
|
||||||
|
List<DeviceAlarmRecord> list = deviceAlarmRecordService.selectDeviceAlarmRecordList(deviceAlarmRecord);
|
||||||
|
ExcelUtil<DeviceAlarmRecord> util = new ExcelUtil<DeviceAlarmRecord>(DeviceAlarmRecord.class);
|
||||||
|
util.exportExcel(response, list, "设备报警记录数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备报警记录详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:deviceAlarmRecord:query')")
|
||||||
|
@GetMapping(value = "/{objId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||||
|
return success(deviceAlarmRecordService.selectDeviceAlarmRecordByObjId(objId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备报警记录
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:deviceAlarmRecord:add')")
|
||||||
|
@Log(title = "设备报警记录", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody DeviceAlarmRecord deviceAlarmRecord) {
|
||||||
|
deviceAlarmRecord.setCreatedBy(getUsername());
|
||||||
|
deviceAlarmRecord.setCreatedTime(DateUtils.getNowDate());
|
||||||
|
return toAjax(deviceAlarmRecordService.insertDeviceAlarmRecord(deviceAlarmRecord));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备报警记录
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:deviceAlarmRecord:edit')")
|
||||||
|
@Log(title = "设备报警记录", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody DeviceAlarmRecord deviceAlarmRecord) {
|
||||||
|
return toAjax(deviceAlarmRecordService.updateDeviceAlarmRecord(deviceAlarmRecord));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备报警记录
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:deviceAlarmRecord:remove')")
|
||||||
|
@Log(title = "设备报警记录", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{objIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||||
|
return toAjax(deviceAlarmRecordService.deleteDeviceAlarmRecordByObjIds(objIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
package com.aucma.report.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.aucma.common.annotation.Excel;
|
||||||
|
import com.aucma.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备报警记录对象 device_alarm_record
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-03-26
|
||||||
|
*/
|
||||||
|
public class DeviceAlarmRecord extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
private Long objId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "设备编号")
|
||||||
|
private String deviceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "设备名称")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "设备类型")
|
||||||
|
private String deviceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警信息
|
||||||
|
*/
|
||||||
|
@Excel(name = "报警信息")
|
||||||
|
private String alarmInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "报警时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date alarmTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标识
|
||||||
|
*/
|
||||||
|
@Excel(name = "标识")
|
||||||
|
private Long isFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createdTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次标识
|
||||||
|
*/
|
||||||
|
@Excel(name = "批次标识")
|
||||||
|
private String batchId;
|
||||||
|
|
||||||
|
public void setObjId(Long objId) {
|
||||||
|
this.objId = objId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjId() {
|
||||||
|
return objId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceCode(String deviceCode) {
|
||||||
|
this.deviceCode = deviceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceCode() {
|
||||||
|
return deviceCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceName(String deviceName) {
|
||||||
|
this.deviceName = deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceName() {
|
||||||
|
return deviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceType(String deviceType) {
|
||||||
|
this.deviceType = deviceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceType() {
|
||||||
|
return deviceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmInfo(String alarmInfo) {
|
||||||
|
this.alarmInfo = alarmInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlarmInfo() {
|
||||||
|
return alarmInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmTime(Date alarmTime) {
|
||||||
|
this.alarmTime = alarmTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAlarmTime() {
|
||||||
|
return alarmTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsFlag(Long isFlag) {
|
||||||
|
this.isFlag = isFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIsFlag() {
|
||||||
|
return isFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedTime(Date createdTime) {
|
||||||
|
this.createdTime = createdTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreatedTime() {
|
||||||
|
return createdTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatchId(String batchId) {
|
||||||
|
this.batchId = batchId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBatchId() {
|
||||||
|
return batchId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objId", getObjId())
|
||||||
|
.append("deviceCode", getDeviceCode())
|
||||||
|
.append("deviceName", getDeviceName())
|
||||||
|
.append("deviceType", getDeviceType())
|
||||||
|
.append("alarmInfo", getAlarmInfo())
|
||||||
|
.append("alarmTime", getAlarmTime())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("isFlag", getIsFlag())
|
||||||
|
.append("createdBy", getCreatedBy())
|
||||||
|
.append("createdTime", getCreatedTime())
|
||||||
|
.append("batchId", getBatchId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.aucma.report.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.aucma.report.domain.DeviceAlarmRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备报警记录Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-03-26
|
||||||
|
*/
|
||||||
|
public interface DeviceAlarmRecordMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录
|
||||||
|
*
|
||||||
|
* @param objId 设备报警记录主键
|
||||||
|
* @return 设备报警记录
|
||||||
|
*/
|
||||||
|
public DeviceAlarmRecord selectDeviceAlarmRecordByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录列表
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 设备报警记录集合
|
||||||
|
*/
|
||||||
|
public List<DeviceAlarmRecord> selectDeviceAlarmRecordList(DeviceAlarmRecord deviceAlarmRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备报警记录
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceAlarmRecord(DeviceAlarmRecord deviceAlarmRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备报警记录
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceAlarmRecord(DeviceAlarmRecord deviceAlarmRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备报警记录
|
||||||
|
*
|
||||||
|
* @param objId 设备报警记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceAlarmRecordByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备报警记录
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceAlarmRecordByObjIds(Long[] objIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.aucma.report.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.aucma.report.domain.DeviceAlarmRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备报警记录Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-03-26
|
||||||
|
*/
|
||||||
|
public interface IDeviceAlarmRecordService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录
|
||||||
|
*
|
||||||
|
* @param objId 设备报警记录主键
|
||||||
|
* @return 设备报警记录
|
||||||
|
*/
|
||||||
|
public DeviceAlarmRecord selectDeviceAlarmRecordByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录列表
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 设备报警记录集合
|
||||||
|
*/
|
||||||
|
public List<DeviceAlarmRecord> selectDeviceAlarmRecordList(DeviceAlarmRecord deviceAlarmRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备报警记录
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceAlarmRecord(DeviceAlarmRecord deviceAlarmRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备报警记录
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceAlarmRecord(DeviceAlarmRecord deviceAlarmRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备报警记录
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的设备报警记录主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceAlarmRecordByObjIds(Long[] objIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备报警记录信息
|
||||||
|
*
|
||||||
|
* @param objId 设备报警记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceAlarmRecordByObjId(Long objId);
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.aucma.report.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.aucma.report.mapper.DeviceAlarmRecordMapper;
|
||||||
|
import com.aucma.report.domain.DeviceAlarmRecord;
|
||||||
|
import com.aucma.report.service.IDeviceAlarmRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备报警记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-03-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceAlarmRecordServiceImpl implements IDeviceAlarmRecordService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private DeviceAlarmRecordMapper deviceAlarmRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录
|
||||||
|
*
|
||||||
|
* @param objId 设备报警记录主键
|
||||||
|
* @return 设备报警记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DeviceAlarmRecord selectDeviceAlarmRecordByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return deviceAlarmRecordMapper.selectDeviceAlarmRecordByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备报警记录列表
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 设备报警记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DeviceAlarmRecord> selectDeviceAlarmRecordList(DeviceAlarmRecord deviceAlarmRecord)
|
||||||
|
{
|
||||||
|
return deviceAlarmRecordMapper.selectDeviceAlarmRecordList(deviceAlarmRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备报警记录
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDeviceAlarmRecord(DeviceAlarmRecord deviceAlarmRecord)
|
||||||
|
{
|
||||||
|
return deviceAlarmRecordMapper.insertDeviceAlarmRecord(deviceAlarmRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备报警记录
|
||||||
|
*
|
||||||
|
* @param deviceAlarmRecord 设备报警记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDeviceAlarmRecord(DeviceAlarmRecord deviceAlarmRecord)
|
||||||
|
{
|
||||||
|
return deviceAlarmRecordMapper.updateDeviceAlarmRecord(deviceAlarmRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备报警记录
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的设备报警记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceAlarmRecordByObjIds(Long[] objIds)
|
||||||
|
{
|
||||||
|
return deviceAlarmRecordMapper.deleteDeviceAlarmRecordByObjIds(objIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备报警记录信息
|
||||||
|
*
|
||||||
|
* @param objId 设备报警记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceAlarmRecordByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return deviceAlarmRecordMapper.deleteDeviceAlarmRecordByObjId(objId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
<?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.aucma.report.mapper.DeviceAlarmRecordMapper">
|
||||||
|
|
||||||
|
<resultMap type="DeviceAlarmRecord" id="DeviceAlarmRecordResult">
|
||||||
|
<result property="objId" column="obj_id"/>
|
||||||
|
<result property="deviceCode" column="device_code"/>
|
||||||
|
<result property="deviceName" column="device_name"/>
|
||||||
|
<result property="deviceType" column="device_type"/>
|
||||||
|
<result property="alarmInfo" column="alarm_info"/>
|
||||||
|
<result property="alarmTime" column="alarm_time"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="isFlag" column="is_flag"/>
|
||||||
|
<result property="createdBy" column="created_by"/>
|
||||||
|
<result property="createdTime" column="created_time"/>
|
||||||
|
<result property="batchId" column="batch_id"/>
|
||||||
|
<result property="paramCode" column="param_code"/>
|
||||||
|
<result property="paramValue" column="param_value"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDeviceAlarmRecordVo">
|
||||||
|
select obj_id,
|
||||||
|
device_code,
|
||||||
|
device_name,
|
||||||
|
device_type,
|
||||||
|
alarm_info,
|
||||||
|
alarm_time,
|
||||||
|
remark,
|
||||||
|
is_flag,
|
||||||
|
created_by,
|
||||||
|
created_time,
|
||||||
|
batch_id,
|
||||||
|
param_code,
|
||||||
|
param_value
|
||||||
|
from record_alarm_device
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDeviceAlarmRecordList" parameterType="DeviceAlarmRecord" resultMap="DeviceAlarmRecordResult">
|
||||||
|
<include refid="selectDeviceAlarmRecordVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
|
||||||
|
<if test="deviceName != null and deviceName != ''">and device_name like concat(concat('%', #{deviceName}),
|
||||||
|
'%')
|
||||||
|
</if>
|
||||||
|
<if test="deviceType != null and deviceType != ''">and device_type = #{deviceType}</if>
|
||||||
|
<if test="alarmInfo != null and alarmInfo != ''">and alarm_info = #{alarmInfo}</if>
|
||||||
|
<if test="params.beginAlarmTime != null and params.beginAlarmTime != '' and params.endAlarmTime != null and params.endAlarmTime != ''">
|
||||||
|
and alarm_time between to_date(#{params.beginAlarmTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
||||||
|
to_date(#{params.endAlarmTime}, 'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
</if>
|
||||||
|
<if test="isFlag != null ">and is_flag = #{isFlag}</if>
|
||||||
|
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
|
||||||
|
<if test="createdTime != null ">and created_time = #{createdTime}</if>
|
||||||
|
<if test="batchId != null and batchId != ''">and batch_id = #{batchId}</if>
|
||||||
|
<if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if>
|
||||||
|
<if test="paramValue != null and paramValue != ''"> and param_value = #{paramValue}</if>
|
||||||
|
</where>
|
||||||
|
order by alarm_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDeviceAlarmRecordByObjId" parameterType="Long" resultMap="DeviceAlarmRecordResult">
|
||||||
|
<include refid="selectDeviceAlarmRecordVo"/>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDeviceAlarmRecord" parameterType="DeviceAlarmRecord">
|
||||||
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||||
|
SELECT seq_device_alarm_record.NEXTVAL as objId FROM DUAL
|
||||||
|
</selectKey>
|
||||||
|
insert into RECORD_ALARM_DEVICE
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="objId != null">obj_id,</if>
|
||||||
|
<if test="deviceCode != null">device_code,</if>
|
||||||
|
<if test="deviceName != null">device_name,</if>
|
||||||
|
<if test="deviceType != null">device_type,</if>
|
||||||
|
<if test="alarmInfo != null">alarm_info,</if>
|
||||||
|
<if test="alarmTime != null">alarm_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="isFlag != null">is_flag,</if>
|
||||||
|
<if test="createdBy != null">created_by,</if>
|
||||||
|
<if test="createdTime != null">created_time,</if>
|
||||||
|
<if test="batchId != null">batch_id,</if>
|
||||||
|
<if test="paramCode != null">param_code,</if>
|
||||||
|
<if test="paramValue != null">param_value,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="objId != null">#{objId},</if>
|
||||||
|
<if test="deviceCode != null">#{deviceCode},</if>
|
||||||
|
<if test="deviceName != null">#{deviceName},</if>
|
||||||
|
<if test="deviceType != null">#{deviceType},</if>
|
||||||
|
<if test="alarmInfo != null">#{alarmInfo},</if>
|
||||||
|
<if test="alarmTime != null">#{alarmTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="isFlag != null">#{isFlag},</if>
|
||||||
|
<if test="createdBy != null">#{createdBy},</if>
|
||||||
|
<if test="createdTime != null">#{createdTime},</if>
|
||||||
|
<if test="batchId != null">#{batchId},</if>
|
||||||
|
<if test="paramCode != null">#{paramCode},</if>
|
||||||
|
<if test="paramValue != null">#{paramValue},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDeviceAlarmRecord" parameterType="DeviceAlarmRecord">
|
||||||
|
update RECORD_ALARM_DEVICE
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
||||||
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||||
|
<if test="deviceType != null">device_type = #{deviceType},</if>
|
||||||
|
<if test="alarmInfo != null">alarm_info = #{alarmInfo},</if>
|
||||||
|
<if test="alarmTime != null">alarm_time = #{alarmTime},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||||
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||||
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||||
|
<if test="batchId != null">batch_id = #{batchId},</if>
|
||||||
|
<if test="paramCode != null">param_code = #{paramCode},</if>
|
||||||
|
<if test="paramValue != null">param_value = #{paramValue},</if>
|
||||||
|
</trim>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceAlarmRecordByObjId" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from RECORD_ALARM_DEVICE
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceAlarmRecordByObjIds" parameterType="String">
|
||||||
|
delete from RECORD_ALARM_DEVICE where obj_id in
|
||||||
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue