fix(backoffice): restore Smilegate group and role mappers
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
group_name,
|
||||
description,
|
||||
active_yn
|
||||
FROM hmm_access_groups
|
||||
FROM sg_app_group
|
||||
ORDER BY group_code
|
||||
</select>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
SELECT g.group_id,
|
||||
g.group_code,
|
||||
g.group_name,
|
||||
u.employee_id AS user_id,
|
||||
u.full_name AS username
|
||||
FROM hmm_access_group_members ug
|
||||
JOIN hmm_access_groups g ON g.group_id = ug.group_id
|
||||
JOIN hmm_hr_employees u ON u.employee_id = ug.employee_id
|
||||
ORDER BY g.group_code, u.full_name
|
||||
u.user_id,
|
||||
u.user_name AS username
|
||||
FROM sg_user_group ug
|
||||
JOIN sg_app_group g ON g.group_id = ug.group_id
|
||||
JOIN sg_app_user u ON u.user_id = ug.user_id
|
||||
ORDER BY g.group_code, u.user_name
|
||||
</select>
|
||||
|
||||
<select id="findGroupRoles" resultType="com.cloudhandson.vpdbackoffice.domain.group.GroupRoleView">
|
||||
@@ -30,18 +30,18 @@
|
||||
g.group_name,
|
||||
r.role_id,
|
||||
r.role_name
|
||||
FROM hmm_group_access_roles gr
|
||||
JOIN hmm_access_groups g ON g.group_id = gr.group_id
|
||||
JOIN hmm_access_roles r ON r.role_id = gr.role_id
|
||||
FROM sg_group_role gr
|
||||
JOIN sg_app_group g ON g.group_id = gr.group_id
|
||||
JOIN sg_app_role r ON r.role_id = gr.role_id
|
||||
ORDER BY g.group_code, r.role_name
|
||||
</select>
|
||||
|
||||
<select id="nextGroupId" resultType="long">
|
||||
SELECT NVL(MAX(group_id), 0) + 1 FROM hmm_access_groups
|
||||
SELECT NVL(MAX(group_id), 0) + 1 FROM sg_app_group
|
||||
</select>
|
||||
|
||||
<insert id="insertGroup">
|
||||
INSERT INTO hmm_access_groups (
|
||||
INSERT INTO sg_app_group (
|
||||
group_id, group_code, group_name, description, active_yn
|
||||
) VALUES (
|
||||
#{groupId,jdbcType=NUMERIC},
|
||||
@@ -53,29 +53,29 @@
|
||||
</insert>
|
||||
|
||||
<update id="updateActive">
|
||||
UPDATE hmm_access_groups
|
||||
UPDATE sg_app_group
|
||||
SET active_yn = #{activeYn,jdbcType=VARCHAR}
|
||||
WHERE group_id = #{groupId,jdbcType=NUMERIC}
|
||||
</update>
|
||||
|
||||
<insert id="insertGroupUser">
|
||||
INSERT INTO hmm_access_group_members (group_id, employee_id)
|
||||
INSERT INTO sg_user_group (group_id, user_id)
|
||||
VALUES (#{groupId,jdbcType=NUMERIC}, #{userId,jdbcType=NUMERIC})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteGroupUser">
|
||||
DELETE FROM hmm_access_group_members
|
||||
DELETE FROM sg_user_group
|
||||
WHERE group_id = #{groupId,jdbcType=NUMERIC}
|
||||
AND employee_id = #{userId,jdbcType=NUMERIC}
|
||||
AND user_id = #{userId,jdbcType=NUMERIC}
|
||||
</delete>
|
||||
|
||||
<insert id="insertGroupRole">
|
||||
INSERT INTO hmm_group_access_roles (group_id, role_id)
|
||||
INSERT INTO sg_group_role (group_id, role_id)
|
||||
VALUES (#{groupId,jdbcType=NUMERIC}, #{roleId,jdbcType=NUMERIC})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteGroupRole">
|
||||
DELETE FROM hmm_group_access_roles
|
||||
DELETE FROM sg_group_role
|
||||
WHERE group_id = #{groupId,jdbcType=NUMERIC}
|
||||
AND role_id = #{roleId,jdbcType=NUMERIC}
|
||||
</delete>
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
role_name,
|
||||
description,
|
||||
max_sensitivity_level
|
||||
FROM hmm_access_roles
|
||||
WHERE active_yn = 'Y'
|
||||
FROM sg_app_role
|
||||
ORDER BY role_name
|
||||
</select>
|
||||
|
||||
@@ -17,45 +16,44 @@
|
||||
role_name,
|
||||
description,
|
||||
max_sensitivity_level
|
||||
FROM hmm_access_roles
|
||||
FROM sg_app_role
|
||||
WHERE role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="nextRoleId" resultType="long">
|
||||
SELECT NVL(MAX(role_id), 0) + 1 FROM hmm_access_roles
|
||||
SELECT NVL(MAX(role_id), 0) + 1 FROM sg_app_role
|
||||
</select>
|
||||
|
||||
<insert id="insertRole">
|
||||
INSERT INTO hmm_access_roles (role_id, role_name, description, max_sensitivity_level, active_yn)
|
||||
INSERT INTO sg_app_role (role_id, role_name, description, max_sensitivity_level)
|
||||
VALUES (
|
||||
#{roleId,jdbcType=NUMERIC},
|
||||
UPPER(#{roleName,jdbcType=VARCHAR}),
|
||||
#{description,jdbcType=VARCHAR},
|
||||
#{maxSensitivityLevel,jdbcType=VARCHAR},
|
||||
'Y'
|
||||
#{maxSensitivityLevel,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRoleMaxSensitivity">
|
||||
UPDATE hmm_access_roles
|
||||
UPDATE sg_app_role
|
||||
SET max_sensitivity_level = #{maxSensitivityLevel,jdbcType=VARCHAR}
|
||||
WHERE role_id = #{roleId,jdbcType=NUMERIC}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRole">
|
||||
DELETE FROM hmm_access_roles
|
||||
DELETE FROM sg_app_role
|
||||
WHERE role_id = #{roleId,jdbcType=NUMERIC}
|
||||
</delete>
|
||||
|
||||
<select id="countUserRolesByRoleId" resultType="int">
|
||||
SELECT COUNT(*)
|
||||
FROM hmm_employee_access_roles
|
||||
FROM sg_user_role
|
||||
WHERE role_id = #{roleId,jdbcType=NUMERIC}
|
||||
</select>
|
||||
|
||||
<select id="countGroupRolesByRoleId" resultType="int">
|
||||
SELECT COUNT(*)
|
||||
FROM hmm_group_access_roles
|
||||
FROM sg_group_role
|
||||
WHERE role_id = #{roleId,jdbcType=NUMERIC}
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user