BUGFIX:design中的排序问题 倒序问题 再次修改

This commit is contained in:
2025-07-04 19:08:59 +08:00
parent 1b7c2041be
commit 4379b9cff1
10 changed files with 103 additions and 102 deletions

View File

@@ -3,25 +3,14 @@ package com.ai.da.mapper.primary;
import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.CollectionSort;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
public interface CollectionSortMapper extends CommonMapper<CollectionSort> {
@Update("UPDATE collection_sort SET sort = sort + 1 " +
"WHERE project_id = #{projectId} " +
"AND relation_type = #{relationType} " +
"AND sort < #{originalSort}")
void increaseDesignSortBelow(
@Param("projectId") Long projectId,
@Param("relationType") String relationType,
@Param("originalSort") int originalSort
);
@Update("UPDATE collection_sort SET sort = sort + 1 " +
"WHERE parent_id = #{parentId} " +
"AND relation_type != 'Design' " +
"AND sort < #{originalSort}")
void increaseGenerateSortBelow(
"AND sort > #{originalSort}")
void increaseGenerateSortAbove(
@Param("parentId") Long parentId,
@Param("relationType") String relationType,
@Param("originalSort") int originalSort

View File

@@ -18,6 +18,7 @@ public class CollectionSort extends BaseEntity implements Serializable {
private Long userLikeGroupId;
private Long userLikeId;
// 页面排序采用倒序,最新的元素序号最大
private Integer sort;
private Long projectId;
private Long relationId;