package com.example.service.impl; import com.example.dao.WzHouseUseDao; import com.example.entity.OtnAreaEntity; import com.example.entity.WzHouseUseEntity; import com.example.service.WzHouseUseService; import com.example.service.WzOtnAreaService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; @Service public class WzHouseUseServiceImpl implements WzHouseUseService { @Autowired private WzOtnAreaService otnAreaService; @Autowired private WzHouseUseDao wzHouseUseDao; @Override public List queryList(Map map) { dealMap(map); return wzHouseUseDao.queryList(map); } @Override public int queryTotal(Map map) { dealMap(map); return wzHouseUseDao.queryTotal(map); } public void dealMap(Map map){ if(map.get("city")!=null&&!map.get("city").toString().equals("全省")&&!map.get("city").toString().equals("")){ OtnAreaEntity city = otnAreaService.queryObjectById(map.get("city").toString()); map.put("city",city.getName()); } if(map.get("city")!=null&&map.get("city").toString().equals("全省")){ map.remove("city"); } if(map.get("city")!=null&&map.get("city").toString().equals("")){ map.remove("city"); } if(map.get("county")!=null&&!map.get("county").toString().equals("区县")&&!map.get("county").toString().equals("")){ OtnAreaEntity city = otnAreaService.queryObjectById(map.get("county").toString()); map.put("county",city.getName()); } if(map.get("county")!=null&&map.get("county").toString().equals("区县")){ map.remove("county"); } if(map.get("county")!=null&&map.get("county").toString().equals("")){ map.remove("county"); } if(map.get("statisticalMonth")!=null&&!map.get("statisticalMonth").toString().equals("")&&!map.get("statisticalMonth").toString().equals("账期")){ map.put("statisticalMonth",Integer.valueOf(map.get("statisticalMonth").toString())); }else{ map.remove("statisticalMonth"); } } }