| | |
| | | ValidateUtil.notNull(parameters.get("old_state"), "param.is.null");
|
| | | ValidateUtil.notNull(parameters.get("new_state"), "param.is.null");
|
| | | int count = 0;
|
| | | if ("4".equals(parameters.get("old_state")) && "9".equals(parameters.get("new_state"))) {
|
| | | if (Constants.DEVICE_STATE_OFFLINE.equals(parameters.get("old_state")) && Constants.DEVICE_STATE_MAINTENANCE.equals(parameters.get("new_state"))) {
|
| | | Device device = new Device();
|
| | | Example example = new Example(ENTITY_CLASS);
|
| | | example.and().andEqualTo("id", new Integer(parameters.get("id").toString())).andEqualTo("state", "4");
|
| | | device.setState("9");
|
| | | example.and().andEqualTo("id", new Integer(parameters.get("id").toString())).andEqualTo("state", Constants.DEVICE_STATE_OFFLINE);
|
| | | device.setState(Constants.DEVICE_STATE_MAINTENANCE);
|
| | | count = deviceMapper.updateByExampleSelective(device, example);
|
| | | }
|
| | | if (count == 0) {
|