BusinessServiceImpl.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package com.goafanti.admin.service.impl;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import org.springframework.stereotype.Service;
  5. import com.goafanti.admin.bo.BusinessBo;
  6. import com.goafanti.core.mybatis.BaseMybatisDao;
  7. import com.goafanti.core.mybatis.page.Pagination;
  8. import com.goafanti.admin.service.BusinessService;
  9. import com.goafanti.common.dao.AchievementMapper;
  10. @Service
  11. public class BusinessServiceImpl extends BaseMybatisDao<AchievementMapper> implements BusinessService {
  12. @SuppressWarnings("unchecked")
  13. @Override
  14. public Pagination<BusinessBo> listBusiness(String cname, Integer super_id, Integer layer, Integer status, Integer pNo,
  15. Integer pSize,Integer hot) {
  16. Map<String, Object> params=disposeParams(cname,super_id,layer,status,hot);
  17. if (pNo == null || pNo < 0) {
  18. pNo = 1;
  19. }
  20. if (pSize == null || pSize < 0 || pSize > 10) {
  21. pSize = 10;
  22. }
  23. return (Pagination<BusinessBo>) findPage("findBusinessVarietiesListByPage",
  24. "findBusinessVarietiesCount",params,
  25. pNo, pSize);
  26. };
  27. private Map<String, Object> disposeParams(String cname, Integer super_id, Integer layer, Integer status,Integer hot) {
  28. Map<String, Object> params = new HashMap<>();
  29. if (null!=cname) {
  30. params.put("cname", cname);
  31. }
  32. if (null!=super_id) {
  33. params.put("super_id", super_id);
  34. }
  35. if (null!=layer) {
  36. params.put("layer", layer);
  37. }
  38. if (null!=status) {
  39. params.put("status", status);
  40. }
  41. if (null!=hot) {
  42. params.put("hot", hot);
  43. }
  44. return params;
  45. }
  46. }