소스 검색

林长详情

hanfucheng 1 년 전
부모
커밋
e0256ea8e8
1개의 변경된 파일27개의 추가작업 그리고 43개의 파일을 삭제
  1. 27 43
      src/main/resources/mapper/digitalforest/ForestViewMapper.xml

+ 27 - 43
src/main/resources/mapper/digitalforest/ForestViewMapper.xml

@@ -80,49 +80,33 @@
 
     <select id="getForestLeader" parameterType="ForestLeaderVO" resultType="ForestLeaderBO">
         SELECT
-            t.nickName,
-            t.userId,
-            t.phonenumber,
-            t.linPhone,
-            t.linJob,
-            t.linLabel,
-            REPLACE(group_concat( dept_name ORDER BY find_in_set( d.dept_id, t.ancestors ) ),',','') deptName
+            a.lin_name AS nickName,
+            u.user_id AS userId,
+            a.dept_alias AS deptName,
+            u.phonenumber AS phonenumber,
+            a.lin_phone AS linPhone,
+            a.lin_job linJob,
+            b.dict_label linLabel
         FROM
-        (
-            SELECT
-                a.lin_name AS nickName,
-                u.user_id AS userId,
-                d.dept_name AS deptName,
-                u.phonenumber AS phonenumber,
-                a.lin_phone AS linPhone,
-                a.lin_job linJob,
-                b.dict_label linLabel,
-                SUBSTR(CONCAT( d.ancestors, ',', a.dept_id ),7) ancestors,
-                a.dept_id deptId
-            FROM
-            centerdata_t_forest_linleader a
-            LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
-            LEFT JOIN ${database_system}.sys_user u ON a.user_id = u.user_id
-            LEFT JOIN ${database_system}.sys_dict_data b ON a.lin_job = b.dict_value
-            WHERE
-            1 = 1
-            <if test="linJob != null and linJob != ''">
-                and a.lin_job=#{linJob}
-            </if>
-            <if test="name != null and name != ''">
-                and a.lin_name like concat('%', #{name}, '%')
-            </if>
-            <choose>
-                <when test="deptId != null  and deptId != ''">
-                    and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )
-                </when>
-                <otherwise>
-                    ${params.dataScope}
-                </otherwise>
-            </choose>
-        ) t
-        LEFT JOIN ${database_system}.sys_dept d ON find_in_set( d.dept_id, t.ancestors )
-        GROUP BY
-        t.nickName
+        centerdata_t_forest_linleader a
+        LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
+        LEFT JOIN ${database_system}.sys_user u ON a.user_id = u.user_id
+        LEFT JOIN ${database_system}.sys_dict_data b ON a.lin_job = b.dict_value
+        WHERE
+        1 = 1
+        <if test="linJob != null and linJob != ''">
+            and a.lin_job=#{linJob}
+        </if>
+        <if test="name != null and name != ''">
+            and a.lin_name like concat('%', #{name}, '%')
+        </if>
+        <choose>
+            <when test="deptId != null  and deptId != ''">
+                and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )
+            </when>
+            <otherwise>
+                ${params.dataScope}
+            </otherwise>
+        </choose>
     </select>
 </mapper>