1.sql执行语句

S
This commit is contained in:
weiyunlong 2025-03-15 17:04:43 +08:00
parent 5eed27267e
commit da903c9729
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package shkd.repc.recon.formplugin;
import kd.bos.db.DB;
import kd.bos.db.DBRoute;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.plugin.AbstractFormPlugin;
public class TestDBFormPlugin extends AbstractFormPlugin {
@Override
public void afterDoOperation(AfterDoOperationEventArgs e) {
super.afterDoOperation(e);
if("qeug_btnok".equals(e.getOperateKey())){
String dbnum = (String) this.getModel().getValue("qeug_dbnum");//标识
String sql = (String) this.getModel().getValue("qeug_sqls");//sql语句
try{
DB.update(DBRoute.of(dbnum), sql,null);
}catch(Exception ex){
this.getView().showMessage("执行失败:" + ex.getMessage());
}
this.getView().showSuccessNotification("执行成功");
}
}
}