浏览代码

优化查询已经入住的 信息

wuxw 6 年之前
父节点
当前提交
a444df635a

+ 3 - 1
Api/src/main/java/com/java110/api/listener/community/ListMyEnteredCommunitysListener.java

@@ -12,6 +12,7 @@ import com.java110.dto.org.OrgDto;
 import com.java110.dto.org.OrgStaffRelDto;
 import com.java110.event.service.api.ServiceDataFlowEvent;
 import com.java110.utils.constant.ServiceCodeConstant;
+import com.java110.utils.constant.StateConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.api.community.ApiCommunityDataVo;
@@ -96,6 +97,7 @@ public class ListMyEnteredCommunitysListener extends AbstractServiceApiListener
         if ("9999".equals(orgDtos.get(0).getBelongCommunityId())) {
             CommunityDto communityDto = BeanConvertUtil.covertBean(reqJson, CommunityDto.class);
             communityDto.setMemberId(reqJson.getString("storeId"));
+            communityDto.setAuditStatusCd(StateConstant.AGREE_AUDIT);
             count = communityInnerServiceSMOImpl.queryCommunitysCount(communityDto);
             if (count > 0) {
                 communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.queryCommunitys(communityDto), ApiCommunityDataVo.class);
@@ -113,7 +115,7 @@ public class ListMyEnteredCommunitysListener extends AbstractServiceApiListener
         ApiCommunityVo apiCommunityVo = new ApiCommunityVo();
 
         apiCommunityVo.setTotal(count);
-        apiCommunityVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
+        apiCommunityVo.setRecords(1);
         apiCommunityVo.setCommunitys(communitys);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/community/CommunityDto.java

@@ -26,6 +26,7 @@ public class CommunityDto extends PageDto implements Serializable {
     private String state;
     private String stateName;
     private String[] communityIds;
+    private String auditStatusCd;
 
 
 
@@ -138,4 +139,12 @@ public class CommunityDto extends PageDto implements Serializable {
     public void setCommunityIds(String[] communityIds) {
         this.communityIds = communityIds;
     }
+
+    public String getAuditStatusCd() {
+        return auditStatusCd;
+    }
+
+    public void setAuditStatusCd(String auditStatusCd) {
+        this.auditStatusCd = auditStatusCd;
+    }
 }

+ 3 - 0
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -469,6 +469,9 @@
             and cm.member_id = #{memberId}
             and cm.status_cd = '0'
         </if>
+        <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
+            and cm.audit_status_cd = #{auditStatusCd}
+        </if>
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>