|
@@ -1,6 +1,11 @@
|
|
|
package top.lvzhiqiang.mapper;
|
|
package top.lvzhiqiang.mapper;
|
|
|
|
|
|
|
|
-import org.apache.ibatis.annotations.*;
|
|
|
|
|
|
|
+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.VideoCast;
|
|
|
|
|
+import top.lvzhiqiang.entity.VideoGenres;
|
|
|
import top.lvzhiqiang.entity.VideoInfo;
|
|
import top.lvzhiqiang.entity.VideoInfo;
|
|
|
import top.lvzhiqiang.entity.VideoInfoUncensored;
|
|
import top.lvzhiqiang.entity.VideoInfoUncensored;
|
|
|
|
|
|
|
@@ -36,33 +41,31 @@ public interface VideoInfoUncensoredMapper {
|
|
|
int insertList(List<VideoInfoUncensored> videoInfoUncensoredList);
|
|
int insertList(List<VideoInfoUncensored> videoInfoUncensoredList);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 新增
|
|
|
|
|
- *
|
|
|
|
|
- * @param videoInfo
|
|
|
|
|
|
|
+ * 根据状态查询识别码
|
|
|
*/
|
|
*/
|
|
|
- @Insert("INSERT INTO video_info(name, identification_code, issue_date, length, director, maker, issuer, img_url, video_url, type, main_who, create_time, modify_time) " +
|
|
|
|
|
- "VALUES (#{name}, #{identificationCode}, #{issueDate}, #{length}, #{director}, #{maker}, #{issuer}, #{imgUrl}, #{videoUrl}, #{type}, #{mainWho} ,#{createTime}, now())")
|
|
|
|
|
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
|
|
|
|
- int insert(VideoInfo videoInfo);
|
|
|
|
|
|
|
+ @Select("SELECT identification_code FROM video_info_uncensored WHERE delete_flag = 1 and status = #{status}")
|
|
|
|
|
+ List<String> findIcodeByStatus(Integer status);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 查询所有
|
|
|
|
|
|
|
+ * 更新状态
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param identificationCode
|
|
|
|
|
+ * @param status
|
|
|
|
|
+ * @return
|
|
|
*/
|
|
*/
|
|
|
- @Select("select vi.*, IFNULL(vio.score, 0) AS score from video_info vi " +
|
|
|
|
|
- "left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1 " +
|
|
|
|
|
- "where vi.delete_flag = 1 ORDER BY vi.issue_date desc")
|
|
|
|
|
- List<VideoInfo> findAll();
|
|
|
|
|
|
|
+ @Update("update video_info_uncensored set status = #{status},modify_time = now() where identification_code = #{identificationCode}")
|
|
|
|
|
+ int updateStatus(String identificationCode, Integer status);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询所有识别码
|
|
* 查询所有识别码
|
|
|
*/
|
|
*/
|
|
|
- @Select("select distinct identification_code from video_info")
|
|
|
|
|
|
|
+ @Select("select distinct identification_code from video_info_uncensored")
|
|
|
List<String> findAllIcode();
|
|
List<String> findAllIcode();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据条件查询
|
|
* 根据条件查询
|
|
|
*/
|
|
*/
|
|
|
- List<VideoInfo> getVideoInfoList(Map<String, Object> params);
|
|
|
|
|
|
|
+ List<VideoInfo> getVideoInfoUncensoredList(Map<String, Object> params);
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据识别码和类型查询
|
|
* 根据识别码和类型查询
|
|
@@ -70,19 +73,37 @@ public interface VideoInfoUncensoredMapper {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Select({"<script>" +
|
|
@Select({"<script>" +
|
|
|
- "select vi.*,vio.score,vio.comment from video_info vi left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1 WHERE vi.delete_flag = 1" +
|
|
|
|
|
|
|
+ "select vi.*,vio.score,vio.comment from video_info_uncensored vi left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1 WHERE vi.delete_flag = 1" +
|
|
|
"<if test=\"identificationCode != null and identificationCode != ''\">" +
|
|
"<if test=\"identificationCode != null and identificationCode != ''\">" +
|
|
|
" and vi.identification_code like concat('%',#{identificationCode},'%')" +
|
|
" and vi.identification_code like concat('%',#{identificationCode},'%')" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
- "<if test=\"type != null and type != ''\">" +
|
|
|
|
|
- " and vi.type = #{type}" +
|
|
|
|
|
|
|
+ "<if test=\"status != null and type != ''\">" +
|
|
|
|
|
+ " and vi.status = #{status}" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"<if test=\"order != null and order != ''\">" +
|
|
"<if test=\"order != null and order != ''\">" +
|
|
|
" order by vi.issue_date ${order}" +
|
|
" order by vi.issue_date ${order}" +
|
|
|
"</if>" +
|
|
"</if>" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
- List<VideoInfo> findByCodeAndType(String identificationCode, Integer type, String order);
|
|
|
|
|
|
|
+ List<VideoInfoUncensored> findByCodeAndType(String identificationCode, Integer status, String order);
|
|
|
|
|
|
|
|
- @Update("update video_info set delete_flag = 2,modify_time = now() where identification_code = #{identificationCode}")
|
|
|
|
|
|
|
+ @Update("update video_info_uncensored set delete_flag = 2,modify_time = now() where identification_code = #{identificationCode}")
|
|
|
void delByCode(String identificationCode);
|
|
void delByCode(String identificationCode);
|
|
|
|
|
+
|
|
|
|
|
+ @Update("update video_info_uncensored set length = #{length}, director = #{director}, maker = #{maker}, issuer = #{issuer}, genres = #{genres}, cast = #{cast}, status = #{status}, modify_time = now() where identification_code = #{identificationCode}")
|
|
|
|
|
+ void updateJsoupInfoByCode(VideoInfoUncensored videoInfoUncensored);
|
|
|
|
|
+
|
|
|
|
|
+ @Select("SELECT M.cast name,COUNT(M.cast) count " +
|
|
|
|
|
+ "FROM (" +
|
|
|
|
|
+ " SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(viu.cast, ',', B.HELP_TOPIC_ID + 1), ',', - 1) AS cast" +
|
|
|
|
|
+ " FROM video_info_uncensored viu" +
|
|
|
|
|
+ " JOIN MYSQL.HELP_TOPIC B" +
|
|
|
|
|
+ " ON B.HELP_TOPIC_ID < (LENGTH(viu.cast) - LENGTH(REPLACE(viu.cast, ',', '')) + 1)" +
|
|
|
|
|
+ " WHERE genres != ''" +
|
|
|
|
|
+ " ) M " +
|
|
|
|
|
+ "GROUP BY M.cast " +
|
|
|
|
|
+ "ORDER BY COUNT(M.cast) DESC LIMIT 30")
|
|
|
|
|
+ List<VideoCast> findCast();
|
|
|
|
|
+
|
|
|
|
|
+ @Select("select main_who AS name, count(id) AS count from video_info_uncensored group by main_who order by count(id) desc")
|
|
|
|
|
+ List<VideoGenres> findGenres();
|
|
|
}
|
|
}
|