修复online占用sql连接的问题,修复逻辑删除没有默认值的问题

This commit is contained in:
dftre 2024-09-04 15:02:39 +08:00
parent 4e3093b801
commit 59208c9c48
2 changed files with 19 additions and 15 deletions

View File

@ -89,6 +89,7 @@ public class OnLineController extends BaseController {
public Object processingMapper(String sqlContext, String actuatot, Map<String, Object> params) {
String sql = "<script>\n" + sqlContext + "\n</script>";
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
SqlMapper sqlMapper = new SqlMapper(sqlSession);
Object res = null;
res = switch (actuatot) {
@ -99,8 +100,11 @@ public class OnLineController extends BaseController {
case "delete" -> toAjax(sqlMapper.delete(sql, params));
default -> AjaxResult.error(500, "系统错误,执行器错误");
};
sqlSession.close();
return res;
} finally {
sqlSession.close();
}
}
@RequestMapping("/api/**")

View File

@ -15,7 +15,7 @@ CREATE TABLE online_mb (
dept_id char(1) NULL COMMENT '是否需要deptId',
permission_type varchar(255) NULL COMMENT '许可类型',
permission_value varchar(255) NULL COMMENT '许可值',
del_flag varchar(10) NOT NULL COMMENT '删除标志0代表存在 1代表删除',
del_flag varchar(10) NOT NULL DEFAULT '0' COMMENT '删除标志0代表存在 1代表删除',
PRIMARY KEY (mb_id)
) ENGINE = InnoDB COMMENT = '在线接口';