| | |
| | | |
| | | <update id="updateRegisteredChannelObservation"> |
| | | update t_detection_channel |
| | | set online_status = #{onlineStatus}, work_status = #{workStatus}, update_time = sysdate() |
| | | set online_status = case when #{onlineStatus} in ('ONLINE', '1') then 'ONLINE' else 'OFFLINE' end, |
| | | work_status = case #{workStatus} |
| | | when 'PAUSED' then 'PAUSED' |
| | | when 'PROTECTED' then 'ABNORMAL' |
| | | when 'FINISHED' then 'ENDED' |
| | | when 'STOPPED' then 'ENDED' |
| | | when 'WORKING' then 'RUNNING' |
| | | when 'SYNCHRONIZING' then 'RUNNING' |
| | | when 'LIT' then 'RUNNING' |
| | | when 'WAITING_TIMEOUT' then 'RUNNING' |
| | | when 'WAITING_START' then 'RUNNING' |
| | | when 'LOCKED' then 'RUNNING' |
| | | when 'RUNNING' then 'RUNNING' |
| | | else 'UNOBSERVABLE' end, |
| | | update_time = sysdate() |
| | | <if test="updateLastSeen">, last_seen_at_utc = #{lastSeenAtUtc}</if> |
| | | where adapter_code = #{adapterCode} |
| | | and devtype = #{devtype} and devid = #{devid} |
| | |
| | | and cabinet.del_flag = 0 and cabinet.registration_status = 'REGISTERED') |
| | | </update> |
| | | |
| | | <update id="markRegisteredFactsUnobservable"> |
| | | update t_detection_channel |
| | | set online_status = 'OFFLINE', work_status = 'UNOBSERVABLE', update_time = sysdate() |
| | | where adapter_code = #{adapterCode} and del_flag = 0 |
| | | </update> |
| | | |
| | | <update id="markRegisteredCabinetsOffline"> |
| | | update t_detection_cabinet |
| | | set online_status = 'OFFLINE', update_time = sysdate() |
| | | where adapter_code = #{adapterCode} and del_flag = 0 and registration_status = 'REGISTERED' |
| | | </update> |
| | | |
| | | <update id="touchRegisteredChannelObservation"> |
| | | update t_detection_channel |
| | | set last_seen_at_utc = #{lastSeenAtUtc}, update_time = sysdate() |
| | | where adapter_code = #{adapterCode} |
| | | and devtype = #{devtype} and devid = #{devid} |
| | | and subdevid = #{subdevid} and chlid = #{chlid} |
| | | and online_status = 'ONLINE' and del_flag = 0 |
| | | </update> |
| | | |
| | | <update id="touchRegisteredCabinetObservation"> |
| | | update t_detection_cabinet |
| | | set last_seen_at_utc = #{lastSeenAtUtc}, update_time = sysdate() |
| | | where adapter_code = #{adapterCode} |
| | | and vendor_device_type = #{devtype} and vendor_device_id = #{devid} |
| | | and online_status = 'ONLINE' and del_flag = 0 and registration_status = 'REGISTERED' |
| | | </update> |
| | | |
| | | <update id="updateDetectionCabinet" parameterType="TDetectionCabinet"> |
| | | update t_detection_cabinet |
| | | <set> |