Explorar o código

mapper方法名重复导致错误,修改方法名称

zhangchen hai 3 meses
pai
achega
acfff221ec

+ 1 - 1
alien-entity/src/main/java/shop/alien/mapper/StoreCommentMapper.java

@@ -131,7 +131,7 @@ public interface StoreCommentMapper extends BaseMapper<StoreComment> {
             "AND delete_flag = 0 " +
             "AND reply_id IS NULL" +
             "AND store_id = #{storeId}")
-    Map<String, String> getCommentCountAndScore(@Param("storeId") Integer storeId);
+    Map<String, String> getCommentCountAndScoreInfo(@Param("storeId") Integer storeId);
 
 
     @Select("SELECT " +

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentServiceImpl.java

@@ -576,7 +576,7 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
 
             int i = this.save(storeComment) ? 0 : 1;
 
-            Map<String, String> commentCountAndScore = storeCommentMapper.getCommentCountAndScore(storeId);
+            Map<String, String> commentCountAndScore = storeCommentMapper.getCommentCountAndScoreInfo(storeId);
             double total = StringUtils.isNotEmpty(commentCountAndScore.get("total")) ? Double.parseDouble(commentCountAndScore.get("total")) : 0;
             double scoreAvg = StringUtils.isNotEmpty(commentCountAndScore.get("score")) ? Double.parseDouble(commentCountAndScore.get("score")) / total : 0;
             double tasteScore = StringUtils.isNotEmpty(commentCountAndScore.get("tasteScore")) ? Double.parseDouble(commentCountAndScore.get("tasteScore")) / total : 0;