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);
@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);