parent
17ba8fc88b
commit
0b2af4b9d4
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.execsql.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.hzya.frame.datasource.DataSourceUtil;
|
||||
import com.hzya.frame.execsql.entity.ExecSqlEntity;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
@ -79,15 +80,15 @@ public class ExecSqlServiceImpl implements IExecSqlService {
|
|||
*/
|
||||
@Override
|
||||
public int execUpdateSql(String sql, String data_source_code) throws Exception {
|
||||
logger.info("=============进入execUpdateSql方法============");
|
||||
if (ObjectUtils.isEmpty(sql)) {
|
||||
logger.info("=============进入execUpdateSql方法============{},{}",sql,data_source_code);
|
||||
if (StrUtil.isNotEmpty(sql)) {
|
||||
if (sql.contains("where") || sql.contains("WHERE")) {
|
||||
// SqlSession sqlSession = getSqlSession(data_source_code);
|
||||
// SqlSession sqlSession = new DataSourceUtil().getDefaultSqlSession();
|
||||
logger.info("=============execUpdateSql方法要执行的sql:============" + sql);
|
||||
ExecSqlEntity entity = new ExecSqlEntity();
|
||||
entity.setSql(sql);
|
||||
int result = sqlSession.update("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
|
||||
int result = sqlSession.update("com.hzya.frame.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
|
||||
logger.info("update受影响行数:" + result);
|
||||
//sqlSession.close();
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue