张延森 4 年 前
コミット
110b668814

+ 0
- 1
src/main/java/com/shigongli/controller/TaMetaImageTagController.java ファイルの表示

@@ -57,7 +57,6 @@ public class TaMetaImageTagController extends BaseController {
57 57
                                            @ApiParam("标签ID") @RequestParam(value ="tagId") String tagId) throws Exception{
58 58
 
59 59
 		    IPage<TaMetaImageTag> pg = new Page<>(pageNum, pageSize);
60
-
61 60
             IPage<TaMetaImageTag> result = iTaMetaImageTagService.pagedBy(pg, tagId);
62 61
             return ResponseBean.success(result);
63 62
     }

+ 3
- 0
src/main/java/com/shigongli/entity/TaMetaImageTag.java ファイルの表示

@@ -1,6 +1,7 @@
1 1
 package com.shigongli.entity;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import java.io.Serializable;
6 7
 import io.swagger.annotations.ApiModel;
@@ -35,7 +36,9 @@ public class TaMetaImageTag implements Serializable {
35 36
     @ApiModelProperty(value = "标签ID")
36 37
     private String tagId;
37 38
 
39
+    @TableField(exist = false)
38 40
     private String tagName;
39 41
 
42
+    @TableField(exist = false)
40 43
     private String image;
41 44
 }

+ 3
- 0
src/main/java/com/shigongli/mapper/TaMetaImageTagMapper.java ファイルの表示

@@ -1,5 +1,6 @@
1 1
 package com.shigongli.mapper;
2 2
 
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
3 4
 import com.shigongli.entity.TaMetaImageTag;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 6
 import org.apache.ibatis.annotations.Mapper;
@@ -19,4 +20,6 @@ import java.util.List;
19 20
 public interface TaMetaImageTagMapper extends BaseMapper<TaMetaImageTag> {
20 21
 
21 22
     int removeAllBy(@Param("tagIds") List<String> tagIds);
23
+
24
+    IPage<TaMetaImageTag> pagedBy(IPage<TaMetaImageTag> pg, @Param("tagId") String tagId);
22 25
 }

+ 1
- 1
src/main/java/com/shigongli/service/impl/TaMetaImageTagServiceImpl.java ファイルの表示

@@ -35,6 +35,6 @@ public class TaMetaImageTagServiceImpl extends ServiceImpl<TaMetaImageTagMapper,
35 35
 
36 36
     @Override
37 37
     public IPage<TaMetaImageTag> pagedBy(IPage<TaMetaImageTag> pg, String tagId) {
38
-        return null;
38
+        return taMetaImageTagMapper.pagedBy(pg, tagId);
39 39
     }
40 40
 }

+ 14
- 0
src/main/resources/mapper/TaMetaImageTagMapper.xml ファイルの表示

@@ -9,4 +9,18 @@
9 9
             #{id}
10 10
         </foreach>
11 11
     </delete>
12
+    <select id="pagedBy" resultType="com.shigongli.entity.TaMetaImageTag">
13
+        SELECT
14
+            t.`name` AS tag_name,
15
+            m.image,
16
+            s.*
17
+        FROM
18
+        ta_mate_tag t
19
+        INNER JOIN ta_meta_image_tag s ON t.tag_id = s.tag_id
20
+        INNER JOIN ta_meta_image m ON s.image_id = m.image_id
21
+        WHERE
22
+            t.tag_id = #{tagId}
23
+            AND t.`status` = 1
24
+            AND m.`status` = 1
25
+    </select>
12 26
 </mapper>