瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

zhangchen 3 周之前
父節點
當前提交
3167e6efa6

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/TagsMainVo.java

@@ -16,7 +16,7 @@ import shop.alien.entity.store.TagsMain;
 public class TagsMainVo extends TagsMain {
 
     @ApiModelProperty(value = "评价数量")
-    private Integer evaluateNumber;
+    private String evaluateNumber;
 
 
 

+ 7 - 4
alien-entity/src/main/java/shop/alien/mapper/TagsMainMapper.java

@@ -3,6 +3,7 @@ package shop.alien.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import shop.alien.entity.store.TagsMain;
 import shop.alien.entity.store.vo.TagsMainVo;
@@ -40,12 +41,13 @@ public interface TagsMainMapper extends BaseMapper<TagsMain> {
     })
     int insertBatchTagsMain(List<TagsMain> tagsMainList);
 
-    @Select("SELECT\n" +
+    @Select("<script>" +
+            "SELECT\n" +
             "    main.id,\n" +
             "    main.tag_name,\n" +
             "    main.store_id,\n" +
             "    main.tag_type,\n" +
-            "    COUNT(DISTINCT synonym.comment_id) AS evaluateNumber\n" +
+            "    IFNULL(GROUP_CONCAT(DISTINCT synonym.comment_id ORDER BY synonym.comment_id SEPARATOR ','), '') AS evaluateNumber\n" +
             "FROM\n" +
             "    tags_main main\n" +
             "    LEFT JOIN tags_synonym synonym \n" +
@@ -55,6 +57,7 @@ public interface TagsMainMapper extends BaseMapper<TagsMain> {
             "    main.store_id = #{storeId} \n" +
             "    AND main.delete_flag = 0\n" +
             "GROUP BY\n" +
-            "    main.id")
-    List<TagsMainVo> getStoreEvaluateTags(int storeId);
+            "    main.id" +
+            "</script>")
+    List<TagsMainVo> getStoreEvaluateTags(Integer storeId);
 }

+ 3 - 3
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -735,10 +735,10 @@ public class StoreInfoController {
     @ApiOperation(value = "AI服务-门店评价标签")
     @GetMapping("/getStoreEvaluateTags")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "int", paramType = "query")
+            @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "int", paramType = "query", required = true)
     })
-    public R<List<TagsMainVo>> getStoreEvaluateTags(int storeId) {
-        log.info("StoreInfoController.getStoreEvaluateTags?storeId={}", storeId);
+    public R<List<TagsMainVo>> getStoreEvaluateTags(@RequestParam("storeId") int storeId) {
+        log.info("StoreInfoController.getStoreEvaluateTags?storeId={}, tagType={}", storeId);
         List<TagsMainVo> voList = tagsMainMapper.getStoreEvaluateTags(storeId);
         return R.data(voList);
     }