yujian
2020-04-21 5af10f175689549ca44b74e9fc1c7ee0ec92c2d7
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -722,4 +722,29 @@
         }
      }
   }
   @Override
   public void switchState(Long id) throws SpecialException {
      if (id == null) {
         throw new SpecialException(1, "请传递正确参数");
      }
      Special resultObj = specialMapper.selectByPrimaryKey(id);
      if (resultObj == null) {
         throw new SpecialException(1, "此内容已不存在");
      }
      Long state = resultObj.getState();
      if (state == null || state == 0) {
         state = 1L;
      } else {
         state = 0L;
      }
      Special updateObj = new Special();
      updateObj.setId(id);
      updateObj.setState(state);
      specialMapper.updateByPrimaryKeySelective(updateObj);
   }
}