GlobalSearchService.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.goafanti.common.service;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import org.springframework.stereotype.Service;
  5. import com.goafanti.common.dao.JtCollectSearchMapper;
  6. import com.goafanti.common.model.JtCollectSearch;
  7. import com.goafanti.common.utils.StringUtils;
  8. import com.goafanti.core.mybatis.BaseMybatisDao;
  9. import com.goafanti.core.mybatis.page.Pagination;
  10. @Service
  11. public class GlobalSearchService extends BaseMybatisDao<JtCollectSearchMapper> {
  12. @SuppressWarnings("unchecked")
  13. public Pagination<JtCollectSearch> globalSearchList(String name, Integer pageNo, Integer pageSize) {
  14. Map<String, Object> params = new HashMap<>();
  15. if(StringUtils.isNotBlank(name))params.put("name", name);
  16. if(pageNo==null||pageNo<1)pageNo=1;
  17. if(pageSize==null||pageSize<1)pageSize=10;
  18. return (Pagination<JtCollectSearch>) findPage("globalSearchList", "globalSearchCount", params, pageNo,
  19. pageSize);
  20. }
  21. @SuppressWarnings("unchecked")
  22. public Object AchievementsDemandSearchList(String name, Integer pageNo, Integer pageSize) {
  23. Map<String, Object> params = new HashMap<>();
  24. if(StringUtils.isNotBlank(name))params.put("name", name);
  25. params.put("AchievementDemand", 1);
  26. if(pageNo==null||pageNo<1)pageNo=1;
  27. if(pageSize==null||pageSize<1)pageSize=10;
  28. return (Pagination<JtCollectSearch>) findPage("globalSearchList", "globalSearchCount", params, pageNo,
  29. pageSize);
  30. }
  31. }