企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 组件源码 /** * <b>方法描述:</b> 数据删除 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-04-17 16:36:47 <br/> * @param poolName 入参|数据源,为空使用默认|{@link java.lang.String} * @param tableName 入参|表名String|{@link java.lang.String} * @param condition 入参|条件的值JavaList,如:["列","=",值]或[["列1","=",值1,"and"],["列2","<",值2]]|{@link com.ylink.ide.trade.runtime.context.JavaList} * @param commitFlg 入参|提交标识Boolean|{@link boolean} * @param rows 出参|执行插入影响的条数int|{@link int} * @return -1 异常<br/>1 成功<br/> */ @Component(label = "数据删除", style = "判断型", type = "同步组件", comment = "用预编译的方式删除指定条件的记录,其中条件语句的值用法为:[[\"COL1\",\"=\",VAL1,\"AND\"],[\"COL2\",\"!=\",VAL2,null]] = COL1=VAL1 AND COL2=VAL2", version = "1.0.0", deprecated = false, author = "admin", date = "2018-04-17 04:36:47") @InParams(param = { @Param(name = "poolName", comment = "数据源,为空使用默认", type = java.lang.String.class), @Param(name = "tableName", comment = "表名String", type = java.lang.String.class), @Param(name = "condition", comment = "条件的值JavaList,如:[\"列\",\"=\",值]或[[\"列1\",\"=\",值1,\"and\"],[\"列2\",\"<\",值2]]", type = com.ylink.ide.trade.runtime.context.JavaList.class), @Param(name = "commitFlg", comment = "提交标识Boolean", type = boolean.class) }) @OutParams(param = { @Param(name = "rows", comment = "执行插入影响的条数int", type = int.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_preparedDelete(String poolName, String tableName, JavaList condition, boolean commitFlg) { try { return ResultBase.newSuccessResult(JdbcUtil.preparedDelete( poolName, tableName, condition, commitFlg)); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTJ0012", "数据删除 异常:" + AppLog.errorMsg(e)); } } 交易中组件使用方式: ![](https://img.kancloud.cn/6a/ff/6aff0988487c781d83d241e0c891d070_1516x1227.png) 数据源的来源为项目的配置文件中的数据源,以及前端页面上的数据源管理列表中添加的数据源 ## 参数说明及示例 表名String:数据库表名,示例: `"sys-user"` 条件的值JavaList:删除条件集合,示例: `[["name","=","张三","or"],["name","=","李四","AND"],["sex","!=",29,null]]` 提交标识Boolean:是否提交判断,填写true或者false,示例: `true` 执行插入影响的条数int:删除条数回显,示例: `__INNER__["result"]` > 注意:填写值如果是String字符串,则需要在前后加上英文双引号"",如果是数字或者boolean值,则不需要