修复Salon订单审核Mapper重复映射

This commit is contained in:
2026-11-02 21:48:18 +08:00
parent eec4507aad
commit 506fd8273f
3 changed files with 26 additions and 1 deletions
@@ -35,7 +35,7 @@ public interface OrderArtistReviewMapper extends BaseMapper<OrderArtistReviewDO>
+ "AND p.is_delete = 0 AND p.front_visible = 1 AND p.moderation_status = 'APPROVED' "
+ "AND s.is_delete = 0 AND s.status = 1 AND s.moderation_status = 'APPROVED' "
+ "AND FIND_IN_SET(#{fileId}, REPLACE(COALESCE(r.image_file_ids, ''), ' ', '')) > 0")
Long countPublicImageReference(@Param("reviewId") Long reviewId, @Param("fileId") Long fileId);
Long countPublicImageReferenceByReviewId(@Param("reviewId") Long reviewId, @Param("fileId") Long fileId);
@Select("SELECT COUNT(1) FROM t_order_artist_review r "
+ "LEFT JOIN t_product p ON p.id = r.product_id "
@@ -0,0 +1,18 @@
package com.xiaowang.jayucloud.salon.core.modules.order.mapper;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
class OrderArtistReviewMapperMappingTest {
@Test
void registersReviewScopedAndGlobalImageReferenceStatementsSeparately() {
MybatisConfiguration configuration = new MybatisConfiguration();
configuration.addMapper(OrderArtistReviewMapper.class);
String mapperName = OrderArtistReviewMapper.class.getName();
assertTrue(configuration.hasStatement(mapperName + ".countPublicImageReferenceByReviewId"));
assertTrue(configuration.hasStatement(mapperName + ".countPublicImageReference"));
}
}