BUGFIX:design中的排序问题 倒序问题 再次修改
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user