| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- package top.lvzhiqiang.mapper;
- import org.apache.ibatis.annotations.Delete;
- import org.apache.ibatis.annotations.Insert;
- import org.apache.ibatis.annotations.Select;
- import org.apache.ibatis.annotations.Update;
- import top.lvzhiqiang.entity.VideoInfoOther;
- import java.math.BigDecimal;
- import java.util.List;
- /**
- * 电影信息其他Mapper
- *
- * @author lvzhiqiang
- * 2022/5/4 9:54
- */
- public interface VideoInfoOtherMapper {
- /**
- * 删除所有
- */
- @Delete("DELETE FROM video_info_other where 1=1")
- void deleteAll();
- @Update({"<script>" +
- "update video_info_other " +
- "<set>" +
- "<if test=\"score != null\">" +
- " score = #{score}," +
- "</if>" +
- "<if test=\"comment != null and comment != ''\">" +
- " comment = #{comment}," +
- "</if>" +
- "modify_time=now()" +
- "</set>" +
- "where identification_code = #{identificationCode}" +
- "</script>"})
- void updateScoreOrComment(String identificationCode, BigDecimal score, String comment);
- @Select("select count(*) from video_info_other where identification_code=#{identification_code}")
- int findByCode(String identificationCode);
- @Insert("INSERT INTO video_info_other(identification_code, score, comment, create_time, modify_time) " +
- "VALUES (#{identificationCode},#{score},#{comment}, now(), now())")
- void insertScoreOrComment(String identificationCode, BigDecimal score, String comment);
- /**
- * 新增/修改
- *
- * @param identificationCode
- * @param picFlag
- */
- @Insert("INSERT INTO video_info_other(identification_code, pic_flag, create_time, modify_time) " +
- "VALUES (#{identificationCode}, #{picFlag}, now(), now()) " +
- "ON DUPLICATE KEY UPDATE pic_flag=values(pic_flag),modify_time=now()")
- int insertOrUpdate(String identificationCode, Integer picFlag);
- @Insert("INSERT INTO video_info_other(identification_code, javdb_url, pic_flag, create_time, modify_time) " +
- "VALUES (#{identificationCode}, #{javdbUrl}, #{picFlag}, now(), now()) " +
- "ON DUPLICATE KEY UPDATE javdb_url=values(javdb_url),pic_flag=values(pic_flag),modify_time=now()")
- int insertOrUpdate2(String identificationCode, Integer picFlag, String javdbUrl);
- @Insert("INSERT INTO video_info_other(identification_code, resolution_ratio, original, subtitle, recoding, create_time, modify_time) " +
- "VALUES (#{identificationCode},#{resolutionRatio},#{original}, #{subtitle}, #{recoding}, now(), now())")
- void insertVideoInfoOther(String identificationCode, String resolutionRatio, Integer original, Integer subtitle, Integer recoding);
- @Update({"<script>" +
- "update video_info_other " +
- "<set>" +
- "<if test=\"resolutionRatio != null and resolutionRatio != ''\">" +
- " resolution_ratio = #{resolutionRatio}," +
- "</if>" +
- "<if test=\"original != null\">" +
- " original = #{original}," +
- "</if>" +
- "<if test=\"subtitle != null\">" +
- " subtitle = #{subtitle}," +
- "</if>" +
- "<if test=\"recoding != null\">" +
- " recoding = #{recoding}," +
- "</if>" +
- "modify_time=now()" +
- "</set>" +
- "where identification_code = #{identificationCode}" +
- "</script>"})
- void updateVideoInfoOther(String identificationCode, String resolutionRatio, Integer original, Integer subtitle, Integer recoding);
- @Update("update video_info_other set delete_flag = 2,modify_time = now() where identification_code = #{identificationCode}")
- void delByCode(String identificationCode);
- @Select({"<script>" +
- "select * from video_info_other WHERE delete_flag = 1" +
- "<if test=\"identificationCode != null and identificationCode != ''\">" +
- " and identification_code like concat('%',#{identificationCode},'%')" +
- "</if>" +
- "<if test=\"resolutionRatio != null and resolutionRatio != ''\">" +
- " and resolution_ratio = #{resolutionRatio}" +
- "</if>" +
- "<if test=\"original != null\">" +
- " and original = #{original}" +
- "</if>" +
- "<if test=\"subtitle != null\">" +
- " and subtitle = #{subtitle}" +
- "</if>" +
- "<if test=\"recoding != null\">" +
- " and recoding = #{recoding}" +
- "</if>" +
- " order by modify_time desc" +
- "</script>"})
- List<VideoInfoOther> findVideoInfoOther4MultipleParams(String identificationCode, String resolutionRatio, Integer original, Integer subtitle, Integer recoding);
- @Select("SELECT * FROM video_info_other WHERE identification_code = #{identificationCode}")
- VideoInfoOther findVideoInfoOtherByCode(String identificationCode);
- @Insert("INSERT INTO video_info_other(identification_code, comment,comment_first,score, comment_xp,comment_xp_count,javdb_url, create_time, modify_time) " +
- "VALUES (#{identificationCode}, #{comment}, #{commentFirst}, #{score}, #{commentXp}, #{xpCount}, #{javdbUrl}, now(), now()) " +
- "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()")
- void updateVideoInfoOther4Xp(VideoInfoOther videoInfoOther);
- @Update("update video_info_other set javdb_url=#{javdbUrl} where identification_code=#{identificationCode}")
- int updateJavdbUrl(String identificationCode, String javdbUrl);
- }
|