|  |  |  | 
|---|
|  |  |  | OrganizationUnitAlarm oldRecord = organizationUnitAlarmMapper.selectById(organizationUnitAlarm.getId()); | 
|---|
|  |  |  | //更新 | 
|---|
|  |  |  | UpdateWrapper updateWrapper = new UpdateWrapper(); | 
|---|
|  |  |  | if(organizationUnitAlarm.getAlarmLevel().equals("")) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(organizationUnitAlarm.getAlarmLevel().equals("[]")) | 
|---|
|  |  |  | updateWrapper.set("alarm_level",null); | 
|---|
|  |  |  | else | 
|---|
|  |  |  | updateWrapper.set("alarm_level",organizationUnitAlarm.getAlarmLevel()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(organizationUnitAlarm.getShowUnitKey()!=null) | 
|---|
|  |  |  | updateWrapper.set("show_unit_key",organizationUnitAlarm.getShowUnitKey()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | updateWrapper.eq("id",organizationUnitAlarm.getId()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | organizationUnitAlarmMapper.update(null,updateWrapper); | 
|---|
|  |  |  | //获取更新后的记录用于插入日志 | 
|---|
|  |  |  | OrganizationUnitAlarm newRecord = organizationUnitAlarmMapper.selectById(organizationUnitAlarm.getId()); | 
|---|
|  |  |  | //刷新deviceInfo缓存 | 
|---|
|  |  |  | CacheUtils.refreshDeviceAlarmInfo(); | 
|---|
|  |  |  | CacheUtils.refreshSpecialDeviceAlarmInfo(); | 
|---|
|  |  |  | //封装返回对象 | 
|---|
|  |  |  | dto.setCode(ResponseCodeEnum.SUCCESS.getCode()); | 
|---|
|  |  |  | dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); | 
|---|