old mode 100644
new mode 100755
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.ICommunityServiceDao; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | logger.debug("查询小区信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityInfo", info); |
| | | if (businessCommunityInfos == null) { |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityInfo", info); |
| | | if (infos == null) { |
| | | return null; |
| | | } |
| | | if (businessCommunityInfos.size() > 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:businessCommunityInfos," + JSONObject.toJSONString(info)); |
| | | if (infos.size() > 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:infos," + JSONObject.toJSONString(info)); |
| | | } |
| | | |
| | | return businessCommunityInfos.get(0); |
| | | return infos.get(0); |
| | | } |
| | | |
| | | /** |
| | |
| | | public Map getCommunityInfo(Map info) throws DAOException { |
| | | logger.debug("查询小区信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfo", info); |
| | | if (businessCommunityInfos == null || businessCommunityInfos.size() == 0) { |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfo", info); |
| | | if (infos == null || infos.size() == 0) { |
| | | return null; |
| | | } |
| | | if (businessCommunityInfos.size() > 1) { |
| | | if (infos.size() > 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:getCommunityInfo," + JSONObject.toJSONString(info)); |
| | | } |
| | | |
| | | return businessCommunityInfos.get(0); |
| | | return infos.get(0); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<Map> getCommunityInfoNew(Map info) throws DAOException { |
| | | logger.debug("查询小区信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfoNew", info); |
| | | if (info.get("communityId") != null && !info.get("communityId").equals("")){ |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfoNewMessage", info); |
| | | return infos; |
| | | } |
| | | else{ |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfoNew", info); |
| | | return infos; |
| | | } |
| | | |
| | | return businessCommunityInfos; |
| | | } |
| | | |
| | | /** |
| | |
| | | public int queryCommunitysCount(Map info) { |
| | | logger.debug("查询小区数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.queryCommunitysCount", info); |
| | | if (businessCommunityInfos.size() < 1) { |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.queryCommunitysCount", info); |
| | | if (infos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessCommunityInfos.get(0).get("count").toString()); |
| | | return Integer.parseInt(infos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | @Override |
| | | public int getCommunityAttrsCount(Map info) { |
| | | logger.debug("查询小区数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityAttrsCount", info); |
| | | if (businessCommunityInfos.size() < 1) { |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityAttrsCount", info); |
| | | if (infos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessCommunityInfos.get(0).get("count").toString()); |
| | | return Integer.parseInt(infos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> getStoreCommunitys(Map info) { |
| | | logger.debug("查询小区信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getStoreCommunitys", info); |
| | | List<Map> infos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getStoreCommunitys", info); |
| | | |
| | | return businessCommunityInfos; |
| | | return infos; |
| | | } |
| | | |
| | | @Override |
| | | public int saveCommunityAttr(Map info) { |
| | | logger.debug("小区成员加入Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityAttr", info); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<CommunityDto> getCommunitys() { |
| | | List<CommunityDto> communityDtos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunitys"); |
| | | |
| | | return communityDtos; |
| | | } |
| | | |
| | | |