Browse Source

修复错误,数据库用变量,修改排序字段

Memory_LG 1 year ago
parent
commit
1d2298ecce

+ 7 - 9
src/main/resources/mapper/digitalwater/WaterConservancyViewMapper.xml

@@ -135,6 +135,7 @@
             t.name,
             t.phone,
             t.gridId,
+            t.sort,
             t.createTime,
             REPLACE ( group_concat( dept_name ORDER BY find_in_set( d.dept_id, t.ancestors ) ), ',', '' ) deptName
         FROM(
@@ -146,11 +147,11 @@
                 a.phone AS phone,
                 a.post post,
                 a.grid_id gridId,
+                a.sort,
                 a.create_time createTime,
                 SUBSTR( CONCAT( d.ancestors, ',', a.dept_id ), 7 ) ancestors
-            FROM
-                centerdata_t_hydraulic_river_length a
-            LEFT JOIN onest_system.sys_dept d ON a.dept_id = d.dept_id
+            FROM centerdata_t_hydraulic_river_length a
+            LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
             <where>
                 <if test="leadType != null and leadType != ''">
                     a.type = #{leadType}
@@ -158,12 +159,9 @@
                 ${params.dataScope}
             </where>
         ) t
-        LEFT JOIN
-            onest_system.sys_dept d ON find_in_set( d.dept_id, t.ancestors )
-        GROUP BY
-            t.name
-        order by
-            t.createTime
+        LEFT JOIN onest_system.sys_dept d ON find_in_set( d.dept_id, t.ancestors )
+        GROUP BY t.name
+        order by t.sort, t.createTime desc
     </select>
 
     <select id="getGridList" parameterType="WaterConservancyViewBO" resultType="map">