tujidelv %!s(int64=3) %!d(string=hai) anos
pai
achega
8bfab6d4ae

+ 3 - 0
src/main/java/top/lvzhiqiang/entity/VideoInfoPool.java

@@ -94,4 +94,7 @@ public class VideoInfoPool implements Serializable {
      */
     @JsonFormat(pattern = DateUtils.PATTERN_TO_SECONDS)
     private LocalDateTime modifyTime;
+
+    private String score;
+    private String comment;
 }

+ 4 - 4
src/main/java/top/lvzhiqiang/mapper/VideoInfoMapper.java

@@ -69,15 +69,15 @@ public interface VideoInfoMapper {
      * @return
      */
     @Select({"<script>" +
-            "select *  from video_info WHERE delete_flag = 1" +
+            "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" +
             "<if test=\"identificationCode != null and identificationCode != ''\">" +
-            "   and identification_code like concat('%',#{identificationCode},'%')" +
+            "   and vi.identification_code like concat('%',#{identificationCode},'%')" +
             "</if>" +
             "<if test=\"type != null and type != ''\">" +
-            "   and type = #{type}" +
+            "   and vi.type = #{type}" +
             "</if>" +
             "<if test=\"order != null and order != ''\">" +
-            "   order by issue_date ${order}" +
+            "   order by vi.issue_date ${order}" +
             "</if>" +
             "</script>"})
     List<VideoInfo> findByCodeAndType(String identificationCode, Integer type, String order);

+ 4 - 4
src/main/java/top/lvzhiqiang/mapper/VideoInfoPoolMapper.java

@@ -80,15 +80,15 @@ public interface VideoInfoPoolMapper {
      * @return
      */
     @Select({"<script>" +
-            "select *  from video_info_pool WHERE delete_flag = 1" +
+            "select vip.*,vio.score,vio.comment  from video_info_pool vip left join video_info_other vio on vip.identification_code = vio.identification_code and vio.delete_flag = 1 WHERE vip.delete_flag = 1" +
             "<if test=\"identificationCode != null and identificationCode != ''\">" +
-            "   and identification_code like concat('%',#{identificationCode},'%')" +
+            "   and vip.identification_code like concat('%',#{identificationCode},'%')" +
             "</if>" +
             "<if test=\"type != null and type != ''\">" +
-            "   and type = #{type}" +
+            "   and vip.type = #{type}" +
             "</if>" +
             "<if test=\"order != null and order != ''\">" +
-            "   order by issue_date ${order}" +
+            "   order by vip.issue_date ${order}" +
             "</if>" +
             "</script>"})
     List<VideoInfoPool> findByCodeAndType(String identificationCode, Integer type, String order);

+ 1 - 1
src/main/resources/mapper/VideoInfoPoolMapper.xml

@@ -6,7 +6,7 @@
 <mapper namespace="top.lvzhiqiang.mapper.VideoInfoPoolMapper">
 
     <select id="getVideoInfoPoolList" resultType="top.lvzhiqiang.entity.VideoInfo">
-        select vi.id,vi.name,vi.identification_code,vi.issue_date,vi.modify_time,vi.type,vi.img_url,vi.cast AS main_who,IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment
+        select vi.id,vi.name,vi.identification_code,vi.issue_date,vi.modify_time,vi.type,vi.img_url,IFNULL(vi.cast, vi.genres) AS main_who,IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment
         from video_info_pool vi
         left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1
         where vi.delete_flag = 1