BUGFIX:design中的排序问题
This commit is contained in:
@@ -2,6 +2,28 @@ 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(
|
||||
@Param("parentId") Long parentId,
|
||||
@Param("relationType") String relationType,
|
||||
@Param("originalSort") int originalSort
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,11 +13,9 @@ import java.util.Date;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("collection_sort")
|
||||
public class CollectionSort implements Serializable {
|
||||
public class CollectionSort extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long userLikeGroupId;
|
||||
private Long userLikeId;
|
||||
private Integer sort;
|
||||
|
||||
Reference in New Issue
Block a user