TbGateCommandLogController.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.pj.biz;
  2. import java.util.List;
  3. import com.pj.project.tb_gate_command_log.TbGateCommandLog;
  4. import com.pj.project.tb_gate_command_log.TbGateCommandLogService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.transaction.annotation.Transactional;
  7. import org.springframework.web.bind.annotation.*;
  8. import com.pj.utils.sg.*;
  9. import com.pj.utils.so.*;
  10. import com.pj.project4sp.SP;
  11. import com.pj.current.satoken.StpUserUtil;
  12. import cn.dev33.satoken.annotation.SaCheckPermission;
  13. /**
  14. * Controller: tb_gate_command_log -- 车辆道闸命令日志
  15. *
  16. * @author qzyReal
  17. */
  18. @RestController
  19. @RequestMapping("/TbGateCommandLog/")
  20. public class TbGateCommandLogController {
  21. /**
  22. * 底层 Service 对象
  23. */
  24. @Autowired
  25. TbGateCommandLogService tbGateCommandLogService;
  26. /**
  27. * 删
  28. */
  29. @RequestMapping("delete")
  30. @SaCheckPermission(TbGateCommandLog.PERMISSION_CODE_DEL)
  31. public AjaxJson delete(Long id) {
  32. tbGateCommandLogService.delete(id);
  33. return AjaxJson.getSuccess();
  34. }
  35. /**
  36. * 删 - 根据id列表
  37. */
  38. @RequestMapping("deleteByIds")
  39. @SaCheckPermission(TbGateCommandLog.PERMISSION_CODE_DEL)
  40. public AjaxJson deleteByIds() {
  41. List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
  42. int line = SP.publicMapper.deleteByIds(TbGateCommandLog.TABLE_NAME, ids);
  43. return AjaxJson.getByLine(line);
  44. }
  45. /**
  46. * 查 - 根据id
  47. */
  48. @RequestMapping("getById")
  49. public AjaxJson getById(Long id) {
  50. TbGateCommandLog t = tbGateCommandLogService.getById(id);
  51. return AjaxJson.getSuccessData(t);
  52. }
  53. /**
  54. * 查集合 - 根据条件(参数为空时代表忽略指定条件)
  55. */
  56. @RequestMapping("getList")
  57. public AjaxJson getList() {
  58. SoMap so = SoMap.getRequestSoMap();
  59. List<TbGateCommandLog> list = tbGateCommandLogService.getList(so.startPage());
  60. return AjaxJson.getPageData(so.getDataCount(), list);
  61. }
  62. }