Browse Source

【CHG】修改查询脚本

zhaomn 3 years ago
parent
commit
14e0a90f41

+ 5 - 5
railway-business/src/main/resources/mapper/baseinfo/BaseSubstationMapper.xml

@@ -190,18 +190,18 @@
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
-    FROM base_substation t
-    LEFT JOIN v_substation v on t.substation_id = v.substation_id
+    FROM v_substation v
+    LEFT JOIN base_substation t on t.substation_id = v.substation_id
     <where>
       t.del_flag='0'
       <if test="deptId!=null and deptId!=''">
-        and t.dept_id=#{deptId}
+        and v.dept_id=#{deptId}
       </if>
       <if test="deptName!=null and deptName!=''">
         and v.dept_name like concat('%', #{deptName}, '%')
       </if>
       <if test="lineId!=null and lineId!=''">
-        and t.line_id=#{lineId}
+        and v.line_id=#{lineId}
       </if>
       <if test="lineName!=null and lineName!=''">
         and v.line_name like concat('%', #{lineName}, '%')
@@ -210,7 +210,7 @@
         and t.work_area=#{workArea}
       </if>
       <if test="substationName!=null and substationName!=''">
-        and t.substation_name like concat('%', #{substationName}, '%')
+        and v.substation_name like concat('%', #{substationName}, '%')
       </if>
       <if test="orderNum!=null and orderNum!=''">
         and t.order_num=#{orderNum}