ads367 / yj_portal star
ads367 04-11
2024-04-11 최민식 공통코드/로그인 이력/ 회원정보 등록
공통코드/로그인 이력/ 회원정보 등록
@c75ceb84f994d26802cca6ebc7e25a95b1b4472f
src/main/java/com/takensoft/cms/mber/dao/LgnHstryDAO.java
--- src/main/java/com/takensoft/cms/mber/dao/LgnHstryDAO.java
+++ src/main/java/com/takensoft/cms/mber/dao/LgnHstryDAO.java
@@ -1,4 +1,20 @@
 package com.takensoft.cms.mber.dao;
 
+import com.takensoft.cms.mber.vo.LgnHstryVO;
+import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+/**
+ * @author  : takensoft
+ * @since   : 2024.04.09
+ *
+ * 로그인 이력 관련 Mapper
+ */
+@Mapper("lgnHstryDAO")
 public interface LgnHstryDAO {
+    /**
+     * @author takensoft
+     * @since 2024.04.09
+     * 로그인 이력 등록
+     */
+    int save(LgnHstryVO lgnHstryVO);
 }
src/main/java/com/takensoft/cms/mber/service/Impl/LgnHstryServiceImpl.java
--- src/main/java/com/takensoft/cms/mber/service/Impl/LgnHstryServiceImpl.java
+++ src/main/java/com/takensoft/cms/mber/service/Impl/LgnHstryServiceImpl.java
@@ -1,4 +1,39 @@
 package com.takensoft.cms.mber.service.Impl;
 
-public class LgnHstryServiceImpl {
+
+import com.takensoft.cms.mber.dao.LgnHstryDAO;
+import com.takensoft.cms.mber.service.LgnHstryService;
+import com.takensoft.cms.mber.vo.LgnHstryVO;
+import com.takensoft.common.util.JWTUtil;
+import lombok.RequiredArgsConstructor;
+import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author  : takensoft
+ * @since   : 2024.04.09
+ *
+ * 로그인 이력 정보 관련 구현체
+ * EgovAbstractServiceImpl : 전자정부 상속
+ * LgnHstryService : 로그인 이력 정보 인터페이스 상속
+ */
+@Service("lgnHstryService")
+@RequiredArgsConstructor
+public class LgnHstryServiceImpl extends EgovAbstractServiceImpl implements LgnHstryService {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(LgnHstryServiceImpl.class);
+    private final JWTUtil jwtUtil;
+    private final LgnHstryDAO lgnHstryDAO;
+
+    /**
+     * @author takensoft
+     * @since 2024.04.09
+     * 로그인 이력 등록
+     */
+    @Override
+    public int LgnHstrySave(LgnHstryVO lgnHstryVO) throws Exception {
+        return lgnHstryDAO.save(lgnHstryVO);
+    }
 }
src/main/java/com/takensoft/cms/mber/service/LgnHstryService.java
--- src/main/java/com/takensoft/cms/mber/service/LgnHstryService.java
+++ src/main/java/com/takensoft/cms/mber/service/LgnHstryService.java
@@ -1,4 +1,19 @@
 package com.takensoft.cms.mber.service;
 
+import com.takensoft.cms.mber.vo.LgnHstryVO;
+
+/**
+ * @author  : takensoft
+ * @since   : 2024.04.09
+ *
+ * 로그인 이력 정보 관련 인터페이스
+ */
 public interface LgnHstryService {
+
+    /**
+     * @author takensoft
+     * @since 2024.04.09
+     * 로그인 이력 등록
+     */
+    public int LgnHstrySave(LgnHstryVO lgnHstryVO) throws Exception;
 }
src/main/java/com/takensoft/cms/mber/service/MberService.java
--- src/main/java/com/takensoft/cms/mber/service/MberService.java
+++ src/main/java/com/takensoft/cms/mber/service/MberService.java
@@ -26,5 +26,4 @@
      * 회원가입
      */
     public int userJoin(HttpServletRequest req, JoinDTO joinDTO) throws Exception;
-
 }
src/main/java/com/takensoft/cms/mber/vo/LgnHstryVO.java
--- src/main/java/com/takensoft/cms/mber/vo/LgnHstryVO.java
+++ src/main/java/com/takensoft/cms/mber/vo/LgnHstryVO.java
@@ -1,4 +1,47 @@
 package com.takensoft.cms.mber.vo;
 
+import lombok.*;
+
+/**
+ * @author  : takensoft
+ * @since   : 2024.04.01
+ *
+ * 로그인 이력 정보 관련 VO
+ */
+@Getter
+@Setter
+@ToString
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
 public class LgnHstryVO {
+
+    /**
+     * 로그인 아이디
+     */
+    private String lgnId;
+    /**
+     * 로그인 유형
+     */
+    private String lgnType;
+    /**
+     * 접속일
+     */
+    private String cntnDt;
+    /**
+     * 접속 아이피
+     */
+    private String cntnIp;
+    /**
+     * 접속 운영체제
+     */
+    private String cntnOperSys;
+    /**
+     * 디바이스명
+     */
+    private String deviceNm;
+    /**
+     * 브라우저명
+     */
+    private String brwsrNm;
 }
src/main/java/com/takensoft/common/config/SecurityConfig.java
--- src/main/java/com/takensoft/common/config/SecurityConfig.java
+++ src/main/java/com/takensoft/common/config/SecurityConfig.java
@@ -1,5 +1,6 @@
 package com.takensoft.common.config;
 
+import com.takensoft.cms.mber.service.LgnHstryService;
 import com.takensoft.cms.mber.service.RefreshTokenService;
 import com.takensoft.common.filter.JWTFilter;
 import com.takensoft.common.filter.LoginFilter;
@@ -33,6 +34,7 @@
     private final RefreshTokenService refreshTokenService;
     private final CustomAuthenticationEntryPoint authenticationEntryPoint;
     private final CustomAccessDenieHandler accessDenieHandler;
+    private final LgnHstryService lgnHstryService;
 
     private static String FRONT_URL;    // 프론트 접근 허용 URL
     private static long JWT_ACCESSTIME; // access 토큰 유지 시간
@@ -40,7 +42,7 @@
     private static int COOKIE_TIME; // 쿠키 유지 시간
 
     public SecurityConfig(AuthenticationConfiguration authenticationConfiguration, JWTUtil jwtUtil, RefreshTokenService refreshTokenService,
-                          CustomAuthenticationEntryPoint authenticationEntryPoint, CustomAccessDenieHandler accessDenieHandler,
+                          LgnHstryService lgnHstryService, CustomAuthenticationEntryPoint authenticationEntryPoint, CustomAccessDenieHandler accessDenieHandler,
                           @Value("${front.url}")String fUrl,@Value("${jwt.accessTime}")long aTime,
                           @Value("${jwt.refreshTime}")long rTime, @Value("${cookie.time}")int ctime) {
         this.authenticationConfiguration = authenticationConfiguration;
@@ -48,6 +50,7 @@
         this.refreshTokenService = refreshTokenService;
         this.authenticationEntryPoint = authenticationEntryPoint;
         this.accessDenieHandler = accessDenieHandler;
+        this.lgnHstryService = lgnHstryService;
 
         this.FRONT_URL = fUrl;
         this.JWT_ACCESSTIME = aTime;
@@ -112,7 +115,7 @@
         // 토큰 검증 필터
         http.addFilterBefore(new JWTFilter(jwtUtil), LoginFilter.class);
         // 로그인 필터
-        http.addFilterAt(new LoginFilter(authenticationManager(authenticationConfiguration), jwtUtil, refreshTokenService,
+        http.addFilterAt(new LoginFilter(authenticationManager(authenticationConfiguration), jwtUtil, refreshTokenService, lgnHstryService,
                         JWT_ACCESSTIME, JWT_REFRESHTIME, COOKIE_TIME), UsernamePasswordAuthenticationFilter.class);
 
         return http.build();
src/main/java/com/takensoft/common/filter/LoginFilter.java
--- src/main/java/com/takensoft/common/filter/LoginFilter.java
+++ src/main/java/com/takensoft/common/filter/LoginFilter.java
@@ -3,11 +3,14 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 import com.takensoft.cms.mber.dto.LoginDTO;
+import com.takensoft.cms.mber.service.LgnHstryService;
 import com.takensoft.cms.mber.service.RefreshTokenService;
+import com.takensoft.cms.mber.vo.LgnHstryVO;
 import com.takensoft.cms.mber.vo.MberVO;
 import com.takensoft.cms.mber.vo.RefreshVO;
 import com.takensoft.common.util.ErrorResponse;
 import com.takensoft.common.util.JWTUtil;
+import com.takensoft.common.util.UserAgentUtils;
 import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpStatus;
@@ -32,16 +35,19 @@
     private final AuthenticationManager authenticationManager;
     private final JWTUtil jwtUtil;
     private final RefreshTokenService refreshTokenService;
+    private final LgnHstryService lgnHstryService;
 
     private static long JWT_ACCESSTIME; // access 토큰 유지 시간
     private static long JWT_REFRESHTIME; // refresh 토큰 유지 시간
     private static int COOKIE_TIME; // 쿠키 유지 시간
 
-    public LoginFilter(AuthenticationManager authenticationManager, JWTUtil jwtUtil, RefreshTokenService refreshTokenService,
+    public LoginFilter(AuthenticationManager authenticationManager, JWTUtil jwtUtil, RefreshTokenService refreshTokenService, LgnHstryService lgnHstryService,
                        @Value("${jwt.accessTime}")long aTime, @Value("${jwt.refreshTime}")long rTime, @Value("${cookie.time}")int ctime) {
         this.authenticationManager = authenticationManager;
         this.jwtUtil = jwtUtil;
         this.refreshTokenService = refreshTokenService;
+        this.lgnHstryService = lgnHstryService;
+
 
         this.JWT_ACCESSTIME = aTime;
         this.JWT_REFRESHTIME = rTime;
@@ -83,6 +89,21 @@
 
         MberVO mber = (MberVO) authentication.getPrincipal();
 
+        // 로그인 이력 등록
+        LgnHstryVO lgnHstryVO = new LgnHstryVO();
+        lgnHstryVO.setLgnId(mber.getLgnId());
+        if(mber.getAuthorities().stream().anyMatch(role -> role.getAuthority().equals("ROLE_ADMIN"))) {
+            lgnHstryVO.setLgnType("0");
+        } else {
+            lgnHstryVO.setLgnType("1");
+        }
+        lgnHstryVO.setCntnIp(req.getRemoteAddr());
+        lgnHstryVO.setCntnOperSys(UserAgentUtils.getOS(UserAgentUtils.getUserAgent(req)));
+        lgnHstryVO.setDeviceNm(UserAgentUtils.getDevice(UserAgentUtils.getUserAgent(req)));
+        lgnHstryVO.setBrwsrNm(UserAgentUtils.getBrowser(UserAgentUtils.getUserAgent(req)));
+        lgnHstryService.LgnHstrySave(lgnHstryVO);
+
+
         // 토큰 생성(access, refresh)
         String accessToken = jwtUtil.createJwt("Authorization", mber.getMbrId(), mber.getLgnId(), (List) mber.getAuthorities(), JWT_ACCESSTIME);
         String refreshToken = jwtUtil.createJwt("refresh", mber.getMbrId(), mber.getLgnId(), (List) mber.getAuthorities(), JWT_REFRESHTIME);
src/main/java/com/takensoft/common/idgen/context/ContextIdgen.java
--- src/main/java/com/takensoft/common/idgen/context/ContextIdgen.java
+++ src/main/java/com/takensoft/common/idgen/context/ContextIdgen.java
@@ -78,8 +78,8 @@
         IdgenService idgenServiceImpl = new IdgenService();
         idgenServiceImpl.setCipers(15);
         idgenServiceImpl.setFillChar('0');
-        idgenServiceImpl.setPrefix("MBER_");
-        idgenServiceImpl.setTblNm("MBER_ID");
+        idgenServiceImpl.setPrefix("MBR_");
+        idgenServiceImpl.setTblNm("MBR_ID");
         return idgenServiceImpl;
     }
 
@@ -100,8 +100,8 @@
         IdgenService idgenServiceImpl = new IdgenService();
         idgenServiceImpl.setCipers(15);
         idgenServiceImpl.setFillChar('0');
-        idgenServiceImpl.setPrefix("MENU_STSFDG_");
-        idgenServiceImpl.setTblNm("MENU_STSFDG_ID");
+        idgenServiceImpl.setPrefix("MENU_DGSTFN_");
+        idgenServiceImpl.setTblNm("MENU_DGSTFN_ID");
         return idgenServiceImpl;
     }
 }
(파일 끝에 줄바꿈 문자 없음)
src/main/java/com/takensoft/common/util/UserAgentUtils.java
--- src/main/java/com/takensoft/common/util/UserAgentUtils.java
+++ src/main/java/com/takensoft/common/util/UserAgentUtils.java
@@ -1,4 +1,65 @@
 package com.takensoft.common.util;
 
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 간단한 사용자 Agent정보 추출
+ */
 public class UserAgentUtils {
+
+    // HTTP 요청에서 User-Agent 해더 추출
+    public static String getUserAgent(HttpServletRequest req) {
+        return req.getHeader("User-Agent");
+    }
+
+    // 운영체제 정보 추출
+    public static String getOS(String userAgent) {
+        String os = "Unknown";
+
+        // userAgent 문자열에서 운영체제 정보 추출
+        if(userAgent != null && !userAgent.isEmpty()) {
+            if(userAgent.toLowerCase().contains("windows")) {
+                os = "Windows";
+            } else if(userAgent.toLowerCase().contains("mac")) {
+                os = "Mac";
+            } else if(userAgent.toLowerCase().contains("linux")) {
+                os = "Linux";
+            }
+        }
+        return os;
+    }
+
+    // 디바이스 정보 추출
+    public static String getDevice(String userAgent) {
+        String device = "Unknown";
+        // userAgent 문자열에서 디바이스 정보 추출
+        if(userAgent != null && !userAgent.isEmpty()) {
+            if(userAgent.toLowerCase().contains("mobile")) {
+                device = "Mobile";
+            } else {
+                device = "Desktop";
+            }
+        }
+        return device;
+    }
+
+    // 브라우저 정보 추출
+    public static String getBrowser(String userAgent) {
+        String browser = "Unknown";
+        // userAgent 문자열에서 브라우저저 정보추출
+        if(userAgent != null && !userAgent.isEmpty()) {
+            if(userAgent.toLowerCase().contains("msie")) {
+                browser = "Internet Explorer";
+            } else if(userAgent.toLowerCase().contains("firefox")) {
+                browser = "Firefox";
+            } else if(userAgent.toLowerCase().contains("chrome")) {
+                browser = "Chrome";
+            } else if(userAgent.toLowerCase().contains("safari")) {
+                browser = "Safari";
+            } else if(userAgent.toLowerCase().contains("edge")) {
+                browser = "Edge";
+            }
+        }
+        return browser;
+    }
 }
src/main/resources/mybatis/mapper/author/author-SQL.xml
--- src/main/resources/mybatis/mapper/author/author-SQL.xml
+++ src/main/resources/mybatis/mapper/author/author-SQL.xml
@@ -18,13 +18,8 @@
          WHERE authrt_cd = #{authrtCd}
     </select>
 
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.05
-        내 용 : 권한 목록 조회
-    -->
-    <select id="findAll" parameterType="AuthorVO" resultType="AuthorVO">
-        SELECT authrt_cd
+    <sql id="selectAuthrt">
+         SELECT authrt_cd
              , authrt_nm
              , authrt_expln
              , use_yn
@@ -34,6 +29,15 @@
              , mdfr
              , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
           FROM authrt_info
+    </sql>
+
+    <!--
+        작성자 : takensoft
+        작성일 : 2024.04.05
+        내 용 : 권한 목록 조회
+    -->
+    <select id="findAll" parameterType="AuthorVO" resultType="AuthorVO">
+        <include refid="selectAuthrt" />
          WHERE use_yn = 'Y'
     </select>
 
@@ -43,16 +47,7 @@
         내 용 : 권한 상세 조회
     -->
     <select id="findByAuthorCode" parameterType="String" resultType="AuthorVO">
-        SELECT authrt_cd
-             , authrt_nm
-             , authrt_expln
-             , use_yn
-             , sys_pvsn_yn
-             , rgtr
-             , DATE_FORMAT(reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-             , mdfr
-             , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
-          FROM authrt_info
+        <include refid="selectAuthrt" />
          WHERE authrt_cd = #{authrtCd}
            AND use_yn = 'Y'
     </select>
src/main/resources/mybatis/mapper/codeManage/codeManage-SQL.xml
--- src/main/resources/mybatis/mapper/codeManage/codeManage-SQL.xml
+++ src/main/resources/mybatis/mapper/codeManage/codeManage-SQL.xml
@@ -90,12 +90,7 @@
          </choose>
     </select>
 
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.09
-        내 용 : 최상위 코드 조회 [관리자용]
-    -->
-    <select id="findTopCd" resultType="CodeManageVO">
+    <sql id="selectCd">
         SELECT cd
              , up_cd
              , cd_nm
@@ -110,6 +105,14 @@
              , mdfr
              , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
           FROM cd_mng
+    </sql>
+    <!--
+        작성자 : takensoft
+        작성일 : 2024.04.09
+        내 용 : 최상위 코드 조회 [관리자용]
+    -->
+    <select id="findTopCd" resultType="CodeManageVO">
+        <include refid="selectCd" />
          WHERE up_cd IS NULL
       ORDER BY cd_sn
     </select>
@@ -120,20 +123,7 @@
         내 용 : 하위 코드 조회 [관리자용]
     -->
     <select id="findChildCd" parameterType="String" resultType="CodeManageVO">
-        SELECT cd
-             , up_cd
-             , cd_nm
-             , cd_vl
-             , cd_expln
-             , cd_grd
-             , cd_sn
-             , use_yn
-             , sys_pvsn_yn
-             , rgtr
-             , DATE_FORMAT(reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-             , mdfr
-             , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
-          FROM cd_mng
+        <include refid="selectCd" />
          WHERE up_cd = #{cd}
       ORDER BY cd_sn
     </select>
@@ -144,20 +134,7 @@
         내 용 : 코드 상세 조회
     -->
     <select id="findByCd" parameterType="String" resultType="CodeManageVO">
-        SELECT cd
-             , up_cd
-             , cd_nm
-             , cd_vl
-             , cd_expln
-             , cd_grd
-             , cd_sn
-             , use_yn
-             , sys_pvsn_yn
-             , rgtr
-             , DATE_FORMAT(reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-             , mdfr
-             , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
-          FROM cd_mng
+        <include refid="selectCd" />
          WHERE cd = #{cd}
     </select>
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/mber/lgnHstry-SQL.xml
--- src/main/resources/mybatis/mapper/mber/lgnHstry-SQL.xml
+++ src/main/resources/mybatis/mapper/mber/lgnHstry-SQL.xml
@@ -2,184 +2,33 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!--
     작성자 : takensoft
-    작성일 : 2024.04.03
-    내 용 : 회원정보 관련
+    작성일 : 2024.04.09
+    내 용 : 로그인 이력 관련
 -->
-<mapper namespace="com.takensoft.cms.mber.dao.MberDAO">
-
-    <!-- 회원 정보 resultMap(권한 포함) -->
-    <resultMap id="mberMap" type="MberVO">
-        <result property="mbrId" column="mbr_id" />
-        <result property="lgnId" column="lgn_id" />
-        <result property="mbrNm" column="mbr_nm" />
-        <result property="ncnm" column="ncnm" />
-        <result property="password" column="password" />
-        <result property="mblTelno" column="mbl_telno" />
-        <result property="telno" column="telno" />
-        <result property="eml" column="eml" />
-        <result property="zip" column="zip" />
-        <result property="addr" column="addr" />
-        <result property="daddr" column="daddr" />
-        <result property="mbrStts" column="mbr_stts" />
-        <result property="useYn" column="use_yn" />
-        <result property="cntrlDt" column="cntrl_dt" />
-        <result property="cntrlRsn" column="cntrl_rsn" />
-        <result property="smsRcptnAgreYn" column="sms_rcptn_agre_yn" />
-        <result property="emlRcptnAgreYn" column="eml_rcptn_agre_yn" />
-        <result property="prvcRcptnAgreYn" column="prvc_rcptn_agre_yn" />
-        <result property="mbrType" column="mbr_type" />
-        <result property="passwordChgDt" column="password_chg_dt" />
-        <result property="frstRegIp" column="frst_reg_ip" />
-        <result property="sysPvsnYn" column="sys_pvsn_yn" />
-        <result property="rgtr" column="rgtr" />
-        <result property="regDt" column="reg_dt" />
-        <result property="mdfr" column="mdfr" />
-        <result property="mdfcnDt" column="mdfcn_dt" />
-        <collection property="authorList" column="{mbrId = mbr_id}" javaType="java.util.ArrayList" ofType="MberAuthorVO" select="findByMberAuthor" />
-    </resultMap>
-
-    <!-- 회원, 권한 매핑 -->
-    <resultMap id="authMap" type="MberAuthorVO">
-        <result property="mbrId" column="mbr_id" />
-        <result property="authrtCd" column="authrt_cd" />
-        <result property="rgtr" column="rgtr" />
-        <result property="regDt" column="reg_dt" />
-    </resultMap>
+<mapper namespace="com.takensoft.cms.mber.dao.LgnHstryDAO">
 
     <!--
         작성자 : takensoft
-        작성일 : 2024.04.03
-        내 용 : 로그인 아이디 중복 확인
+        작성일 : 2024.04.11
+        내 용 : 로그인 이력 등록
     -->
-    <select id="findByCheckLoginId" parameterType="String" resultType="boolean">
-        SELECT COUNT(lgn_id)
-          FROM mbr_info
-         WHERE lgn_id = #{lgnId}
-    </select>
-
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.03
-        내 용 : 회원가입
-    -->
-    <insert id="save" parameterType="JoinDTO">
-        INSERT INTO mbr_info (
-            mbr_id
-            , lgn_id
-            , mbr_nm
-            , ncnm
-            , password
-            , mbl_telno
-            , telno
-            , eml
-            , zip
-            , addr
-            , daddr
-            , mbr_stts
-            , use_yn
-            , sms_rcptn_agre_yn
-            , eml_rcptn_agre_yn
-            , prvc_rcptn_agre_yn
-            , mbr_type
-            , password_chg_dt
-            , frst_reg_ip
-            , sys_pvsn_yn
-            , rgtr
-            , reg_dt
+    <insert id="save" parameterType="LgnHstryVO">
+        INSERT INTO lgn_hstry (
+            lgn_id
+            , lgn_type
+            , cntn_dt
+            , cntn_ip
+            , cntn_oper_sys
+            , device_nm
+            , brwsr_nm
         ) VALUES (
-            #{mbrId}
-            , #{lgnId}
-            , #{mbrNm}
-            , #{ncnm}
-            , #{password}
-            , #{mblTelno}
-            , #{telno}
-            , #{eml}
-            , #{zip}
-            , #{addr}
-            , #{daddr}
-            , 1
-            , 'Y'
-            , #{smsRcptnAgreYn}
-            , #{emlRcptnAgreYn}
-            , #{prvcRcptnAgreYn}
-            , 'S'
+            #{lgnId}
+            , #{lgnType}
             , NOW()
-            , #{frstRegIp}
-            , 1
-            , #{rgtr}
-            , NOW()
+            , #{cntnIp}
+            , #{cntnOperSys}
+            , #{deviceNm}
+            , #{brwsrNm}
         )
     </insert>
-
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.03
-        내 용 : 회원 권한 등록
-    -->
-    <insert id="authorSave" parameterType="MberAuthorVO">
-        INSERT INTO mbr_authrt_info (
-            mbr_id
-            , authrt_cd
-            , rgtr
-            , reg_dt
-        ) VALUE (
-            #{mbrId}
-            , #{authrtCd}
-            , #{rgtr}
-            , NOW()
-        )
-    </insert>
-
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.03
-        내 용 : 회원정보 조회
-    -->
-    <select id="findByMber" parameterType="String" resultMap="mberMap">
-        SELECT mi.mbr_id
-             , mi.lgn_id
-             , mi.mbr_nm
-             , mi.ncnm
-             , mi.password
-             , mi.mbl_telno
-             , mi.telno
-             , mi.eml
-             , mi.zip
-             , mi.addr
-             , mi.daddr
-             , mi.mbr_stts
-             , mi.use_yn
-             , DATE_FORMAT(mi.cntrl_dt, '%Y-%m-%d %H:%i') AS cntrl_dt
-             , mi.cntrl_rsn
-             , mi.sms_rcptn_agre_yn
-             , mi.eml_rcptn_agre_yn
-             , mi.prvc_rcptn_agre_yn
-             , mi.mbr_type
-             , DATE_FORMAT(mi.password_chg_dt, '%Y-%m-%d %H:%i') AS password_chg_dt
-             , mi.frst_reg_ip
-             , mi.sys_pvsn_yn
-             , mi.rgtr
-             , DATE_FORMAT(mi.reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-             , mi.mdfr
-             , DATE_FORMAT(mi.mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
-          FROM mbr_info mi
-         WHERE mi.lgn_id = #{lgnId}
-           AND mi.use_yn = 'Y'
-    </select>
-
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.03
-        내 용 : 회원 권한 정보 조회
-    -->
-    <select id="findByMberAuthor" parameterType="MberVO" resultMap="authMap">
-        SELECT mai.mbr_id
-             , mai.authrt_cd
-             , mai.rgtr
-             , DATE_FORMAT(mai.reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-          FROM mbr_authrt_info mai
-         WHERE mai.mbr_id = #{mbrId}
-    </select>
-
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/mber/mber-SQL.xml
--- src/main/resources/mybatis/mapper/mber/mber-SQL.xml
+++ src/main/resources/mybatis/mapper/mber/mber-SQL.xml
@@ -81,7 +81,7 @@
             , eml_rcptn_agre_yn
             , prvc_rcptn_agre_yn
             , mbr_type
-            , password_change_de
+            , password_chg_dt
             , frst_reg_ip
             , sys_pvsn_yn
             , rgtr
src/main/resources/mybatis/mapper/menu/menu-SQL.xml
--- src/main/resources/mybatis/mapper/menu/menu-SQL.xml
+++ src/main/resources/mybatis/mapper/menu/menu-SQL.xml
@@ -6,63 +6,6 @@
     내 용 : 메뉴 관련
 -->
 <mapper namespace="com.takensoft.cms.menu.dao.MenuDAO">
-
-    <!--
-       작성자 : takensoft
-       작성일 : 2024.04.08
-       내 용 : 최상위 메뉴 조회 [관리자용]
-   -->
-    <select id="findTopMenu" resultType="MenuVO">
-        SELECT menu_id
-             , up_menu_id
-             , menu_nm
-             , menu_expln
-             , menu_grd
-             , menu_sn
-             , menu_type
-             , menu_type_ctgry
-             , link_url
-             , link_type
-             , dgstfn_exmn_use_yn
-             , menu_expsr_yn
-             , use_yn
-             , rgtr
-             , DATE_FORMAT(reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-             , mdfr
-             , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
-          FROM menu_info
-         WHERE up_menu_id IS NULL
-      ORDER BY menu_sn
-    </select>
-
-    <!--
-       작성자 : takensoft
-       작성일 : 2024.04.08
-       내 용 : 하위 메뉴 조회 [관리자용]
-   -->
-    <select id="findChildMenus" parameterType="String" resultType="MenuVO">
-        SELECT menu_id
-             , up_menu_id
-             , menu_nm
-             , menu_expln
-             , menu_grd
-             , menu_sn
-             , menu_type
-             , menu_type_ctgry
-             , link_url
-             , link_type
-             , dgstfn_exmn_use_yn
-             , menu_expsr_yn
-             , use_yn
-             , rgtr
-             , DATE_FORMAT(reg_dt, '%Y-%m-%d %H:%i') AS reg_dt
-             , mdfr
-             , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
-          FROM menu_info
-         WHERE up_menu_id = #{menuId}
-      ORDER BY menu_sn
-    </select>
-
     <!--
         작성자 : takensoft
         작성일 : 2024.04.08
@@ -137,12 +80,7 @@
         )
     </insert>
 
-    <!--
-        작성자 : takensoft
-        작성일 : 2024.04.08
-        내 용 : 메뉴 상세 조회
-    -->
-    <select id="findByMenu" parameterType="String" resultType="MenuVO">
+    <sql id="selectMenu">
         SELECT menu_id
              , up_menu_id
              , menu_nm
@@ -161,6 +99,37 @@
              , mdfr
              , DATE_FORMAT(mdfcn_dt, '%Y-%m-%d %H:%i') AS mdfcn_dt
           FROM menu_info
+    </sql>
+
+    <!--
+       작성자 : takensoft
+       작성일 : 2024.04.08
+       내 용 : 최상위 메뉴 조회 [관리자용]
+   -->
+    <select id="findTopMenu" resultType="MenuVO">
+        <include refid="selectMenu" />
+         WHERE up_menu_id IS NULL
+      ORDER BY menu_sn
+    </select>
+
+    <!--
+       작성자 : takensoft
+       작성일 : 2024.04.08
+       내 용 : 하위 메뉴 조회 [관리자용]
+   -->
+    <select id="findChildMenus" parameterType="String" resultType="MenuVO">
+        <include refid="selectMenu" />
+         WHERE up_menu_id = #{menuId}
+      ORDER BY menu_sn
+    </select>
+
+    <!--
+        작성자 : takensoft
+        작성일 : 2024.04.08
+        내 용 : 메뉴 상세 조회
+    -->
+    <select id="findByMenu" parameterType="String" resultType="MenuVO">
+        <include refid="selectMenu" />
          WHERE menu_id = #{menuId}
     </select>
 
Add a comment
List