shiyj
2019-07-07 348c483d9e8cf81c485289a44c717fe1c23f4065
CommunityService/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java
@@ -4,8 +4,8 @@
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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@@ -21,7 +21,7 @@
//@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);
    /**
     * 小区信息封装
@@ -406,4 +406,63 @@
            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());
    }
    /**
     * 查询小区信息(instance)
     * @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());
    }
}