|
@@ -19,6 +19,7 @@
|
|
|
<result column="staff_phone" property="staffPhone"/>
|
|
<result column="staff_phone" property="staffPhone"/>
|
|
|
<result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
<result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="org_name" property="orgName"/>
|
|
<result column="org_name" property="orgName"/>
|
|
|
|
|
+ <result column="hr_status_name" property="hrStatusName"/>
|
|
|
<result column="role_names" property="roleNames"/>
|
|
<result column="role_names" property="roleNames"/>
|
|
|
<result column="role_ids" property="roleIds" typeHandler="UuidListTypeHandler"/>
|
|
<result column="role_ids" property="roleIds" typeHandler="UuidListTypeHandler"/>
|
|
|
<result column="wx_user_id" property="wxUserId" typeHandler="UuidTypeHandler"/>
|
|
<result column="wx_user_id" property="wxUserId" typeHandler="UuidTypeHandler"/>
|
|
@@ -82,8 +83,11 @@
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
<include refid="Base_Column_List"/>
|
|
|
- , org.org_name
|
|
|
|
|
-
|
|
|
|
|
|
|
+ , org.org_name,
|
|
|
|
|
+ case when t.hr_status = 1 then '在职' else '离职' end as hr_status_name,
|
|
|
|
|
+ (SELECT array_to_string(array_agg(role_name), ',')
|
|
|
|
|
+ FROM dkic_b.t_mst_role
|
|
|
|
|
+ WHERE role_id = ANY (t.role_ids)) AS role_names
|
|
|
FROM dkic_b.t_mst_staff t
|
|
FROM dkic_b.t_mst_staff t
|
|
|
LEFT JOIN dkic_b.t_mst_org org
|
|
LEFT JOIN dkic_b.t_mst_org org
|
|
|
ON t.org_Id = org.org_Id
|
|
ON t.org_Id = org.org_Id
|
|
@@ -106,10 +110,13 @@
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
SELECT
|
|
|
<include refid="Base_Column_List"/>
|
|
<include refid="Base_Column_List"/>
|
|
|
- , org.org_name
|
|
|
|
|
|
|
+ , org.org_name,
|
|
|
|
|
+ case when t.hr_status = 1 then '在职' else '离职' end as hr_status_name,
|
|
|
|
|
+ (SELECT array_to_string(array_agg(role_name), ',')
|
|
|
|
|
+ FROM dkic_b.t_mst_role
|
|
|
|
|
+ WHERE role_id = ANY (t.role_ids)) AS role_names
|
|
|
FROM dkic_b.t_mst_staff t
|
|
FROM dkic_b.t_mst_staff t
|
|
|
- LEFT JOIN dkic_b.t_mst_org org
|
|
|
|
|
- ON t.org_Id = org.org_Id
|
|
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_org org ON t.org_Id = org.org_Id
|
|
|
WHERE t.staff_id = #{staffId}::uuid
|
|
WHERE t.staff_id = #{staffId}::uuid
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|