代码如下:运行正常但结果集为空,生成的sql直接复制到数据库工具中可以查出结果,求解:js\n
public QueryResult getCoursewareList(int curPage, int pageSize, String courseId, String... type){
String sqlStr = "select a.ID,a.FILE_ID,a.TITLE,b.EXTENSION,b.FILE_SIZE,b.PLAY_URL,b.DOWNLOAD_URL from COURSE_COURSEWARE_NEW a,RESOURCES_MAPPING_NEW b where a.FILE_ID = b.FILE_ID and a.COURSE_ID = b.COURSE_ID and a.COURSE_ID = @courseId";
if(!Lang.isEmpty(type)){
sqlStr = sqlStr + " and b.EXTENSION in(@type)";
}
sqlStr = sqlStr + " order by b.REG_DATE";
Sql sql = Sqls.create(sqlStr);
sql.params().set("courseId", courseId);
if(!Lang.isEmpty(type)){
sql.params().set("type", type);
}
sql.setCallback(Sqls.callback.records());
Pager pager = this.nutDao.createPager(curPage, pageSize);
pager.setRecordCount((int) Daos.queryCount(this.nutDao, sql.toString()));
sql.setPager(pager);
this.nutDao.execute(sql);
return new QueryResult(sql.getList(Record.class), pager);
}
\n
添加回复
请先登陆