wuxw лет назад: 6
Родитель
Сommit
6ff51cb81f

+ 9 - 0
UserService/src/main/java/com/java110/user/dao/IOwnerServiceDao.java

@@ -55,6 +55,15 @@ public interface IOwnerServiceDao {
      */
     List<Map> getOwnerInfo(Map info) throws DAOException;
 
+    /**
+     * 查询业主信息(instance过程)
+     * 根据bId 查询业主信息
+     * @param info bId 信息
+     * @return 业主信息
+     * @throws DAOException DAO异常
+     */
+    int getOwnerInfoCount(Map info) throws DAOException;
+
 
 
     /**

+ 19 - 0
UserService/src/main/java/com/java110/user/dao/impl/OwnerServiceDaoImpl.java

@@ -94,6 +94,25 @@ public class OwnerServiceDaoImpl extends BaseServiceDao implements IOwnerService
         return businessOwnerInfos;
     }
 
+    /**
+     * 查询业主信息(instance)
+     *
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int getOwnerInfoCount(Map info) throws DAOException {
+        logger.debug("查询业主信息 入参 info : {}", info);
+        List<Map> businessOwnerInfos = sqlSessionTemplate.selectList("ownerServiceDaoImpl.getOwnerInfoCount", info);
+        if (businessOwnerInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessOwnerInfos.get(0).get("count").toString());
+    }
+
+
 
     /**
      * 修改业主信息

+ 19 - 7
UserService/src/main/java/com/java110/user/smo/impl/OwnerInnerServiceSMOImpl.java

@@ -2,6 +2,7 @@ package com.java110.user.smo.impl;
 
 
 import com.java110.utils.constant.CommunityMemberTypeConstant;
+import com.java110.utils.constant.OwnerTypeConstant;
 import com.java110.utils.constant.StatusConstant;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.core.base.smo.BaseServiceSMO;
@@ -49,7 +50,7 @@ public class OwnerInnerServiceSMOImpl extends BaseServiceSMO implements IOwnerIn
 
         //communityInnerServiceSMOImpl.getCommunityMembers()
         //调用 小区服务查询 小区成员业主信息
-        CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(ownerDto, CommunityMemberDto.class);
+       /* CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(ownerDto, CommunityMemberDto.class);
         communityMemberDto.setMemberTypeCd(CommunityMemberTypeConstant.OWNER);
         if (StringUtils.isEmpty(communityMemberDto.getMemberId()) && !StringUtils.isEmpty(ownerDto.getOwnerId())) {
             communityMemberDto.setMemberId(ownerDto.getOwnerId());
@@ -58,11 +59,13 @@ public class OwnerInnerServiceSMOImpl extends BaseServiceSMO implements IOwnerIn
 
         if (communityMemberDtos == null || communityMemberDtos.size() < 1) {
             return null;
-        }
+        }*/
 
-        Map ownerInfo = new HashMap();
-        ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos));
-        ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd());
+        Map ownerInfo = BeanConvertUtil.beanCovertMap(ownerDto);
+        ownerInfo.put("communityId",ownerDto.getCommunityId());
+        ownerInfo.put("ownerTypeCd", OwnerTypeConstant.OWNER);
+       // ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos));
+        //ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd());
         ownerInfo.put("statusCd", StatusConstant.STATUS_CD_VALID);
 
         List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.getOwnerInfo(ownerInfo), OwnerDto.class);
@@ -147,10 +150,19 @@ public class OwnerInnerServiceSMOImpl extends BaseServiceSMO implements IOwnerIn
     public int queryOwnersCount(@RequestBody OwnerDto ownerDto) {
 
         //调用 小区服务查询 小区成员业主信息
-        CommunityMemberDto communityMemberDto = new CommunityMemberDto();
+        /*CommunityMemberDto communityMemberDto = new CommunityMemberDto();
         communityMemberDto.setCommunityId(ownerDto.getCommunityId());
         communityMemberDto.setMemberTypeCd(CommunityMemberTypeConstant.OWNER);
-        return communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);
+        return communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);*/
+
+        Map ownerInfo = BeanConvertUtil.beanCovertMap(ownerDto);
+        ownerInfo.put("communityId",ownerDto.getCommunityId());
+        ownerInfo.put("ownerTypeCd", OwnerTypeConstant.OWNER);
+        // ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos));
+        //ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd());
+        ownerInfo.put("statusCd", StatusConstant.STATUS_CD_VALID);
+
+        return ownerServiceDaoImpl.getOwnerInfoCount(ownerInfo);
 
     }
 

+ 50 - 0
java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml

@@ -159,6 +159,56 @@
 
     </select>
 
+    <!-- 查询业主信息 add by wuxw 2018-07-03 -->
+    <select id="getOwnerInfoCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from building_owner t
+        where 1 =1
+        <if test="sex !=null">
+            and t.sex= #{sex}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name like concat('%',#{name},'%')
+        </if>
+        <if test="link !=null and link != ''">
+            and t.link= #{link}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="ownerId !=null and ownerId != ''">
+            and t.owner_id= #{ownerId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </if>
+        <if test="memberId !=null and memberId != ''">
+            and t.member_id= #{memberId}
+        </if>
+        <if test="ownerIds != null and ownerIds != ''">
+            and t.owner_id in
+            <foreach collection="ownerIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ownerTypeCd !=null and ownerTypeCd != ''">
+            and t.owner_type_cd= #{ownerTypeCd}
+        </if>
+
+    </select>
+
 
     <!-- 修改业主信息 add by wuxw 2018-07-03 -->
     <update id="updateOwnerInfoInstance" parameterType="Map">