VideoInfoOtherMapper.java 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. package top.lvzhiqiang.mapper;
  2. import org.apache.ibatis.annotations.Delete;
  3. import org.apache.ibatis.annotations.Insert;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.apache.ibatis.annotations.Update;
  6. import top.lvzhiqiang.entity.VideoInfoOther;
  7. import java.math.BigDecimal;
  8. import java.util.List;
  9. /**
  10. * 电影信息其他Mapper
  11. *
  12. * @author lvzhiqiang
  13. * 2022/5/4 9:54
  14. */
  15. public interface VideoInfoOtherMapper {
  16. /**
  17. * 删除所有
  18. */
  19. @Delete("DELETE FROM video_info_other where 1=1")
  20. void deleteAll();
  21. @Update({"<script>" +
  22. "update video_info_other " +
  23. "<set>" +
  24. "<if test=\"score != null\">" +
  25. " score = #{score}," +
  26. "</if>" +
  27. "<if test=\"comment != null and comment != ''\">" +
  28. " comment = #{comment}," +
  29. "</if>" +
  30. "modify_time=now()" +
  31. "</set>" +
  32. "where identification_code = #{identificationCode}" +
  33. "</script>"})
  34. void updateScoreOrComment(String identificationCode, BigDecimal score, String comment);
  35. @Select("select count(*) from video_info_other where identification_code=#{identification_code}")
  36. int findByCode(String identificationCode);
  37. @Insert("INSERT INTO video_info_other(identification_code, score, comment, create_time, modify_time) " +
  38. "VALUES (#{identificationCode},#{score},#{comment}, now(), now())")
  39. void insertScoreOrComment(String identificationCode, BigDecimal score, String comment);
  40. /**
  41. * 新增/修改
  42. *
  43. * @param identificationCode
  44. * @param picFlag
  45. */
  46. @Insert("INSERT INTO video_info_other(identification_code, pic_flag, create_time, modify_time) " +
  47. "VALUES (#{identificationCode}, #{picFlag}, now(), now()) " +
  48. "ON DUPLICATE KEY UPDATE pic_flag=values(pic_flag),modify_time=now()")
  49. int insertOrUpdate(String identificationCode, Integer picFlag);
  50. @Insert("INSERT INTO video_info_other(identification_code, javdb_url, pic_flag, create_time, modify_time) " +
  51. "VALUES (#{identificationCode}, #{javdbUrl}, #{picFlag}, now(), now()) " +
  52. "ON DUPLICATE KEY UPDATE javdb_url=values(javdb_url),pic_flag=values(pic_flag),modify_time=now()")
  53. int insertOrUpdate2(String identificationCode, Integer picFlag, String javdbUrl);
  54. @Insert("INSERT INTO video_info_other(identification_code, resolution_ratio, original, subtitle, recoding, create_time, modify_time) " +
  55. "VALUES (#{identificationCode},#{resolutionRatio},#{original}, #{subtitle}, #{recoding}, now(), now())")
  56. void insertVideoInfoOther(String identificationCode, String resolutionRatio, Integer original, Integer subtitle, Integer recoding);
  57. @Update({"<script>" +
  58. "update video_info_other " +
  59. "<set>" +
  60. "<if test=\"resolutionRatio != null and resolutionRatio != ''\">" +
  61. " resolution_ratio = #{resolutionRatio}," +
  62. "</if>" +
  63. "<if test=\"original != null\">" +
  64. " original = #{original}," +
  65. "</if>" +
  66. "<if test=\"subtitle != null\">" +
  67. " subtitle = #{subtitle}," +
  68. "</if>" +
  69. "<if test=\"recoding != null\">" +
  70. " recoding = #{recoding}," +
  71. "</if>" +
  72. "modify_time=now()" +
  73. "</set>" +
  74. "where identification_code = #{identificationCode}" +
  75. "</script>"})
  76. void updateVideoInfoOther(String identificationCode, String resolutionRatio, Integer original, Integer subtitle, Integer recoding);
  77. @Update("update video_info_other set delete_flag = 2,modify_time = now() where identification_code = #{identificationCode}")
  78. void delByCode(String identificationCode);
  79. @Select({"<script>" +
  80. "select * from video_info_other WHERE delete_flag = 1" +
  81. "<if test=\"identificationCode != null and identificationCode != ''\">" +
  82. " and identification_code like concat('%',#{identificationCode},'%')" +
  83. "</if>" +
  84. "<if test=\"resolutionRatio != null and resolutionRatio != ''\">" +
  85. " and resolution_ratio = #{resolutionRatio}" +
  86. "</if>" +
  87. "<if test=\"original != null\">" +
  88. " and original = #{original}" +
  89. "</if>" +
  90. "<if test=\"subtitle != null\">" +
  91. " and subtitle = #{subtitle}" +
  92. "</if>" +
  93. "<if test=\"recoding != null\">" +
  94. " and recoding = #{recoding}" +
  95. "</if>" +
  96. " order by modify_time desc" +
  97. "</script>"})
  98. List<VideoInfoOther> findVideoInfoOther4MultipleParams(String identificationCode, String resolutionRatio, Integer original, Integer subtitle, Integer recoding);
  99. @Select("SELECT * FROM video_info_other WHERE identification_code = #{identificationCode}")
  100. VideoInfoOther findVideoInfoOtherByCode(String identificationCode);
  101. @Insert("INSERT INTO video_info_other(identification_code, comment,comment_first,score, comment_xp,comment_xp_count,javdb_url, create_time, modify_time) " +
  102. "VALUES (#{identificationCode}, #{comment}, #{commentFirst}, #{score}, #{commentXp}, #{xpCount}, #{javdbUrl}, now(), now()) " +
  103. "ON DUPLICATE KEY UPDATE comment=values(comment),comment_first=values(comment_first),score=values(score),comment_xp=values(comment_xp),comment_xp_count=values(comment_xp_count),javdb_url=values(javdb_url),modify_time=now()")
  104. void updateVideoInfoOther4Xp(VideoInfoOther videoInfoOther);
  105. @Update("update video_info_other set javdb_url=#{javdbUrl} where identification_code=#{identificationCode}")
  106. int updateJavdbUrl(String identificationCode, String javdbUrl);
  107. }