4f2da10b95edf0719a1fc1082a11b9807681b5fe.svn-base 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package cn.com.goldenwater.dcproj.controller;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspVill2021Usr;
  5. import cn.com.goldenwater.dcproj.service.BisInspVill2021UsrService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.apache.commons.lang3.StringUtils;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. /**
  15. * @author lhc
  16. * @date 2021-6-16
  17. */
  18. @Api(value = "097 2021农饮-用水户管理", tags = "097 2021农饮-用水户管理")
  19. @RestController
  20. @RequestMapping("/bis/insp/vill2021/usr")
  21. public class BisInspVill2021UsrController extends BaseController {
  22. private Logger logger = LoggerFactory.getLogger(getClass());
  23. @Autowired
  24. private BisInspVill2021UsrService bisInspVill2021UsrService;
  25. @ApiOperation(value = "修改097 2021农饮-用水户")
  26. @RequestMapping(value = "", method = RequestMethod.POST)
  27. public BaseResponse<BisInspVill2021Usr> insert(@ApiParam(name = "bisInspVill2021Usr", value = "BisInspVill2021Usr", required = true) @RequestBody BisInspVill2021Usr bisInspVill2021Usr) {
  28. bisInspVill2021Usr.setPersId(getCurrentPersId());
  29. int ret = 0;
  30. if (StringUtils.isBlank(bisInspVill2021Usr.getId())) {
  31. ret = bisInspVill2021UsrService.insert(bisInspVill2021Usr);
  32. } else {
  33. ret = bisInspVill2021UsrService.update(bisInspVill2021Usr);
  34. }
  35. return buildSuccessResponse(bisInspVill2021Usr);
  36. }
  37. @ApiOperation(value = "根据ID删除097 2021农饮-用水户")
  38. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  39. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  40. int ret = bisInspVill2021UsrService.delete(id);
  41. return buildSuccessResponse();
  42. }
  43. @ApiOperation(value = "根据ID获取097 2021农饮-用水户(单表)")
  44. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  45. public BaseResponse<BisInspVill2021Usr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  46. BisInspVill2021Usr bisInspVill2021Usr = bisInspVill2021UsrService.get(id);
  47. return buildSuccessResponse(bisInspVill2021Usr);
  48. }
  49. }