From 7e3a731b960455b16016c3c4e2e727caa8190bb0 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 01 六月 2020 12:03:04 +0800
Subject: [PATCH] 优化查询小区多条是报错问题

---
 CommunityService/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java |  287 ++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 190 insertions(+), 97 deletions(-)

diff --git a/CommunityService/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java b/CommunityService/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java
index 2018ccf..2b3fc36 100644
--- a/CommunityService/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java
+++ b/CommunityService/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java
@@ -1,11 +1,11 @@
 package com.java110.community.dao.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.common.constant.ResponseConstant;
-import com.java110.common.exception.DAOException;
-import com.java110.common.util.DateUtil;
-import com.java110.core.base.dao.BaseServiceDao;
 import com.java110.community.dao.ICommunityServiceDao;
+import com.java110.core.base.dao.BaseServiceDao;
+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 org.springframework.stereotype.Service;
@@ -21,10 +21,11 @@
 //@Transactional
 public class CommunityServiceDaoImpl extends BaseServiceDao implements ICommunityServiceDao {
 
-    private final static Logger logger = LoggerFactory.getLogger(CommunityServiceDaoImpl.class);
+    private static Logger logger = LoggerFactory.getLogger(CommunityServiceDaoImpl.class);
 
     /**
      * 灏忓尯淇℃伅灏佽
+     *
      * @param businessCommunityInfo 灏忓尯淇℃伅 灏佽
      * @throws DAOException
      */
@@ -32,16 +33,17 @@
     public void saveBusinessCommunityInfo(Map businessCommunityInfo) throws DAOException {
         businessCommunityInfo.put("month", DateUtil.getCurrentMonth());
         // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
-        logger.debug("淇濆瓨灏忓尯淇℃伅 鍏ュ弬 businessCommunityInfo : {}",businessCommunityInfo);
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityInfo",businessCommunityInfo);
+        logger.debug("淇濆瓨灏忓尯淇℃伅 鍏ュ弬 businessCommunityInfo : {}", businessCommunityInfo);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityInfo", businessCommunityInfo);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessCommunityInfo));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessCommunityInfo));
         }
     }
 
     /**
      * 灏忓尯灞炴�т俊鎭垎瑁�
+     *
      * @param businessCommunityAttr 灏忓尯灞炴�т俊鎭皝瑁�
      * @throws DAOException
      */
@@ -49,51 +51,54 @@
     public void saveBusinessCommunityAttr(Map businessCommunityAttr) throws DAOException {
         businessCommunityAttr.put("month", DateUtil.getCurrentMonth());
         // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
-        logger.debug("淇濆瓨灏忓尯灞炴�т俊鎭� 鍏ュ弬 businessCommunityAttr : {}",businessCommunityAttr);
+        logger.debug("淇濆瓨灏忓尯灞炴�т俊鎭� 鍏ュ弬 businessCommunityAttr : {}", businessCommunityAttr);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityAttr",businessCommunityAttr);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityAttr", businessCommunityAttr);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(businessCommunityAttr));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯灞炴�ф暟鎹け璐ワ細" + JSONObject.toJSONString(businessCommunityAttr));
         }
     }
 
     /**
      * 淇濆瓨灏忓尯鐓х墖淇℃伅
+     *
      * @param businessCommunityPhoto 灏忓尯鐓х墖
      * @throws DAOException
      */
     @Override
     public void saveBusinessCommunityPhoto(Map businessCommunityPhoto) throws DAOException {
         businessCommunityPhoto.put("month", DateUtil.getCurrentMonth());
-        logger.debug("淇濆瓨灏忓尯鐓х墖淇℃伅 鍏ュ弬 businessCommunityPhoto : {}",businessCommunityPhoto);
+        logger.debug("淇濆瓨灏忓尯鐓х墖淇℃伅 鍏ュ弬 businessCommunityPhoto : {}", businessCommunityPhoto);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityPhoto",businessCommunityPhoto);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityPhoto", businessCommunityPhoto);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯鐓х墖鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessCommunityPhoto));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鐓х墖鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessCommunityPhoto));
         }
     }
 
     /**
      * 淇濆瓨灏忓尯璇佷欢淇℃伅
+     *
      * @param businessCommunityCerdentials 灏忓尯璇佷欢
      * @throws DAOException
      */
     @Override
     public void saveBusinessCommunityCerdentials(Map businessCommunityCerdentials) throws DAOException {
         businessCommunityCerdentials.put("month", DateUtil.getCurrentMonth());
-        logger.debug("淇濆瓨灏忓尯璇佷欢淇℃伅 鍏ュ弬 businessCommunityCerdentials : {}",businessCommunityCerdentials);
+        logger.debug("淇濆瓨灏忓尯璇佷欢淇℃伅 鍏ュ弬 businessCommunityCerdentials : {}", businessCommunityCerdentials);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityCerdentials",businessCommunityCerdentials);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityCerdentials", businessCommunityCerdentials);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯璇佷欢鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessCommunityCerdentials));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯璇佷欢鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessCommunityCerdentials));
         }
     }
 
     /**
      * 鏌ヨ灏忓尯淇℃伅
+     *
      * @param info bId 淇℃伅
      * @return 灏忓尯淇℃伅
      * @throws DAOException
@@ -101,14 +106,14 @@
     @Override
     public Map getBusinessCommunityInfo(Map info) throws DAOException {
 
-        logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityInfo",info);
-        if(businessCommunityInfos == null){
+        List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityInfo", info);
+        if (businessCommunityInfos == null) {
             return null;
         }
-        if(businessCommunityInfos.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessCommunityInfos锛�"+ JSONObject.toJSONString(info));
+        if (businessCommunityInfos.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessCommunityInfos锛�" + JSONObject.toJSONString(info));
         }
 
         return businessCommunityInfos.get(0);
@@ -116,105 +121,109 @@
 
     /**
      * 鏌ヨ灏忓尯灞炴��
+     *
      * @param info bId 淇℃伅
      * @return 灏忓尯灞炴��
      * @throws DAOException
      */
     @Override
     public List<Map> getBusinessCommunityAttrs(Map info) throws DAOException {
-        logger.debug("鏌ヨ灏忓尯灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
 
-        List<Map> businessCommunityAttrs = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityAttrs",info);
+        List<Map> businessCommunityAttrs = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityAttrs", info);
 
         return businessCommunityAttrs;
     }
 
     /**
      * 鏌ヨ灏忓尯鐓х墖
+     *
      * @param info bId 淇℃伅
      * @return
      * @throws DAOException
      */
     @Override
     public List<Map> getBusinessCommunityPhoto(Map info) throws DAOException {
-        logger.debug("鏌ヨ灏忓尯鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯鐓х墖淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessCommunityPhotos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityPhoto",info);
+        List<Map> businessCommunityPhotos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityPhoto", info);
 
         return businessCommunityPhotos;
     }
 
     /**
      * 鏌ヨ灏忓尯璇佷欢
+     *
      * @param info bId 淇℃伅
      * @return
      * @throws DAOException
      */
     @Override
     public List<Map> getBusinessCommunityCerdentials(Map info) throws DAOException {
-        logger.debug("鏌ヨ灏忓尯璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯璇佷欢淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessCommunityCerdentialses = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityCerdentials",info);
+        List<Map> businessCommunityCerdentialses = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityCerdentials", info);
 
         return businessCommunityCerdentialses;
     }
 
     /**
      * 淇濆瓨灏忓尯淇℃伅 鍒� instance
-     * @param info   bId 淇℃伅
+     *
+     * @param info bId 淇℃伅
      * @throws DAOException
      */
     @Override
     public void saveCommunityInfoInstance(Map info) throws DAOException {
-        logger.debug("淇濆瓨灏忓尯淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇濆瓨灏忓尯淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityInfoInstance",info);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityInfoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
     @Override
     public void saveCommunityAttrsInstance(Map info) throws DAOException {
-        logger.debug("淇濆瓨灏忓尯灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+        logger.debug("淇濆瓨灏忓尯灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityAttrsInstance",info);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityAttrsInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
     @Override
     public void saveCommunityPhotoInstance(Map info) throws DAOException {
-        logger.debug("淇濆瓨灏忓尯鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇濆瓨灏忓尯鐓х墖淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityPhotoInstance",info);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityPhotoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
 
-
     /**
      * 鏌ヨ灏忓尯淇℃伅锛坕nstance锛�
+     *
      * @param info bId 淇℃伅
      * @return
      * @throws DAOException
      */
     @Override
     public Map getCommunityInfo(Map info) throws DAOException {
-        logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfo",info);
-        if(businessCommunityInfos == null || businessCommunityInfos.size() == 0){
+        List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfo", info);
+        if (businessCommunityInfos == null || businessCommunityInfos.size() == 0) {
             return null;
         }
-        if(businessCommunityInfos.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getCommunityInfo锛�"+ JSONObject.toJSONString(info));
+        if (businessCommunityInfos.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getCommunityInfo锛�" + JSONObject.toJSONString(info));
         }
 
         return businessCommunityInfos.get(0);
@@ -222,169 +231,253 @@
 
     /**
      * 灏忓尯灞炴�ф煡璇紙instance锛�
+     *
      * @param info bId 淇℃伅
      * @return
      * @throws DAOException
      */
     @Override
     public List<Map> getCommunityAttrs(Map info) throws DAOException {
-        logger.debug("鏌ヨ灏忓尯灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
 
-        List<Map> communityAttrs = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityAttrs",info);
+        List<Map> communityAttrs = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityAttrs", info);
 
         return communityAttrs;
     }
 
     /**
      * 灏忓尯鐓х墖鏌ヨ锛坕nstance锛�
+     *
      * @param info bId 淇℃伅
      * @return
      * @throws DAOException
      */
     @Override
     public List<Map> getCommunityPhoto(Map info) throws DAOException {
-        logger.debug("鏌ヨ灏忓尯鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
+        logger.debug("鏌ヨ灏忓尯鐓х墖淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> communityPhotos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityPhoto",info);
+        List<Map> communityPhotos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityPhoto", info);
 
         return communityPhotos;
     }
 
 
-
     /**
      * 淇敼灏忓尯淇℃伅
+     *
      * @param info 淇敼淇℃伅
      * @throws DAOException
      */
     @Override
     public void updateCommunityInfoInstance(Map info) throws DAOException {
-        logger.debug("淇敼灏忓尯淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇敼灏忓尯淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityInfoInstance",info);
+        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityInfoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼灏忓尯淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
     /**
      * 淇敼灏忓尯灞炴�т俊鎭紙instance锛�
+     *
      * @param info 淇敼淇℃伅
      * @throws DAOException
      */
     @Override
     public void updateCommunityAttrInstance(Map info) throws DAOException {
-        logger.debug("淇敼灏忓尯灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+        logger.debug("淇敼灏忓尯灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityAttrInstance",info);
+        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityAttrInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼灏忓尯灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
     /**
      * 淇敼 灏忓尯鐓х墖淇℃伅
+     *
      * @param info 淇敼淇℃伅
      * @throws DAOException
      */
     @Override
     public void updateCommunityPhotoInstance(Map info) throws DAOException {
-        logger.debug("淇敼灏忓尯鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
+        logger.debug("淇敼灏忓尯鐓х墖淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityPhotoInstance",info);
+        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityPhotoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
 
     /**
      * 灏忓尯鎴愬憳鍔犲叆淇℃伅
+     *
      * @param businessCommunityMember 灏忓尯鎴愬憳淇℃伅 灏佽
      * @throws DAOException 鎿嶄綔鏁版嵁搴撳紓甯�
      */
-    public void saveBusinessCommunityMember(Map businessCommunityMember) throws DAOException{
-        logger.debug("灏忓尯鎴愬憳鍔犲叆 鍏ュ弬 businessCommunityMember : {}",businessCommunityMember);
+    public void saveBusinessCommunityMember(Map businessCommunityMember) throws DAOException {
+        logger.debug("灏忓尯鎴愬憳鍔犲叆 鍏ュ弬 businessCommunityMember : {}", businessCommunityMember);
         businessCommunityMember.put("month", DateUtil.getCurrentMonth());
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityMember",businessCommunityMember);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveBusinessCommunityMember", businessCommunityMember);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"灏忓尯鎴愬憳鍔犲叆澶辫触锛�"+ JSONObject.toJSONString(businessCommunityMember));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "灏忓尯鎴愬憳鍔犲叆澶辫触锛�" + JSONObject.toJSONString(businessCommunityMember));
         }
     }
 
     /**
      * 鎴愬憳鍔犲叆 淇濆瓨淇℃伅鑷砳nstance
+     *
      * @param info
      * @throws DAOException
      */
     @Override
     public void saveCommunityMemberInstance(Map info) throws DAOException {
-        logger.debug("灏忓尯鎴愬憳鍔犲叆Instance 鍏ュ弬 info : {}",info);
+        logger.debug("灏忓尯鎴愬憳鍔犲叆Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityMemberInstance",info);
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityMemberInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨灏忓尯鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
 
     /**
      * 鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅锛坆usiness杩囩▼锛�
      * 鏍规嵁bId 鏌ヨ灏忓尯淇℃伅
+     *
      * @param info bId 淇℃伅
      * @return 灏忓尯淇℃伅
      * @throws DAOException
      */
-    public Map getBusinessCommunityMember(Map info) throws DAOException{
-        logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}",info);
+    public List<Map> getBusinessCommunityMember(Map info) throws DAOException {
+        logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> businessCommunityMembers = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityMember",info);
-        if(businessCommunityMembers == null || businessCommunityMembers.size() == 0){
+        List<Map> businessCommunityMembers = sqlSessionTemplate.selectList("communityServiceDaoImpl.getBusinessCommunityMember", info);
+        if (businessCommunityMembers == null || businessCommunityMembers.size() == 0) {
             return null;
         }
-        if(businessCommunityMembers.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessCommunityMember锛�"+ JSONObject.toJSONString(info));
-        }
+//        if (businessCommunityMembers.size() > 1) {
+//            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessCommunityMember锛�" + JSONObject.toJSONString(info));
+//        }
 
-        return businessCommunityMembers.get(0);
+        return businessCommunityMembers;
     }
 
     /**
      * 鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅锛坕nstance杩囩▼锛�
      * 鏍规嵁bId 鏌ヨ灏忓尯淇℃伅
+     *
      * @param info bId 淇℃伅
      * @return 灏忓尯淇℃伅
      * @throws DAOException
      */
-    public Map getCommunityMember(Map info) throws DAOException{
-        logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}",info);
+    public List<Map> getCommunityMember(Map info) throws DAOException {
+        logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
 
-        List<Map> memberCommunitys = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityMember",info);
-        if(memberCommunitys == null || memberCommunitys.size() == 0){
+        List<Map> memberCommunitys = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityMember", info);
+        if (memberCommunitys == null || memberCommunitys.size() == 0) {
             return null;
         }
-        if(memberCommunitys.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getCommunityMember锛�"+ JSONObject.toJSONString(info));
+        if (memberCommunitys.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getCommunityMember锛�" + JSONObject.toJSONString(info));
         }
 
-        return memberCommunitys.get(0);
+        return memberCommunitys;
     }
+
     /**
      * 淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅
+     *
      * @param info 淇敼淇℃伅
      * @throws DAOException
      */
-    public void updateCommunityMemberInstance(Map info) throws DAOException{
-        logger.debug("淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅Instance 鍏ュ弬 info : {}",info);
+    public void updateCommunityMemberInstance(Map info) throws DAOException {
+        logger.debug("淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅Instance 鍏ュ弬 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityMemberInstance",info);
+        int saveFlag = sqlSessionTemplate.update("communityServiceDaoImpl.updateCommunityMemberInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼灏忓尯鎴愬憳鍔犲叆淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
         }
     }
+
+    /**
+     * @param info bId 淇℃伅
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getCommunityMembers(Map info) throws DAOException {
+        logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
+
+        List<Map> memberCommunitys = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityMember", info);
+
+        return memberCommunitys;
+    }
+
+    @Override
+    public int getCommunityMemberCount(Map info) {
+        logger.debug("鏌ヨ灏忓尯鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
+
+        List<Map> memberCommunitys = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityMemberCount", info);
+
+        if (memberCommunitys.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(memberCommunitys.get(0).get("count").toString());
+    }
+
+    /**
+     * 鏌ヨ灏忓尯淇℃伅锛坕nstance锛�
+     *
+     * @param info bId 淇℃伅
+     * @return List<Map>
+     * @throws DAOException DAO寮傚父
+     */
+    @Override
+    public List<Map> getCommunityInfoNew(Map info) throws DAOException {
+        logger.debug("鏌ヨ灏忓尯淇℃伅 鍏ュ弬 info : {}", info);
+
+        List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityInfoNew", info);
+
+        return businessCommunityInfos;
+    }
+
+    /**
+     * 鏌ヨ灏忓尯鏁伴噺
+     *
+     * @param info 灏忓尯淇℃伅
+     * @return 灏忓尯鏁伴噺
+     */
+    @Override
+    public int queryCommunitysCount(Map info) {
+        logger.debug("鏌ヨ灏忓尯鏁版嵁 鍏ュ弬 info : {}", info);
+
+        List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.queryCommunitysCount", info);
+        if (businessCommunityInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessCommunityInfos.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) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessCommunityInfos.get(0).get("count").toString());
+    }
+
 }

--
Gitblit v1.8.0