Browse Source

更改事件预案关联表id类型

develop
Mr.Wang 10 months ago
parent
commit
ac54b69a08
  1. 2
      zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java
  2. 2
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  3. 16
      zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml

2
zc-business/src/main/java/com/zc/business/domain/EventPlanAssoc.java

@ -22,7 +22,7 @@ import java.util.Date;
public class EventPlanAssoc {
@ApiModelProperty("预案事件关联id")
private String id;
private Long id;
/**
* 所属事件编号
*/

2
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -743,8 +743,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
eventPlanAssoc.setControlDevice(deviceIds.toString().replaceFirst(";", ""));
eventPlanAssoc.setControlResult(resultArray.toJSONString());
eventPlanAssoc.setCreateTime(DateUtils.getNowDate());
// IdUtils.fastSimpleUUID()
eventPlanAssoc.setId(IdUtils.fastSimpleUUID());
eventPlanAssocMapper.insertEventPlanAssoc(eventPlanAssoc);
resultObject.put("eventPlanAssocId",eventPlanAssoc.getId());
}else {

16
zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml

@ -4,10 +4,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.EventPlanAssocMapper">
<insert id="insertEventPlanAssoc" parameterType="EventPlanAssoc">
<resultMap type="EventPlanAssoc" id="EventPlanAssocResult">
<result property="id" column="id"/>
<result property="eventId" column="event_id"/>
<result property="emergencyPlansId" column="emergency_plans_id"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="operationType" column="operation_type"/>
<result property="controlDevice" column="control_device"/>
<result property="controlResult" column="control_result"/>
</resultMap>
<insert id="insertEventPlanAssoc" parameterType="EventPlanAssoc" useGeneratedKeys="true"
keyProperty="id">
insert into event_plan_assoc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="eventId != null and eventId != ''">event_id,</if>
<if test="emergencyPlansId != null">emergency_plans_id,</if>
<if test="controlDevice != null and controlDevice != ''">control_device,</if>
@ -17,7 +28,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="controlResult != null and controlResult !=''">control_result,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="eventId != null and eventId != ''">#{eventId},</if>
<if test="emergencyPlansId != null">#{emergencyPlansId},</if>
<if test="controlDevice != null and controlDevice != ''">#{controlDevice},</if>

Loading…
Cancel
Save