perf:减少/api/project/getModuleContent数据库交互次数以优化速度
This commit is contained in:
@@ -2,8 +2,11 @@ package com.ai.da.mapper.primary;
|
||||
|
||||
import com.ai.da.common.config.mybatis.plus.CommonMapper;
|
||||
import com.ai.da.mapper.primary.entity.UserLikeGroup;
|
||||
import com.ai.da.mapper.primary.entity.CollectionElementRelModel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Mapper 接口
|
||||
@@ -16,4 +19,57 @@ public interface UserLikeGroupMapper extends CommonMapper<UserLikeGroup> {
|
||||
Long insertUserLikeGroup(UserLikeGroup userLikeGroup);
|
||||
|
||||
List<UserLikeGroup> getMoreThan50UserLikeAccount();
|
||||
|
||||
/**
|
||||
* 批量查询模块内容,使用JOIN优化避免N+1查询
|
||||
* @param userLikeGroupId 用户喜欢组ID
|
||||
* @param projectId 项目ID
|
||||
* @param relationTypes 关联类型列表
|
||||
* @return 模块内容映射列表
|
||||
*/
|
||||
List<Map<String, Object>> getModuleContentBatch(@Param("userLikeGroupId") Long userLikeGroupId,
|
||||
@Param("projectId") Long projectId,
|
||||
@Param("relationTypes") List<String> relationTypes);
|
||||
|
||||
/**
|
||||
* 批量查询ToProductImageResult及相关数据
|
||||
* @param projectId 项目ID
|
||||
* @param resultType 结果类型
|
||||
* @return ToProductImageResult及相关数据列表
|
||||
*/
|
||||
List<Map<String, Object>> getToProductImageResultBatch(@Param("projectId") Long projectId,
|
||||
@Param("resultType") String resultType);
|
||||
|
||||
/**
|
||||
* 批量查询UserLike及相关设计数据
|
||||
* @param relationIds 关联ID列表
|
||||
* @return UserLike及相关数据列表
|
||||
*/
|
||||
List<Map<String, Object>> getUserLikeBatch(@Param("relationIds") List<Long> relationIds);
|
||||
|
||||
/**
|
||||
* 批量查询ToProductElement数据
|
||||
* @param elementIds 元素ID列表
|
||||
* @return ToProductElement数据列表
|
||||
*/
|
||||
List<Map<String, Object>> getToProductElementBatch(@Param("elementIds") List<Long> elementIds);
|
||||
|
||||
/**
|
||||
* 批量查询TDesignPythonOutfit数据
|
||||
* @param outfitIds 服装ID列表
|
||||
* @return TDesignPythonOutfit数据列表
|
||||
*/
|
||||
List<Map<String, Object>> getDesignPythonOutfitBatch(@Param("outfitIds") List<Long> outfitIds);
|
||||
|
||||
/**
|
||||
* 批量查询ToProductImageRecord数据
|
||||
* @param recordIds ToProductImageRecord ID列表
|
||||
* @return 查询结果
|
||||
*/
|
||||
List<Map<String, Object>> getToProductImageRecordBatch(@Param("recordIds") List<Long> recordIds);
|
||||
|
||||
/**
|
||||
* 批量查询CollectionElementRelModel
|
||||
*/
|
||||
List<CollectionElementRelModel> getCollectionElementRelModelBatch(@Param("collectionElementIds") List<Long> collectionElementIds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user