fix(backoffice): restore Smilegate group and role mappers

This commit is contained in:
devmrko
2026-07-22 14:13:23 +09:00
parent ea4fc1de8b
commit 404244534a
2 changed files with 27 additions and 29 deletions

View File

@@ -8,7 +8,7 @@
group_name, group_name,
description, description,
active_yn active_yn
FROM hmm_access_groups FROM sg_app_group
ORDER BY group_code ORDER BY group_code
</select> </select>
@@ -16,12 +16,12 @@
SELECT g.group_id, SELECT g.group_id,
g.group_code, g.group_code,
g.group_name, g.group_name,
u.employee_id AS user_id, u.user_id,
u.full_name AS username u.user_name AS username
FROM hmm_access_group_members ug FROM sg_user_group ug
JOIN hmm_access_groups g ON g.group_id = ug.group_id JOIN sg_app_group g ON g.group_id = ug.group_id
JOIN hmm_hr_employees u ON u.employee_id = ug.employee_id JOIN sg_app_user u ON u.user_id = ug.user_id
ORDER BY g.group_code, u.full_name ORDER BY g.group_code, u.user_name
</select> </select>
<select id="findGroupRoles" resultType="com.cloudhandson.vpdbackoffice.domain.group.GroupRoleView"> <select id="findGroupRoles" resultType="com.cloudhandson.vpdbackoffice.domain.group.GroupRoleView">
@@ -30,18 +30,18 @@
g.group_name, g.group_name,
r.role_id, r.role_id,
r.role_name r.role_name
FROM hmm_group_access_roles gr FROM sg_group_role gr
JOIN hmm_access_groups g ON g.group_id = gr.group_id JOIN sg_app_group g ON g.group_id = gr.group_id
JOIN hmm_access_roles r ON r.role_id = gr.role_id JOIN sg_app_role r ON r.role_id = gr.role_id
ORDER BY g.group_code, r.role_name ORDER BY g.group_code, r.role_name
</select> </select>
<select id="nextGroupId" resultType="long"> <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> </select>
<insert id="insertGroup"> <insert id="insertGroup">
INSERT INTO hmm_access_groups ( INSERT INTO sg_app_group (
group_id, group_code, group_name, description, active_yn group_id, group_code, group_name, description, active_yn
) VALUES ( ) VALUES (
#{groupId,jdbcType=NUMERIC}, #{groupId,jdbcType=NUMERIC},
@@ -53,29 +53,29 @@
</insert> </insert>
<update id="updateActive"> <update id="updateActive">
UPDATE hmm_access_groups UPDATE sg_app_group
SET active_yn = #{activeYn,jdbcType=VARCHAR} SET active_yn = #{activeYn,jdbcType=VARCHAR}
WHERE group_id = #{groupId,jdbcType=NUMERIC} WHERE group_id = #{groupId,jdbcType=NUMERIC}
</update> </update>
<insert id="insertGroupUser"> <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}) VALUES (#{groupId,jdbcType=NUMERIC}, #{userId,jdbcType=NUMERIC})
</insert> </insert>
<delete id="deleteGroupUser"> <delete id="deleteGroupUser">
DELETE FROM hmm_access_group_members DELETE FROM sg_user_group
WHERE group_id = #{groupId,jdbcType=NUMERIC} WHERE group_id = #{groupId,jdbcType=NUMERIC}
AND employee_id = #{userId,jdbcType=NUMERIC} AND user_id = #{userId,jdbcType=NUMERIC}
</delete> </delete>
<insert id="insertGroupRole"> <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}) VALUES (#{groupId,jdbcType=NUMERIC}, #{roleId,jdbcType=NUMERIC})
</insert> </insert>
<delete id="deleteGroupRole"> <delete id="deleteGroupRole">
DELETE FROM hmm_group_access_roles DELETE FROM sg_group_role
WHERE group_id = #{groupId,jdbcType=NUMERIC} WHERE group_id = #{groupId,jdbcType=NUMERIC}
AND role_id = #{roleId,jdbcType=NUMERIC} AND role_id = #{roleId,jdbcType=NUMERIC}
</delete> </delete>

View File

@@ -7,8 +7,7 @@
role_name, role_name,
description, description,
max_sensitivity_level max_sensitivity_level
FROM hmm_access_roles FROM sg_app_role
WHERE active_yn = 'Y'
ORDER BY role_name ORDER BY role_name
</select> </select>
@@ -17,45 +16,44 @@
role_name, role_name,
description, description,
max_sensitivity_level max_sensitivity_level
FROM hmm_access_roles FROM sg_app_role
WHERE role_id = #{roleId} WHERE role_id = #{roleId}
</select> </select>
<select id="nextRoleId" resultType="long"> <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> </select>
<insert id="insertRole"> <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 ( VALUES (
#{roleId,jdbcType=NUMERIC}, #{roleId,jdbcType=NUMERIC},
UPPER(#{roleName,jdbcType=VARCHAR}), UPPER(#{roleName,jdbcType=VARCHAR}),
#{description,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{maxSensitivityLevel,jdbcType=VARCHAR}, #{maxSensitivityLevel,jdbcType=VARCHAR}
'Y'
) )
</insert> </insert>
<update id="updateRoleMaxSensitivity"> <update id="updateRoleMaxSensitivity">
UPDATE hmm_access_roles UPDATE sg_app_role
SET max_sensitivity_level = #{maxSensitivityLevel,jdbcType=VARCHAR} SET max_sensitivity_level = #{maxSensitivityLevel,jdbcType=VARCHAR}
WHERE role_id = #{roleId,jdbcType=NUMERIC} WHERE role_id = #{roleId,jdbcType=NUMERIC}
</update> </update>
<delete id="deleteRole"> <delete id="deleteRole">
DELETE FROM hmm_access_roles DELETE FROM sg_app_role
WHERE role_id = #{roleId,jdbcType=NUMERIC} WHERE role_id = #{roleId,jdbcType=NUMERIC}
</delete> </delete>
<select id="countUserRolesByRoleId" resultType="int"> <select id="countUserRolesByRoleId" resultType="int">
SELECT COUNT(*) SELECT COUNT(*)
FROM hmm_employee_access_roles FROM sg_user_role
WHERE role_id = #{roleId,jdbcType=NUMERIC} WHERE role_id = #{roleId,jdbcType=NUMERIC}
</select> </select>
<select id="countGroupRolesByRoleId" resultType="int"> <select id="countGroupRolesByRoleId" resultType="int">
SELECT COUNT(*) SELECT COUNT(*)
FROM hmm_group_access_roles FROM sg_group_role
WHERE role_id = #{roleId,jdbcType=NUMERIC} WHERE role_id = #{roleId,jdbcType=NUMERIC}
</select> </select>