이은진 이은진 07-26
240726 이은진 지문 검색 기능 추가
@711b6d7d53bc0d57d81ad9c54c9fdcdae8e5e537
src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
--- src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
+++ src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
@@ -62,7 +62,8 @@
                 .requestMatchers( "/auth/**", "/auth/login.json").permitAll() // /user/** 경로는 모두 허용
                 .requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll() // swagger 진입 허용
                 .requestMatchers("/test/**").permitAll()
-                .requestMatchers("/text/**").permitAll()
+                .requestMatchers("/text/**").permitAll() // 지문 정보 진입 허용
+                .requestMatchers("/schedule/**").permitAll() // 학습일정 정보 진입 허용
                 .requestMatchers("/studentInfo/**").permitAll() // 학생 정보 진입 허용(민수)
                 .requestMatchers("/board/**").permitAll() // 게시판 정보 진입 허용
                 .requestMatchers("/book/**").permitAll() // 교재 정보 진입 허용
src/main/java/com/takensoft/ai_lms/lms/text/dao/TextDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/text/dao/TextDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/text/dao/TextDAO.java
@@ -31,4 +31,7 @@
 
     // 지문 삭제
     int textDelete(String textId) throws Exception;
+
+    // 지문 검색
+    List<HashMap<String, Object>> searchText(HashMap<String, Object> params) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/text/service/Impl/TextServiceImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/text/service/Impl/TextServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/text/service/Impl/TextServiceImpl.java
@@ -80,4 +80,13 @@
     public int textDelete(String textId) throws Exception {
         return textDAO.textDelete(textId);
     }
+
+
+    /**
+     * 지문 검색
+     */
+    @Override
+    public List<HashMap<String, Object>> searchText(HashMap<String, Object> params) throws Exception {
+        return textDAO.searchText(params);
+    }
 }
src/main/java/com/takensoft/ai_lms/lms/text/service/TextService.java
--- src/main/java/com/takensoft/ai_lms/lms/text/service/TextService.java
+++ src/main/java/com/takensoft/ai_lms/lms/text/service/TextService.java
@@ -29,4 +29,7 @@
 
     // 지문 삭제
     int textDelete(String textId) throws Exception;
+
+    // 지문 검색
+    public List<HashMap<String, Object>> searchText(HashMap<String, Object> params) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/text/web/TextController.java
--- src/main/java/com/takensoft/ai_lms/lms/text/web/TextController.java
+++ src/main/java/com/takensoft/ai_lms/lms/text/web/TextController.java
@@ -138,5 +138,19 @@
             return gson.toJson(response);
         }
     }
+
+
+    /**
+     * 지문 검색
+     */
+    @GetMapping("/textSearch.json")
+    @Operation(summary = "지문 검색")
+    public HashMap<String, Object> searchText(@RequestBody HashMap<String, Object> params) throws Exception {
+        HashMap<String, Object> result = new HashMap<>();
+        List<HashMap<String, Object>> textList = TextService.searchText(params);
+        result.put("list", textList);
+        return result;
+    }
+
 }
 
src/main/resources/mybatis/mapper/lms/text-SQL.xml
--- src/main/resources/mybatis/mapper/lms/text-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/text-SQL.xml
@@ -97,4 +97,31 @@
     WHERE text_id = #{textId}
     </delete>
 
+
+    <!--
+        작성자 : 이은진
+        작성일 : 2024.07.26
+        내 용 : 지문 검색
+    -->
+    <select id="searchText" parameterType="TextVO" resultMap="textMap">
+        SELECT *
+        FROM text
+        WHERE 1 = 1
+        <if test="option != null and keyword != null">
+            <choose>
+                <when test="option == 'textId'">
+                    AND text_id LIKE CONCAT('%', #{keyword}, '%')
+                </when>
+                <when test="option == 'textCnt'">
+                    AND text_cnt LIKE CONCAT('%', #{keyword}, '%')
+                </when>
+                <when test="option == 'regDt'">
+                    AND TO_CHAR(reg_dt, 'YYYY-MM-DD HH24:MI:SS') LIKE CONCAT('%', #{keyword}, '%')
+                </when>
+            </choose>
+        </if>
+        ORDER BY text_id DESC
+        LIMIT #{pageSize} OFFSET #{startIndex}
+    </select>
+
 </mapper>
Add a comment
List