jeecg在controller中执行sql

1.引入
@Autowired
JdbcDao jdbcDao;
2.代码
String sqlForLive = "select * from live where user_id='"+id+"' and id !='"+liveId+"'";


List<ApiLiveEntity> liveList = jdbcDao.find(sqlForLive,ApiLiveEntity.class,null);


String updateSql = "UPDATE live SET live_state=0 where user_id='"+id+"' and id !='"+liveId+"'";


jdbcDao.executeSql(updateSql);
————————————————
版权声明:本文为CSDN博主「昊天卍上帝」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qianyesoft001/java/article/details/77035724

原文地址:https://www.cnblogs.com/Jeely/p/12613734.html