组织机构

This commit is contained in:
吕金泽
2022-01-09 22:13:45 +08:00
parent 02cd4e7986
commit 33f76b8803
16 changed files with 759 additions and 150 deletions
@@ -0,0 +1,45 @@
{
"properties" : { },
"id" : "9817f2dbbc20419298e07bc644387f91",
"script" : null,
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "上移",
"createTime" : null,
"updateTime" : 1641564601649,
"lock" : "0",
"method" : "GET",
"path" : "/sort/up",
"parameters" : [ ],
"option" : "[]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null,
"optionMap" : { }
}
================================
var top = db.selectOne("""
SELECT
id,
sort
FROM
sys_menu
WHERE
is_del = 0
AND pid = #{pid}
AND sort < ( SELECT sort FROM sys_menu WHERE is_del = 0 AND id = #{id} )
ORDER BY
sort DESC
LIMIT 1
""")
if(top){
db.update("""
update sys_menu set sort = #{top.sort} where id = #{id}
""")
db.update("""
update sys_menu set sort = #{sort} where id = #{top.id}
""")
}
@@ -0,0 +1,45 @@
{
"properties" : { },
"id" : "77d393db826d4ba882b7c4b1d32e2e98",
"script" : null,
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "下移",
"createTime" : null,
"updateTime" : 1641564596885,
"lock" : "0",
"method" : "GET",
"path" : "/sort/down",
"parameters" : [ ],
"option" : "[]",
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null,
"optionMap" : { }
}
================================
var top = db.selectOne("""
SELECT
id,
sort
FROM
sys_menu
WHERE
is_del = 0
AND pid = #{pid}
AND sort > ( SELECT sort FROM sys_menu WHERE is_del = 0 AND id = #{id} )
ORDER BY
sort
LIMIT 1
""")
if(top){
db.update("""
update sys_menu set sort = #{top.sort} where id = #{id}
""")
db.update("""
update sys_menu set sort = #{sort} where id = #{top.id}
""")
}
@@ -4,8 +4,8 @@
"script" : null,
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "获取排序号",
"createTime" : 1634724871167,
"updateTime" : 1634724871167,
"createTime" : null,
"updateTime" : 1641732167291,
"lock" : "0",
"method" : "GET",
"path" : "/sort",
@@ -33,4 +33,6 @@
"optionMap" : { }
}
================================
return db.selectInt("""select max(sort) + 10 from sys_menu where pid = #{pid} and is_del = '0'""") || 10;
return db.selectInt("""
select max(sort) + 10 from sys_menu where pid = #{pid} and is_del = '0'
""") || 10;