@Override
public DataListPage
String mainStoreId = BusinessUtils.getMainStoreId(branchStoreId);
String listHql = CONSTRUCTOR
+ " FROM TCmsLesson cl, TCmsLessonStoreRel r"
+ " WHERE cl.firstClass = :firstClass"
+ " AND cl.isValid = 1"
+ " AND cl.id = r.lessonId"
+ " AND r.storeId in (:mainStoreId , :branchStoreId , '0000000')";
String countHql = "SELECT COUNT(cl.id) FROM"
+ " TCmsLesson cl, TCmsLessonStoreRel r"
+ " WHERE cl.firstClass = :firstClass"
+ " AND cl.isValid = 1"
+ " AND cl.id = r.lessonId"
+ " AND r.storeId in (:mainStoreId , :branchStoreId , '0000000')";
dataListParams.setDateParam("cl.createDate");
return super.getDataListPageByHql(listHql, countHql, dataListParams, firstClass, mainStoreId, branchStoreId);
}
private List<T> listDataByHql(String hql, DataListParams dataListParams, Object... values) {
if (StringUtils.isNotEmpty(dataListParams.getBeginTime())
&& StringUtils.isNotEmpty(dataListParams.getEndTime())) {
hql = hql + " AND " + dataListParams.getDateParam() + " BETWEEN '" + dataListParams.getBeginTime()
+ "' AND '" + dataListParams.getEndTime() + "'";
} else if (StringUtils.isNotEmpty(dataListParams.getBeginTime())) {
hql = hql + " AND " + dataListParams.getDateParam() + " >= '" + dataListParams.getBeginTime() + "'";
} else if (StringUtils.isNotEmpty(dataListParams.getEndTime())) {
hql = hql + " AND " + dataListParams.getDateParam() + " <= '" + dataListParams.getEndTime() + "'";
}
if (StringUtils.isNotEmpty(dataListParams.getOrderBy())) {
hql = hql + " ORDER BY " + dataListParams.getOrderBy();
}
if (dataListParams.isDesc()) {
hql = hql + " DESC";
}
if (dataListParams.getPage() != null) {
return this.listByPage(hql, dataListParams.getPage(), values);
} else {
return dataListParams.getSize() == 0
? this.listByParamsAndPosition(hql, dataListParams.getStartPosition(), values)
: this.listBySizeAndPosition(hql, dataListParams.getSize(), dataListParams.getStartPosition(),
values);
}
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.