| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package com.goafanti.admin.service.impl;
- import java.util.HashMap;
- import java.util.Map;
- import org.springframework.stereotype.Service;
- import com.goafanti.admin.bo.BusinessBo;
- import com.goafanti.core.mybatis.BaseMybatisDao;
- import com.goafanti.core.mybatis.page.Pagination;
- import com.goafanti.admin.service.BusinessService;
- import com.goafanti.common.dao.AchievementMapper;
- @Service
- public class BusinessServiceImpl extends BaseMybatisDao<AchievementMapper> implements BusinessService {
- @SuppressWarnings("unchecked")
- @Override
- public Pagination<BusinessBo> listBusiness(String cname, Integer super_id, Integer layer, Integer status, Integer pNo,
- Integer pSize,Integer hot) {
- Map<String, Object> params=disposeParams(cname,super_id,layer,status,hot);
- if (pNo == null || pNo < 0) {
- pNo = 1;
- }
- if (pSize == null || pSize < 0 || pSize > 10) {
- pSize = 10;
- }
- return (Pagination<BusinessBo>) findPage("findBusinessVarietiesListByPage",
- "findBusinessVarietiesCount",params,
- pNo, pSize);
- };
-
- private Map<String, Object> disposeParams(String cname, Integer super_id, Integer layer, Integer status,Integer hot) {
- Map<String, Object> params = new HashMap<>();
- if (null!=cname) {
- params.put("cname", cname);
- }
- if (null!=super_id) {
- params.put("super_id", super_id);
- }
- if (null!=layer) {
- params.put("layer", layer);
- }
- if (null!=status) {
- params.put("status", status);
- }
- if (null!=hot) {
- params.put("hot", hot);
- }
- return params;
- }
- }
|