ScheduleMapper.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.example.cinema.data;
  2. import com.example.cinema.vo.ResponseVO;
  3. import com.example.cinema.vo.ScheduleForm;
  4. import com.example.cinema.vo.ScheduleItem;
  5. import com.example.cinema.vo.ScheduleViewForm;
  6. import org.apache.ibatis.annotations.Mapper;
  7. import org.apache.ibatis.annotations.Param;
  8. import java.util.Date;
  9. import java.util.List;
  10. /**
  11. * @author fjj
  12. * @date 2019/4/11 4:18 PM
  13. */
  14. @Mapper
  15. public interface ScheduleMapper {
  16. /**
  17. * 插入一条排片信息
  18. * @param scheduleForm
  19. * @return
  20. */
  21. int insertOneSchedule(ScheduleForm scheduleForm);
  22. /**
  23. * 查询从startDate开始到endDate为止的某hall的排片信息
  24. * @param hallId
  25. * @param startDate
  26. * @param endDate
  27. * @return
  28. */
  29. List<ScheduleItem> selectSchedule(@Param("hallId") int hallId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
  30. /**
  31. * 查询起止时间是否有冲突(不包括与自身的冲突)
  32. * @param hallId
  33. * @param startTime
  34. * @param endTime
  35. * @param id
  36. * @return
  37. */
  38. List<ScheduleItem> selectScheduleConflictByHallIdAndTime(@Param("hallId") int hallId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("id") int id);
  39. /**
  40. * 插入观众可见排片限制
  41. * @return
  42. */
  43. int insertOneView(ScheduleViewForm scheduleViewForm);
  44. /**
  45. * 修改观众可见排片限制
  46. * @param scheduleViewForm
  47. * @return
  48. */
  49. int updateOneView(ScheduleViewForm scheduleViewForm);
  50. /**
  51. * 查询view的记录数,以此判断后续操作是插入还是修改
  52. * @return
  53. */
  54. int selectViewCount();
  55. /**
  56. * 批量删除排片信息
  57. * @param scheduleIdList
  58. * @return
  59. */
  60. int deleteScheduleBatch(List<Integer> scheduleIdList);
  61. /**
  62. * 批量查询排片信息
  63. * @param scheduleIdList
  64. * @return
  65. */
  66. List<ScheduleItem> selectScheduleBatch(List<Integer> scheduleIdList);
  67. /**
  68. * 查询排片限制信息
  69. * @return
  70. */
  71. int selectView();
  72. /**
  73. * 根据id修改排片信息
  74. * @param scheduleForm
  75. * @return
  76. */
  77. int updateScheduleById(ScheduleForm scheduleForm);
  78. /**
  79. * 根据id查找排片信息
  80. * @param id
  81. * @return
  82. */
  83. ScheduleItem selectScheduleById(int id);
  84. }