|
@@ -1,13 +1,22 @@
|
|
|
package com.keao.edu.user.service.impl;
|
|
|
|
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
+import com.keao.edu.common.page.PageInfo;
|
|
|
+import com.keao.edu.common.page.QueryInfo;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
import com.keao.edu.user.dao.ExamSongDao;
|
|
|
import com.keao.edu.user.entity.ExamSong;
|
|
|
import com.keao.edu.user.service.ExamSongService;
|
|
|
+import com.keao.edu.util.collection.MapUtil;
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Service
|
|
|
public class ExamSongServiceImpl extends BaseServiceImpl<Integer, ExamSong> implements ExamSongService {
|
|
|
|
|
@@ -18,5 +27,21 @@ public class ExamSongServiceImpl extends BaseServiceImpl<Integer, ExamSong> impl
|
|
|
public BaseDAO<Integer, ExamSong> getDAO() {
|
|
|
return examSongDao;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<ExamSong> queryPage(QueryInfo queryInfo) {
|
|
|
+ PageInfo<ExamSong> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<ExamSong> dataList = new ArrayList<>();
|
|
|
+ int count = this.findCount(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = this.getDAO().queryPage(params);
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|