소스 검색

优化 mybatis 单字符问题

java110 6 년 전
부모
커밋
0b87faa474
1개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 7
      java110-db/src/main/resources/mapper/community/InspectionServiceDaoImplMapper.xml

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

@@ -203,12 +203,12 @@
         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
-        <if test="relationship != null  and  relationship == '1'">
-            and c.status_cd = '0'
+        and c.status_cd = '0'
+        <if test="relationship != null  and  relationship == 1">
             and c.inspection_route_id = #{inspectionRouteId}
             and c.inspection_id is not null
         </if>
-        <if test="relationship != null  and  relationship == '0'">
+        <if test="relationship != null  and  relationship == 0">
             and c.inspection_route_id = #{inspectionRouteId}
             and c.inspection_id is null
         </if>
@@ -248,13 +248,12 @@
         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
-
-        <if test="relationship != null  and  relationship == '1'">
-            and c.status_cd = '0'
+        and c.status_cd = '0'
+        <if test="relationship != null  and  relationship == 1">
             and c.inspection_route_id = #{inspectionRouteId}
             and c.inspection_id is not null
         </if>
-        <if test="relationship != null  and  relationship == '0'">
+        <if test="relationship != null  and  relationship == 0">
             and c.inspection_route_id = #{inspectionRouteId}
             and c.inspection_id is null
         </if>