工单管理优化
This commit is contained in:
@ -1,7 +1,10 @@
|
|||||||
package com.xzzn.web.controller.ems;
|
package com.xzzn.web.controller.ems;
|
||||||
|
|
||||||
import com.xzzn.common.core.controller.BaseController;
|
import com.xzzn.common.core.controller.BaseController;
|
||||||
|
import com.xzzn.common.core.domain.AjaxResult;
|
||||||
import com.xzzn.common.core.page.TableDataInfo;
|
import com.xzzn.common.core.page.TableDataInfo;
|
||||||
|
import com.xzzn.common.utils.StringUtils;
|
||||||
|
import com.xzzn.ems.domain.EmsAlarmRecords;
|
||||||
import com.xzzn.ems.domain.vo.AlarmRecordListRequestVo;
|
import com.xzzn.ems.domain.vo.AlarmRecordListRequestVo;
|
||||||
import com.xzzn.ems.domain.vo.AlarmRecordListResponseVo;
|
import com.xzzn.ems.domain.vo.AlarmRecordListResponseVo;
|
||||||
import com.xzzn.ems.service.IEmsAlarmRecordsService;
|
import com.xzzn.ems.service.IEmsAlarmRecordsService;
|
||||||
@ -34,4 +37,22 @@ public class EmsAlarmRecordsController extends BaseController
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成工单
|
||||||
|
*/
|
||||||
|
@PostMapping("/createTicketNo")
|
||||||
|
public AjaxResult createTicketNo(@RequestBody EmsAlarmRecords emsAlarmRecords)
|
||||||
|
{
|
||||||
|
Long id = emsAlarmRecords.getId();
|
||||||
|
if (id == null) {
|
||||||
|
return error("告警id不能为空");
|
||||||
|
}
|
||||||
|
String ticketNo= iEmsAlarmRecordsService.createTicketNo(id,getUserId());
|
||||||
|
if (StringUtils.isNotEmpty(ticketNo) && ticketNo.contains("T")) {
|
||||||
|
return AjaxResult.success("操作成功", ticketNo);
|
||||||
|
} else {
|
||||||
|
return error(ticketNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,4 +102,15 @@ public class EmsTicketController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(emsTicketService.deleteEmsTicketByIds(ids));
|
return toAjax(emsTicketService.deleteEmsTicketByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 废弃工单
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ticket:delete')")
|
||||||
|
@Log(title = "工单主", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/drop")
|
||||||
|
public AjaxResult drop(@RequestBody EmsTicket emsTicket)
|
||||||
|
{
|
||||||
|
return toAjax(emsTicketService.dropEmsTicketById(emsTicket.getId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,10 @@ public class EmsAlarmRecords extends BaseEntity
|
|||||||
@Excel(name = "设备名称,用于标识设备")
|
@Excel(name = "设备名称,用于标识设备")
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
|
|
||||||
|
/** 工单号(规则:T+日期+6位随机) */
|
||||||
|
@Excel(name = "工单号", readConverterExp = "规=则:T+日期+6位随机")
|
||||||
|
private String ticketNo;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -158,6 +162,14 @@ public class EmsAlarmRecords extends BaseEntity
|
|||||||
return deviceName;
|
return deviceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTicketNo() {
|
||||||
|
return ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicketNo(String ticketNo) {
|
||||||
|
this.ticketNo = ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
@ -176,6 +188,7 @@ public class EmsAlarmRecords extends BaseEntity
|
|||||||
.append("siteId", getSiteId())
|
.append("siteId", getSiteId())
|
||||||
.append("deviceId", getDeviceId())
|
.append("deviceId", getDeviceId())
|
||||||
.append("deviceName", getDeviceName())
|
.append("deviceName", getDeviceName())
|
||||||
|
.append("ticketNo", getTicketNo())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,10 @@ public class EmsTicket extends BaseEntity
|
|||||||
@Excel(name = "处理人ID")
|
@Excel(name = "处理人ID")
|
||||||
private Long workUserId;
|
private Long workUserId;
|
||||||
|
|
||||||
|
/** 0-已废弃 1-有效 */
|
||||||
|
@Excel(name = "0-已废弃 1-有效")
|
||||||
|
private Long isDelete;
|
||||||
|
|
||||||
public void setId(String id)
|
public void setId(String id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -143,6 +147,14 @@ public class EmsTicket extends BaseEntity
|
|||||||
return workUserId;
|
return workUserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDelete(Long isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
@ -159,6 +171,7 @@ public class EmsTicket extends BaseEntity
|
|||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
.append("workUserId", getWorkUserId())
|
.append("workUserId", getWorkUserId())
|
||||||
|
.append("isDelete", getIsDelete())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,12 @@ public class AlarmRecordListResponseVo {
|
|||||||
/** 状态 */
|
/** 状态 */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 工单号 */
|
||||||
|
private String ticketNo;
|
||||||
|
|
||||||
|
/** 告警唯一标识 */
|
||||||
|
private String id;
|
||||||
|
|
||||||
public String getDeviceName() {
|
public String getDeviceName() {
|
||||||
return deviceName;
|
return deviceName;
|
||||||
}
|
}
|
||||||
@ -75,4 +81,20 @@ public class AlarmRecordListResponseVo {
|
|||||||
public void setStatus(String status) {
|
public void setStatus(String status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTicketNo() {
|
||||||
|
return ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicketNo(String ticketNo) {
|
||||||
|
this.ticketNo = ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,14 @@ public class SiteMonitorHomeAlarmVo {
|
|||||||
*/
|
*/
|
||||||
private String alarmContent;
|
private String alarmContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单号
|
||||||
|
*/
|
||||||
|
private String ticketNo;
|
||||||
|
|
||||||
|
/** 告警唯一标识 */
|
||||||
|
private String id;
|
||||||
|
|
||||||
public String getDeviceName() {
|
public String getDeviceName() {
|
||||||
return deviceName;
|
return deviceName;
|
||||||
}
|
}
|
||||||
@ -43,4 +51,20 @@ public class SiteMonitorHomeAlarmVo {
|
|||||||
public void setStatus(int status) {
|
public void setStatus(int status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTicketNo() {
|
||||||
|
return ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTicketNo(String ticketNo) {
|
||||||
|
this.ticketNo = ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,4 +59,11 @@ public interface EmsTicketMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteEmsTicketByIds(String[] ids);
|
public int deleteEmsTicketByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 废弃工单-isDelete=0
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int dropEmsTicketById(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,4 +67,13 @@ public interface IEmsAlarmRecordsService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<AlarmRecordListResponseVo> getAlarmRecordDetailList(AlarmRecordListRequestVo requestVo);
|
public List<AlarmRecordListResponseVo> getAlarmRecordDetailList(AlarmRecordListRequestVo requestVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产工单号
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String createTicketNo(Long id, Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,4 +59,11 @@ public interface IEmsTicketService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteEmsTicketById(String id);
|
public int deleteEmsTicketById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 废弃工单-物理删除
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int dropEmsTicketById(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,18 @@
|
|||||||
package com.xzzn.ems.service.impl;
|
package com.xzzn.ems.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.xzzn.common.core.domain.entity.SysUser;
|
||||||
|
import com.xzzn.common.core.domain.model.LoginUser;
|
||||||
import com.xzzn.common.utils.DateUtils;
|
import com.xzzn.common.utils.DateUtils;
|
||||||
|
import com.xzzn.common.utils.StringUtils;
|
||||||
|
import com.xzzn.ems.domain.EmsTicket;
|
||||||
import com.xzzn.ems.domain.vo.AlarmRecordListRequestVo;
|
import com.xzzn.ems.domain.vo.AlarmRecordListRequestVo;
|
||||||
import com.xzzn.ems.domain.vo.AlarmRecordListResponseVo;
|
import com.xzzn.ems.domain.vo.AlarmRecordListResponseVo;
|
||||||
|
import com.xzzn.ems.mapper.EmsTicketMapper;
|
||||||
|
import com.xzzn.ems.service.IEmsTicketService;
|
||||||
|
import com.xzzn.system.mapper.SysUserMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.xzzn.ems.mapper.EmsAlarmRecordsMapper;
|
import com.xzzn.ems.mapper.EmsAlarmRecordsMapper;
|
||||||
@ -21,6 +30,12 @@ public class EmsAlarmRecordsServiceImpl implements IEmsAlarmRecordsService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmsAlarmRecordsMapper emsAlarmRecordsMapper;
|
private EmsAlarmRecordsMapper emsAlarmRecordsMapper;
|
||||||
|
@Autowired
|
||||||
|
private IEmsTicketService emsTicketService;
|
||||||
|
@Autowired
|
||||||
|
private EmsTicketMapper emsTicketMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询告警记录
|
* 查询告警记录
|
||||||
@ -100,4 +115,50 @@ public class EmsAlarmRecordsServiceImpl implements IEmsAlarmRecordsService
|
|||||||
public List<AlarmRecordListResponseVo> getAlarmRecordDetailList(AlarmRecordListRequestVo requestVo) {
|
public List<AlarmRecordListResponseVo> getAlarmRecordDetailList(AlarmRecordListRequestVo requestVo) {
|
||||||
return emsAlarmRecordsMapper.getAlarmRecordDetailList(requestVo);
|
return emsAlarmRecordsMapper.getAlarmRecordDetailList(requestVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createTicketNo(Long id, Long userId) {
|
||||||
|
String ticketNo = "";
|
||||||
|
// 校验告警记录是否存在
|
||||||
|
EmsAlarmRecords emsAlarmRecords = emsAlarmRecordsMapper.selectEmsAlarmRecordsById(id);
|
||||||
|
if (emsAlarmRecords == null) {
|
||||||
|
return "告警记录不存在";
|
||||||
|
}
|
||||||
|
// 工单号是否存在
|
||||||
|
if (StringUtils.isNotEmpty(emsAlarmRecords.getTicketNo())) {
|
||||||
|
return "工单号已存在";
|
||||||
|
}
|
||||||
|
// 随机生成工单:T+日期+6位随机
|
||||||
|
ticketNo = createRandomTicketNo();
|
||||||
|
// 更新告警表
|
||||||
|
emsAlarmRecords.setTicketNo(ticketNo);
|
||||||
|
emsAlarmRecordsMapper.updateEmsAlarmRecords(emsAlarmRecords);
|
||||||
|
// 不存在-默认userId
|
||||||
|
if (userId == null) {
|
||||||
|
userId = 1L;
|
||||||
|
}
|
||||||
|
SysUser user = sysUserMapper.selectUserById(userId);
|
||||||
|
// 插入工单表
|
||||||
|
EmsTicket emsTicket = new EmsTicket();
|
||||||
|
emsTicket.setTicketNo(ticketNo);
|
||||||
|
emsTicket.setTitle("工单"+id.toString());
|
||||||
|
emsTicket.setContent(emsAlarmRecords.getAlarmContent());
|
||||||
|
emsTicket.setUserId(userId.toString());
|
||||||
|
emsTicket.setWorkUserId(userId);
|
||||||
|
emsTicket.setCreateTime(DateUtils.getNowDate());
|
||||||
|
emsTicket.setCreateBy(user.getUserName());
|
||||||
|
emsTicket.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
emsTicket.setUpdateBy(user.getUserName());
|
||||||
|
emsTicketMapper.insertEmsTicket(emsTicket);
|
||||||
|
return ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String createRandomTicketNo() {
|
||||||
|
String ticketNo = "";
|
||||||
|
String nowDate = DateUtils.dateTime();
|
||||||
|
ticketNo = "T" + nowDate + String.format("%06d", new Random().nextInt(1000000));
|
||||||
|
return ticketNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,4 +94,16 @@ public class EmsTicketServiceImpl implements IEmsTicketService
|
|||||||
{
|
{
|
||||||
return emsTicketMapper.deleteEmsTicketById(id);
|
return emsTicketMapper.deleteEmsTicketById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工单主信息-物理删除
|
||||||
|
*
|
||||||
|
* @param id 工单主主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int dropEmsTicketById(String id)
|
||||||
|
{
|
||||||
|
return emsTicketMapper.dropEmsTicketById(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,10 +20,11 @@
|
|||||||
<result property="siteId" column="site_id" />
|
<result property="siteId" column="site_id" />
|
||||||
<result property="deviceId" column="device_id" />
|
<result property="deviceId" column="device_id" />
|
||||||
<result property="deviceName" column="device_name" />
|
<result property="deviceName" column="device_name" />
|
||||||
|
<result property="ticketNo" column="ticket_no" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEmsAlarmRecordsVo">
|
<sql id="selectEmsAlarmRecordsVo">
|
||||||
select id, device_type, alarm_level, alarm_content, alarm_start_time, alarm_end_time, status, create_by, create_time, update_by, update_time, remark, site_id, device_id, device_name from ems_alarm_records
|
select id, device_type, alarm_level, alarm_content, alarm_start_time, alarm_end_time, status, create_by, create_time, update_by, update_time, remark, site_id, device_id, device_name, ticket_no from ems_alarm_records
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEmsAlarmRecordsList" parameterType="EmsAlarmRecords" resultMap="EmsAlarmRecordsResult">
|
<select id="selectEmsAlarmRecordsList" parameterType="EmsAlarmRecords" resultMap="EmsAlarmRecordsResult">
|
||||||
@ -38,6 +39,7 @@
|
|||||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||||
|
<if test="ticketNo != null and ticketNo != ''"> and ticket_no = #{ticketNo}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -63,6 +65,7 @@
|
|||||||
<if test="siteId != null">site_id,</if>
|
<if test="siteId != null">site_id,</if>
|
||||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||||
<if test="deviceName != null and deviceName != ''">device_name,</if>
|
<if test="deviceName != null and deviceName != ''">device_name,</if>
|
||||||
|
<if test="ticketNo != null">ticket_no,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="deviceType != null">#{deviceType},</if>
|
<if test="deviceType != null">#{deviceType},</if>
|
||||||
@ -79,6 +82,7 @@
|
|||||||
<if test="siteId != null">#{siteId},</if>
|
<if test="siteId != null">#{siteId},</if>
|
||||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||||
|
<if test="ticketNo != null">#{ticketNo},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -99,6 +103,7 @@
|
|||||||
<if test="siteId != null">site_id = #{siteId},</if>
|
<if test="siteId != null">site_id = #{siteId},</if>
|
||||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||||
<if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
<if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
||||||
|
<if test="ticketNo != null">ticket_no = #{ticketNo},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -116,7 +121,10 @@
|
|||||||
|
|
||||||
<select id="getAlarmRecordsBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteMonitorHomeAlarmVo">
|
<select id="getAlarmRecordsBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteMonitorHomeAlarmVo">
|
||||||
select device_name as deviceName,
|
select device_name as deviceName,
|
||||||
status,alarm_content as alarmContent
|
status,
|
||||||
|
alarm_content as alarmContent,
|
||||||
|
ticket_no as ticketNo,
|
||||||
|
id
|
||||||
from ems_alarm_records
|
from ems_alarm_records
|
||||||
where site_id = #{siteId}
|
where site_id = #{siteId}
|
||||||
</select>
|
</select>
|
||||||
@ -140,7 +148,9 @@
|
|||||||
<select id="getAlarmRecordDetailList" parameterType="AlarmRecordListRequestVo" resultType="com.xzzn.ems.domain.vo.AlarmRecordListResponseVo">
|
<select id="getAlarmRecordDetailList" parameterType="AlarmRecordListRequestVo" resultType="com.xzzn.ems.domain.vo.AlarmRecordListResponseVo">
|
||||||
select t.device_name as deviceName,t.alarm_level as alarmLevel,
|
select t.device_name as deviceName,t.alarm_level as alarmLevel,
|
||||||
t.alarm_content as alarmContent,t.status as status,
|
t.alarm_content as alarmContent,t.status as status,
|
||||||
t.alarm_start_time as alarmStartTime,t.alarm_end_time as alarmEndTime
|
t.alarm_start_time as alarmStartTime,t.alarm_end_time as alarmEndTime,
|
||||||
|
t.ticket_no as ticketNo,
|
||||||
|
t.id
|
||||||
from ems_alarm_records t
|
from ems_alarm_records t
|
||||||
where t.site_id = #{siteId}
|
where t.site_id = #{siteId}
|
||||||
<if test="deviceType != null and deviceType != ''">
|
<if test="deviceType != null and deviceType != ''">
|
||||||
|
|||||||
@ -18,15 +18,17 @@
|
|||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="workUserId" column="work_user_id" />
|
<result property="workUserId" column="work_user_id" />
|
||||||
|
<result property="isDelete" column="isDelete" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEmsTicketVo">
|
<sql id="selectEmsTicketVo">
|
||||||
select id, ticket_no, user_id, title, content, images, status, create_time, complete_time, create_by, update_by, update_time, work_user_id from ems_ticket
|
select id, ticket_no, user_id, title, content, images, status, create_time, complete_time, create_by, update_by, update_time, work_user_id, isDelete from ems_ticket
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEmsTicketList" parameterType="EmsTicket" resultMap="EmsTicketResult">
|
<select id="selectEmsTicketList" parameterType="EmsTicket" resultMap="EmsTicketResult">
|
||||||
<include refid="selectEmsTicketVo"/>
|
<include refid="selectEmsTicketVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
isDelete = 1
|
||||||
<if test="ticketNo != null and ticketNo != ''"> and ticket_no = #{ticketNo}</if>
|
<if test="ticketNo != null and ticketNo != ''"> and ticket_no = #{ticketNo}</if>
|
||||||
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
||||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||||
@ -41,6 +43,7 @@
|
|||||||
<select id="selectEmsTicketById" parameterType="String" resultMap="EmsTicketResult">
|
<select id="selectEmsTicketById" parameterType="String" resultMap="EmsTicketResult">
|
||||||
<include refid="selectEmsTicketVo"/>
|
<include refid="selectEmsTicketVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
and isDelete = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertEmsTicket" parameterType="EmsTicket" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertEmsTicket" parameterType="EmsTicket" useGeneratedKeys="true" keyProperty="id">
|
||||||
@ -58,6 +61,7 @@
|
|||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="workUserId != null">work_user_id,</if>
|
<if test="workUserId != null">work_user_id,</if>
|
||||||
|
<if test="isDelete != null">isDelete,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="ticketNo != null and ticketNo != ''">#{ticketNo},</if>
|
<if test="ticketNo != null and ticketNo != ''">#{ticketNo},</if>
|
||||||
@ -72,6 +76,7 @@
|
|||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="workUserId != null">#{workUserId},</if>
|
<if test="workUserId != null">#{workUserId},</if>
|
||||||
|
<if test="isDelete != null">#{isDelete},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -90,6 +95,7 @@
|
|||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="workUserId != null">work_user_id = #{workUserId},</if>
|
<if test="workUserId != null">work_user_id = #{workUserId},</if>
|
||||||
|
<if test="isDelete != null">isDelete = #{isDelete},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -104,4 +110,8 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="dropEmsTicketById" parameterType="String">
|
||||||
|
update ems_ticket set isDelete = 0 where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user