Explorar el Código

优化巡检点查询

java110 hace 6 años
padre
commit
e479f50fbb

+ 1 - 1
CommunityService/src/main/java/com/java110/community/dao/impl/InspectionServiceDaoImpl.java

@@ -152,7 +152,7 @@ public class InspectionServiceDaoImpl extends BaseServiceDao implements IInspect
     public List<Map> getInspectionRelationShipInfo(Map info) throws DAOException {
         logger.debug("查询巡检点信息 入参 info : {}",info);
 
-        List<Map> businessInspectionInfos = sqlSessionTemplate.selectList("inspectionServiceDaoImpl.getInspectionInfo",info);
+        List<Map> businessInspectionInfos = sqlSessionTemplate.selectList("inspectionServiceDaoImpl.getInspectionRelationShipInfo",info);
 
         return businessInspectionInfos;
     }

+ 7 - 6
java110-db/src/main/resources/mapper/community/InspectionServiceDaoImplMapper.xml

@@ -90,8 +90,8 @@
         inner join t_dict d on d.status_cd = m.location_type_cd
         <if test="inspectionRouteId != null  and  inspectionRouteId != ''">
             left join inspection_route_point_rel c on t.inspection_id = c.inspection_id
-            and t.status_cd = '0'
-            and t.inspection_route_id is null
+            and c.status_cd = '0'
+            and c.inspection_route_id is null
         </if>
         where 1 =1
         <if test="inspectionId !=null and inspectionId != ''">
@@ -158,8 +158,8 @@
         from inspection_point t
         <if test="inspectionRouteId != null  and  inspectionRouteId != ''">
             left join inspection_route_point_rel c on t.inspection_id = c.inspection_id
-            and t.status_cd = '0'
-            and t.inspection_route_id is null
+            and c.status_cd = '0'
+            and c.inspection_route_id is null
         </if>
         where 1 =1
         <if test="inspectionId !=null and inspectionId != ''">
@@ -203,8 +203,8 @@
         inner join t_dict d on d.status_cd = m.location_type_cd
         left join inspection_route_point_rel c on t.inspection_id = c.inspection_id
         where 1 =1
-        and t.status_cd = '0'
         <if test="relationship != null  and  relationship == '1'">
+            and c.status_cd = '0'
             and c.inspection_route_id = #{inspectionRouteId}
             and c.inspection_id is not null
         </if>
@@ -248,8 +248,9 @@
         inner join t_dict d on d.status_cd = m.location_type_cd
         left join inspection_route_point_rel c on t.inspection_id = c.inspection_id
         where 1 =1
-        and t.status_cd = '0'
+
         <if test="relationship != null  and  relationship == '1'">
+            and c.status_cd = '0'
             and c.inspection_route_id = #{inspectionRouteId}
             and c.inspection_id is not null
         </if>