|
|
@@ -1,19 +1,25 @@
|
|
|
package com.goafanti.LectureUser.service.impl;
|
|
|
|
|
|
import java.util.Calendar;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.goafanti.LectureUser.bo.LectureUserListBo;
|
|
|
import com.goafanti.LectureUser.service.LectureUserService;
|
|
|
import com.goafanti.common.dao.LectureUserMapper;
|
|
|
import com.goafanti.common.model.LectureUser;
|
|
|
import com.goafanti.common.model.LectureUserKey;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
+import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
|
|
|
@Service
|
|
|
-public class LectureUserServiceImpl implements LectureUserService {
|
|
|
+public class LectureUserServiceImpl extends BaseMybatisDao<LectureUserMapper> implements LectureUserService {
|
|
|
@Autowired
|
|
|
private LectureUserMapper lectureUserMapper;
|
|
|
|
|
|
@@ -46,4 +52,60 @@ public class LectureUserServiceImpl implements LectureUserService {
|
|
|
public LectureUser selectByPrimaryKey(LectureUserKey key) {
|
|
|
return lectureUserMapper.selectByPrimaryKey(key);
|
|
|
}
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<LectureUserListBo> listLectureUser(String lectureName, String mobile, String username,
|
|
|
+ Integer number, Integer pSize, Integer pNo) {
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
+ pSize = 10;
|
|
|
+ }
|
|
|
+ return (Pagination<LectureUserListBo>) findPage("findActivityUserListByPage", "findActivityUserCount",
|
|
|
+ disposeLectureList(lectureName, mobile, number, username, null), pNo, pSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<LectureUserListBo> listLectureOrg(String lectureName, String mobile, String unitName,
|
|
|
+ Integer number, Integer pSize, Integer pNo) {
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
+ pSize = 10;
|
|
|
+ }
|
|
|
+ return (Pagination<LectureUserListBo>) findPage("findActivityOrgListByPage", "findActivityOrgCount",
|
|
|
+ disposeLectureList(lectureName, mobile, number, null, unitName), pNo, pSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> disposeLectureList(String lectureName, String mobile, Integer number, String username,
|
|
|
+ String unitName) {
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(mobile)) {
|
|
|
+ params.put("mobile", mobile);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != number) {
|
|
|
+ params.put("number", number);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(lectureName)) {
|
|
|
+ params.put("lectureName", lectureName);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(username)) {
|
|
|
+ params.put("username", username);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(unitName)) {
|
|
|
+ params.put("unitName", unitName);
|
|
|
+ }
|
|
|
+ return params;
|
|
|
+ }
|
|
|
}
|