WzHouseUseServiceImpl.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package com.example.service.impl;
  2. import com.example.dao.WzHouseUseDao;
  3. import com.example.entity.OtnAreaEntity;
  4. import com.example.entity.WzHouseUseEntity;
  5. import com.example.service.WzHouseUseService;
  6. import com.example.service.WzOtnAreaService;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.stereotype.Service;
  9. import java.util.List;
  10. import java.util.Map;
  11. @Service
  12. public class WzHouseUseServiceImpl implements WzHouseUseService {
  13. @Autowired
  14. private WzOtnAreaService otnAreaService;
  15. @Autowired
  16. private WzHouseUseDao wzHouseUseDao;
  17. @Override
  18. public List<WzHouseUseEntity> queryList(Map<String, Object> map) {
  19. dealMap(map);
  20. return wzHouseUseDao.queryList(map);
  21. }
  22. @Override
  23. public int queryTotal(Map<String, Object> map) {
  24. dealMap(map);
  25. return wzHouseUseDao.queryTotal(map);
  26. }
  27. public void dealMap(Map<String, Object> map){
  28. if(map.get("city")!=null&&!map.get("city").toString().equals("全省")&&!map.get("city").toString().equals("")){
  29. OtnAreaEntity city = otnAreaService.queryObjectById(map.get("city").toString());
  30. map.put("city",city.getName());
  31. }
  32. if(map.get("city")!=null&&map.get("city").toString().equals("全省")){
  33. map.remove("city");
  34. }
  35. if(map.get("city")!=null&&map.get("city").toString().equals("")){
  36. map.remove("city");
  37. }
  38. if(map.get("county")!=null&&!map.get("county").toString().equals("区县")&&!map.get("county").toString().equals("")){
  39. OtnAreaEntity city = otnAreaService.queryObjectById(map.get("county").toString());
  40. map.put("county",city.getName());
  41. }
  42. if(map.get("county")!=null&&map.get("county").toString().equals("区县")){
  43. map.remove("county");
  44. }
  45. if(map.get("county")!=null&&map.get("county").toString().equals("")){
  46. map.remove("county");
  47. }
  48. if(map.get("statisticalMonth")!=null&&!map.get("statisticalMonth").toString().equals("")&&!map.get("statisticalMonth").toString().equals("账期")){
  49. map.put("statisticalMonth",Integer.valueOf(map.get("statisticalMonth").toString()));
  50. }else{
  51. map.remove("statisticalMonth");
  52. }
  53. }
  54. }