|
@@ -225,7 +225,9 @@
|
|
|
<result property="postalCode" column="postal_code_"/>
|
|
|
<result property="organIdStr" column="organ_id_str_"/>
|
|
|
<result property="deptId" column="dept_id_"/>
|
|
|
+ <result property="deptName" column="dept_name_"/>
|
|
|
<result property="deptIds" column="dept_ids_"/>
|
|
|
+ <result property="deptNames" column="dept_names_"/>
|
|
|
<result property="postIds" column="post_ids_"/>
|
|
|
<result property="postDeptIds" column="post_dept_ids_"/>
|
|
|
<collection property="roleNames" ofType="string" javaType="list">
|
|
@@ -239,9 +241,11 @@
|
|
|
SELECT ue.*,ue.organ_id_ organ_id_str_,sr.role_name_,sr.id_ role_id_
|
|
|
FROM (SELECT e.user_id_,su.real_name_,su.gender_,su.phone_,su.user_type_,e.job_nature_,su.lock_flag_,
|
|
|
e.entry_date_,e.demission_date_,e.organ_id_list_ organ_id_,e.create_time_,e.contact_address_,
|
|
|
- e.postal_code_,e.dept_id_,e.dept_ids_,e.post_ids_,e.post_dept_ids_
|
|
|
+ e.postal_code_,e.dept_id_,o.name_ dept_name_,e.dept_ids_,GROUP_CONCAT(o1.name_) dept_names_,e.post_ids_,e.post_dept_ids_
|
|
|
FROM employee e
|
|
|
LEFT JOIN sys_user su ON e.user_id_ = su.id_
|
|
|
+ LEFT JOIN organization o ON e.dept_id_ = o.id_
|
|
|
+ LEFT JOIN organization o1 ON e.dept_ids_ IS NOT NULL AND JSON_CONTAINS(CAST(e.dept_ids_ AS JSON),CAST(o1.id_ AS JSON))
|
|
|
<if test="roleId != null">
|
|
|
LEFT JOIN sys_user_role sur ON sur.user_id_ = e.user_id_
|
|
|
</if>
|
|
@@ -269,6 +273,7 @@
|
|
|
AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') or su.id_ like CONCAT('%',#{search},'%'))
|
|
|
</if>
|
|
|
</where>
|
|
|
+ GROUP BY e.user_id_
|
|
|
ORDER BY e.create_time_ DESC <include refid="global.limit"/>) ue
|
|
|
LEFT JOIN sys_user_role sur ON sur.user_id_ = ue.user_id_
|
|
|
LEFT JOIN sys_role sr ON sr.id_ = sur.role_id_
|