|
|
@ -33,8 +33,135 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<update id="updateMiddleDatabaseDevice"> |
|
|
|
<insert id="insertMiddleDatabaseEvent" parameterType="MdEvent"> |
|
|
|
insert into event |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="fusionId != null">fusionId,</if> |
|
|
|
<if test="eventName != null">event_name,</if> |
|
|
|
<if test="eventTypeCode != null">event_type_code,</if> |
|
|
|
<if test="eventDesc != null">event_desc,</if> |
|
|
|
<if test="occurTime != null">occur_time,</if> |
|
|
|
<if test="endTime != null">end_time,</if> |
|
|
|
<if test="stakeNumber != null and stakeNumber != ''">stake_number,</if> |
|
|
|
<if test="longitude != null">longitude,</if> |
|
|
|
<if test="latitude != null">latitude,</if> |
|
|
|
<if test="lane != null">lane,</if> |
|
|
|
<if test="direction != null and direction != ''">direction,</if> |
|
|
|
<if test="location != null">location,</if> |
|
|
|
<if test="eventSourceCode != null">event_source_code,</if> |
|
|
|
<if test="eventSource != null">event_source,</if> |
|
|
|
<if test="eventStatus != null">event_status,</if> |
|
|
|
<if test="eventLevel != null">event_level,</if> |
|
|
|
<if test="sectionId != null">section_id,</if> |
|
|
|
<if test="eventTypeCode2 != null">event_type_code2,</if> |
|
|
|
<if test="eventCause != null">event_cause,</if> |
|
|
|
<if test="accidentWeather != null">accident_weather,</if> |
|
|
|
<if test="accidentQueue != null">accident_queue,</if> |
|
|
|
<if test="congestionPile != null">congestion_pile,</if> |
|
|
|
<if test="congestionReason != null">congestion_reason,</if> |
|
|
|
<if test="controlCategory != null">control_category,</if> |
|
|
|
<if test="controlReason != null">control_reason,</if> |
|
|
|
<if test="controlReasonType != null">control_reason_type,</if> |
|
|
|
<if test="controlStation != null">control_station,</if> |
|
|
|
<if test="controlPile != null">control_pile,</if> |
|
|
|
<if test="controlStrategy != null">control_strategy,</if> |
|
|
|
<if test="controlType != null">control_type,</if> |
|
|
|
<if test="controlVehicleType != null">control_vehicle_type,</if> |
|
|
|
<if test="creatorUserId != null">CreatorUserId,</if> |
|
|
|
<if test="lastModificationTime != null">LastModificationTime,</if> |
|
|
|
<if test="lastModifierUserId != null">LastModifierUserId,</if> |
|
|
|
<if test="isDeleted != null">IsDeleted,</if> |
|
|
|
<if test="deleterUserId != null">DeleterUserId,</if> |
|
|
|
<if test="deletionTime != null">DeletionTime,</if> |
|
|
|
CreationTime, |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="fusionId != null">#{fusionId},</if> |
|
|
|
<if test="eventName != null">#{eventName},</if> |
|
|
|
<if test="eventTypeCode != null">#{eventTypeCode},</if> |
|
|
|
<if test="eventDesc != null">#{eventDesc},</if> |
|
|
|
<if test="occurTime != null">#{occurTime},</if> |
|
|
|
<if test="endTime != null">#{endTime},</if> |
|
|
|
<if test="stakeNumber != null and stakeNumber != ''">#{stakeNumber},</if> |
|
|
|
<if test="longitude != null">#{longitude},</if> |
|
|
|
<if test="latitude != null">#{latitude},</if> |
|
|
|
<if test="lane != null">#{lane},</if> |
|
|
|
<if test="direction != null and direction != ''">#{direction},</if> |
|
|
|
<if test="location != null">#{location},</if> |
|
|
|
<if test="eventSourceCode != null">#{eventSourceCode},</if> |
|
|
|
<if test="eventSource != null">#{eventSource},</if> |
|
|
|
<if test="eventStatus != null">#{eventStatus},</if> |
|
|
|
<if test="eventLevel != null">#{eventLevel},</if> |
|
|
|
<if test="sectionId != null">#{sectionId},</if> |
|
|
|
<if test="eventTypeCode2 != null">#{eventTypeCode2},</if> |
|
|
|
<if test="eventCause != null">#{eventCause},</if> |
|
|
|
<if test="accidentWeather != null">#{accidentWeather},</if> |
|
|
|
<if test="accidentQueue != null">#{accidentQueue},</if> |
|
|
|
<if test="congestionPile != null">#{congestionPile},</if> |
|
|
|
<if test="congestionReason != null">#{congestionReason},</if> |
|
|
|
<if test="controlCategory != null">#{controlCategory},</if> |
|
|
|
<if test="controlReason != null">#{controlReason},</if> |
|
|
|
<if test="controlReasonType != null">#{controlReasonType},</if> |
|
|
|
<if test="controlStation != null">#{controlStation},</if> |
|
|
|
<if test="controlPile != null">#{controlPile},</if> |
|
|
|
<if test="controlStrategy != null">#{controlStrategy},</if> |
|
|
|
<if test="controlType != null">#{controlType},</if> |
|
|
|
<if test="controlVehicleType != null">#{controlVehicleType},</if> |
|
|
|
<if test="creatorUserId != null">#{creatorUserId},</if> |
|
|
|
<if test="lastModificationTime != null">#{lastModificationTime},</if> |
|
|
|
<if test="lastModifierUserId != null">#{lastModifierUserId},</if> |
|
|
|
<if test="isDeleted != null">#{isDeleted},</if> |
|
|
|
<if test="deleterUserId != null">#{deleterUserId},</if> |
|
|
|
<if test="deletionTime != null">#{deletionTime},</if> |
|
|
|
now() |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<update id="updateMiddleDatabaseDevice" parameterType="MdEvent"> |
|
|
|
update device set dev_status = #{deviceState} where dev_no = #{iotDeviceId} |
|
|
|
</update> |
|
|
|
|
|
|
|
<update id="updateMiddleDatabaseEvent" parameterType="MdEvent"> |
|
|
|
update event |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="fusionId != null">fusionId = #{fusionId},</if> |
|
|
|
<if test="eventName != null">event_name = #{eventName},</if> |
|
|
|
<if test="eventTypeCode != null">event_type_code = #{eventTypeCode},</if> |
|
|
|
<if test="eventDesc != null">event_desc = #{eventDesc},</if> |
|
|
|
<if test="occurTime != null">occur_time = #{occurTime},</if> |
|
|
|
<if test="endTime != null">end_time = #{endTime},</if> |
|
|
|
<if test="stakeNumber != null and stakeNumber != ''">stake_number = #{stakeNumber},</if> |
|
|
|
<if test="longitude != null">longitude = #{longitude},</if> |
|
|
|
<if test="latitude != null">latitude = #{latitude},</if> |
|
|
|
<if test="lane != null">lane = #{lane},</if> |
|
|
|
<if test="direction != null and direction != ''">direction = #{direction},</if> |
|
|
|
<if test="location != null">location = #{location},</if> |
|
|
|
<if test="eventSourceCode != null">event_source_code = #{eventSourceCode},</if> |
|
|
|
<if test="eventSource != null">event_source = #{eventSource},</if> |
|
|
|
<if test="eventStatus != null">event_status = #{eventStatus},</if> |
|
|
|
<if test="eventLevel != null">event_level = #{eventLevel},</if> |
|
|
|
<if test="sectionId != null">section_id = #{sectionId},</if> |
|
|
|
<if test="eventTypeCode2 != null">event_type_code2 = #{eventTypeCode2},</if> |
|
|
|
<if test="eventCause != null">event_cause = #{eventCause},</if> |
|
|
|
<if test="accidentWeather != null">accident_weather = #{accidentWeather},</if> |
|
|
|
<if test="accidentQueue != null">accident_queue = #{accidentQueue},</if> |
|
|
|
<if test="congestionPile != null">congestion_pile = #{congestionPile},</if> |
|
|
|
<if test="congestionReason != null">congestion_reason = #{congestionReason},</if> |
|
|
|
<if test="controlCategory != null">control_category = #{controlCategory},</if> |
|
|
|
<if test="controlReason != null">control_reason = #{controlReason},</if> |
|
|
|
<if test="controlReasonType != null">control_reason_type = #{controlReasonType},</if> |
|
|
|
<if test="controlStation != null">control_station = #{controlStation},</if> |
|
|
|
<if test="controlPile != null">control_pile = #{controlPile},</if> |
|
|
|
<if test="controlStrategy != null">control_strategy = #{controlStrategy},</if> |
|
|
|
<if test="controlType != null">control_type = #{controlType},</if> |
|
|
|
<if test="controlVehicleType != null">control_vehicle_type = #{controlVehicleType},</if> |
|
|
|
LastModificationTime = now(), |
|
|
|
<if test="lastModifierUserId != null">LastModifierUserId = #{lastModifierUserId},</if> |
|
|
|
<if test="isDeleted != null">IsDeleted = #{isDeleted},</if> |
|
|
|
<if test="deleterUserId != null">DeleterUserId = #{deleterUserId},</if> |
|
|
|
<if test="deletionTime != null">DeletionTime = #{deletionTime},</if> |
|
|
|
</trim> |
|
|
|
where id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
</mapper> |
|
|
|