java110 лет назад: 4
Родитель
Сommit
fcb2173d72

+ 2 - 3
java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml

@@ -136,9 +136,9 @@
         from owner_car t
         left join t_dict t1 on t.car_type=t1.status_cd and t1.table_name='owner_car' and t1.table_columns = 'car_type'
         left join t_dict t2 on t.state=t2.status_cd and t2.table_name='owner_car' and t2.table_columns = 'state'
-        left join building_owner bow on t.owner_id = bow.owner_id and bow.status_cd = '0' and bow.community_id =
-        t.community_id
+        left join building_owner bow on t.owner_id = bow.member_id and bow.status_cd = '0' and bow.community_id = t.community_id
         where 1=1
+
         <if test="statusCd !=null and statusCd != ''">
             and t.status_cd = #{statusCd}
         </if>
@@ -223,7 +223,6 @@
         <if test="valid == 2">
             and t.ps_id= '-1'
         </if>
-        group by t.car_id
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}

+ 3 - 6
service-api/src/main/java/com/java110/api/listener/owner/QueryOwnerCarsListener.java

@@ -99,16 +99,13 @@ public class QueryOwnerCarsListener extends AbstractServiceApiDataFlowListener {
 
         //查询总记录数
         int total = ownerCarInnerServiceSMOImpl.queryOwnerCarsCount(BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class));
-        int count = 0;
+//        int count = 0;
         List<OwnerCarDto> ownerCarDtoList = null;
 
         if (total > 0) {
             OwnerCarDto ownerCarDto = BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class);
             ownerCarDtoList = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
-            ownerCarDto.setPage(PageDto.DEFAULT_PAGE);
-            //查询所有业主车辆数据
-            List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
-            count = ownerCarDtos.size();
+
             //小区20条时刷房屋和车位信息
             if (row < 20) {
                 freshPs(ownerCarDtoList);
@@ -134,7 +131,7 @@ public class QueryOwnerCarsListener extends AbstractServiceApiDataFlowListener {
             }
         }
 
-        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) row), count, ownerCarDtoList);
+        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerCarDtoList);
         dataFlowContext.setResponseEntity(responseEntity);
     }