BUGFIX:1. 排序优化,添加唯一约束和重试
2.like前先查询是否有被like
This commit is contained in:
@@ -22,4 +22,22 @@ public interface CollectionSortMapper extends CommonMapper<CollectionSort> {
|
||||
@Select("SELECT * FROM collection_sort WHERE parent_id IN (SELECT id FROM collection_sort WHERE relation_id = #{relationId})")
|
||||
List<CollectionSort> queryCollectionSortsIsNotDesignByUserLikeRelationId(@Param("relationId") Long relationId);
|
||||
|
||||
@Update({
|
||||
"<script>",
|
||||
"UPDATE collection_sort",
|
||||
"SET sort = sort - 1",
|
||||
"WHERE project_id = #{projectId}",
|
||||
"AND sort > #{deletedSort}",
|
||||
"<if test='parentId != null'>",
|
||||
"AND parent_id = #{parentId}",
|
||||
"</if>",
|
||||
"<if test='parentId == null'>",
|
||||
"AND parent_id IS NULL",
|
||||
"</if>",
|
||||
"</script>"
|
||||
})
|
||||
void decrementSortAfterDelete(@Param("projectId") Long projectId,
|
||||
@Param("parentId") Long parentId,
|
||||
@Param("deletedSort") int deletedSort);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user