|
@@ -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>
|