package com.example.service.impl; import com.example.dao.WzLandManageDetailsDao; import com.example.entity.OtnAreaEntity; import com.example.entity.WzLandManageDetailsEntity; import com.example.entity.vo.floormanager.FloorNoUserVo; import com.example.service.WzLandManageDetailsService; import com.example.service.WzOtnAreaService; import com.example.utils.Query; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; @Service public class WzLandManageDetailsServiceImpl implements WzLandManageDetailsService { @Autowired private WzOtnAreaService otnAreaService; @Autowired private WzLandManageDetailsDao wzLandManageDetailsDao; @Override public List queryList(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("")) { String date = map.get("statisticalMonth").toString(); date = date.substring(0, 4) + "-" + date.substring(4) + "-" + "01"; map.put("statisticalMonth", date); } else { map.remove("statisticalMonth"); } return wzLandManageDetailsDao.queryList(map); } @Override public int queryTotal(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("")) { String date = map.get("statisticalMonth").toString(); date = date.substring(0, 4) + "-" + date.substring(4) + "-" + "01"; map.put("statisticalMonth", date); } else { map.remove("statisticalMonth"); } return wzLandManageDetailsDao.queryTotal(map); } @Override public List queryLeaveUseList(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("")) { String date = map.get("statisticalMonth").toString(); date = date.substring(0, 4) + "-" + date.substring(4) + "-" + "01"; map.put("statisticalMonth", date); } else { map.remove("statisticalMonth"); } return wzLandManageDetailsDao.queryLeaveUseList(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("账期")) { String date = map.get("statisticalMonth").toString(); date = date.substring(0, 4) + "-" + date.substring(4) + "-" + "01"; map.put("statisticalMonth", date); } else { map.remove("statisticalMonth"); } } @Override public List getBuildingNameAlias(Map map) { dealMap(map); return wzLandManageDetailsDao.getBuildingNameAlias(map); } @Override public List getBuildingNameCode(Query query) { dealMap(query); return wzLandManageDetailsDao.getBuildingNameCode(query); } @Override public int queryBuildingNameCodeTotal(Query query1) { dealMap(query1); return wzLandManageDetailsDao.getBuildingNameAliasTotal(query1); } @Override public int getBuildingNameAliasTotal(Query query1) { dealMap(query1); return wzLandManageDetailsDao.queryBuildingNameCodeTotal(query1); } }