[2025.05.30] admin 로그인, initData 작업 중 (1)
This commit is contained in:
51
core/src/main/resources/mappers/admin/GetAdminMapper.xml
Normal file
51
core/src/main/resources/mappers/admin/GetAdminMapper.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper
|
||||
namespace="app.module.core.usecase.adminResearch.getAdmin.adapters.persistence.GetAdminMapper">
|
||||
<select id="findById"
|
||||
resultType="app.module.core.usecase.adminResearch.getAdmin.ports.application.domain.GetAdmin">
|
||||
/* findById : 관리자 상세 조회 */
|
||||
SELECT
|
||||
a.seq,
|
||||
a.id,
|
||||
a.password,
|
||||
a.name,
|
||||
a.contact,
|
||||
a.inspection_area_code,
|
||||
a.password_updated_at,
|
||||
a.account_disabled,
|
||||
a.login_fail_cnt,
|
||||
a.account_locked,
|
||||
a.created_at,
|
||||
a.created_by,
|
||||
a.updated_at,
|
||||
a.updated_by
|
||||
FROM admin_research a
|
||||
WHERE id = #{id}
|
||||
AND a.is_deleted = false
|
||||
</select>
|
||||
|
||||
<resultMap id="AdminRoleHasPrivilegesMap" type="app.module.core.config.adapters.web.security.domain.CoreRole">
|
||||
<id property="id" column="role_id"/>
|
||||
<result property="description" column="role_description"/>
|
||||
|
||||
<collection property="privileges" ofType="app.module.core.config.adapters.web.security.domain.CorePrivilege">
|
||||
<id property="id" column="privilege_id"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="findRoleHasPrivilegesByAdminId" resultMap="AdminRoleHasPrivilegesMap">
|
||||
/* findRoleHasPrivilegesByAdminId : 관리자 권한, 역할 조회 */
|
||||
SELECT
|
||||
r.id AS role_id,
|
||||
r.description AS role_description,
|
||||
p.id AS privilege_id
|
||||
FROM admin_research_has_role ahr
|
||||
JOIN role r ON ahr.role_id = r.id AND r.is_deleted = false
|
||||
LEFT JOIN role_has_privilege rhp ON r.id = rhp.role_id AND rhp.is_deleted = false
|
||||
LEFT JOIN privilege p ON rhp.privilege_id = p.id AND p.is_deleted = false
|
||||
WHERE ahr.admin_seq = #{seq}
|
||||
AND ahr.is_deleted = false
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -58,8 +58,7 @@
|
||||
<update id="deleteAdminRolesByAdminId">
|
||||
/* deleteAdminRolesByAdminId : 관리자 역할 매핑 정보 수정 */
|
||||
UPDATE admin_has_role
|
||||
SET is_deleted = true
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
SET <include refid="common.fields.DeleteBaseSet"/>
|
||||
WHERE admin_id = #{adminId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -7,7 +7,7 @@
|
||||
<select id="findByHouseholdNum"
|
||||
resultType="app.module.core.usecase.household.getHousehold.ports.application.domain.GetHousehold">
|
||||
SELECT
|
||||
id,
|
||||
seq,
|
||||
household_num,
|
||||
owner_name,
|
||||
owner_age,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
city = #{city},
|
||||
address_detail = #{addressDetail},
|
||||
<include refid="common.fields.UpdateBaseSet" />
|
||||
WHERE id = ${id}
|
||||
WHERE seq = ${seq}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -6,4 +6,13 @@
|
||||
<delete id="deleteAll">
|
||||
DELETE FROM article
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAllFiles">
|
||||
DELETE FROM article_has_upload_file
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAllComments">
|
||||
DELETE FROM article_comment
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user