LearnPaperServiceImpl.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.ruoyi.learn.service.impl;
  2. import java.util.List;
  3. import com.ruoyi.common.utils.DateUtils;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Service;
  6. import com.ruoyi.learn.mapper.LearnPaperMapper;
  7. import com.ruoyi.learn.domain.LearnPaper;
  8. import com.ruoyi.learn.service.ILearnPaperService;
  9. /**
  10. * 试卷Service业务层处理
  11. *
  12. * @author ruoyi
  13. * @date 2025-09-18
  14. */
  15. @Service
  16. public class LearnPaperServiceImpl implements ILearnPaperService
  17. {
  18. @Autowired
  19. private LearnPaperMapper learnPaperMapper;
  20. /**
  21. * 查询试卷
  22. *
  23. * @param id 试卷主键
  24. * @return 试卷
  25. */
  26. @Override
  27. public LearnPaper selectLearnPaperById(Long id)
  28. {
  29. return learnPaperMapper.selectLearnPaperById(id);
  30. }
  31. /**
  32. * 查询试卷列表
  33. *
  34. * @param learnPaper 试卷
  35. * @return 试卷
  36. */
  37. @Override
  38. public List<LearnPaper> selectLearnPaperList(LearnPaper learnPaper)
  39. {
  40. return learnPaperMapper.selectLearnPaperList(learnPaper);
  41. }
  42. @Override
  43. public List<LearnPaper> selectLearnPaperForExam(LearnPaper learnPaper)
  44. {
  45. return learnPaperMapper.selectLearnPaperForExam(learnPaper);
  46. }
  47. @Override
  48. public List<LearnPaper> selectPapersListFromFavorites(LearnPaper papers) {
  49. return learnPaperMapper.selectPapersListFromFavorites(papers);
  50. }
  51. /**
  52. * 新增试卷
  53. *
  54. * @param learnPaper 试卷
  55. * @return 结果
  56. */
  57. @Override
  58. public int insertLearnPaper(LearnPaper learnPaper)
  59. {
  60. learnPaper.setCreateTime(DateUtils.getNowDate());
  61. return learnPaperMapper.insertLearnPaper(learnPaper);
  62. }
  63. /**
  64. * 修改试卷
  65. *
  66. * @param learnPaper 试卷
  67. * @return 结果
  68. */
  69. @Override
  70. public int updateLearnPaper(LearnPaper learnPaper)
  71. {
  72. return learnPaperMapper.updateLearnPaper(learnPaper);
  73. }
  74. /**
  75. * 批量删除试卷
  76. *
  77. * @param ids 需要删除的试卷主键
  78. * @return 结果
  79. */
  80. @Override
  81. public int deleteLearnPaperByIds(Long[] ids)
  82. {
  83. return learnPaperMapper.deleteLearnPaperByIds(ids);
  84. }
  85. /**
  86. * 删除试卷信息
  87. *
  88. * @param id 试卷主键
  89. * @return 结果
  90. */
  91. @Override
  92. public int deleteLearnPaperById(Long id)
  93. {
  94. return learnPaperMapper.deleteLearnPaperById(id);
  95. }
  96. }