File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<?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="com.takensoft.ai_lms.lms.text.dao.TextDAO">
<resultMap id="textMap" type="TextVO">
<result property="textId" column="text_id"/>
<result property="textTtl" column="text_ttl"/>
<result property="textCnt" column="text_cnt"/>
<result property="textUrl" column="text_url"/>
<result property="regDt" column="reg_dt"/>
<result property="fileMngId" column="file_mng_id"/>
<result property="textTypeId" column="text_type_id"/>
<result property="userId" column="user_id"/>
<result property="bookId" column="book_id"/>
<result property="unitId" column="unit_id"/>
</resultMap>
<!--
작성자 : 이은진
작성일 : 2024.07.26
내 용 : 지문 등록
-->
<insert id="insertText" parameterType="TextVO">
INSERT INTO text (text_id
,text_ttl
,text_cnt
,text_url
,reg_dt
,file_mng_id
,text_type_id
,user_id
,book_id
,unit_id
) VALUES (#{textId}
,#{textTtl}
,#{textCnt}
,#{textUrl}
,now()
,#{fileMngId}
,#{textTypeId}
,#{userId}
,#{bookId}
,#{unitId}
);
</insert>
<!--
작성자 : 이은진
작성일 : 2024.07.26
내 용 : 지문 수 조회
-->
<select id="textCount" resultType="Integer">
SELECT COUNT(*)
FROM text
</select>
<!--
작성자 : 이은진
작성일 : 2024.07.26
내 용 : 지문 리스트 조회
-->
<select id="selectTextList" resultMap="textMap">
SELECT text_id
,text_ttl
,text_cnt
,text_url
,reg_dt
,file_mng_id
,text_type_id
,user_id
,book_id
,unit_id
FROM text
ORDER BY text_id DESC
LIMIT #{pageSize}
OFFSET #{startIndex}
</select>
<!--
작성자 : 이은진
작성일 : 2024.07.26
내 용 : 지문 출력
-->
<select id="selectOneText" parameterType="HashMap" resultType="HashMap">
SELECT text_id
,text_ttl
, text_cnt
,text_url
, reg_dt
, file_mng_id
, text_type_id
,user_id
,book_id
,unit_id
FROM text
WHERE text_id = #{textId}
ORDER BY text_id DESC
</select>
<!--
작성자 : 이은진
작성일 : 2024.07.26
내 용 : 지문 수정
-->
<update id="textUpdate" parameterType="TextVO">
UPDATE text
SET text_ttl = #{textTtl}
, text_cnt = #{textCnt}
, text_url = #{textUrl}
, file_mng_id = #{fileMngId}
, text_type_id = #{textTypeId}
WHERE text_id = #{textId}
</update>
<!--
작성자 : 이은진
작성일 : 2024.07.26
내 용 : 지문 삭제
-->
<delete id="textDelete" parameterType="String">
DELETE FROM text
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 == 'textTtl'">
AND text_ttl LIKE CONCAT('%', #{keyword}, '%')
</when>
<when test="option == 'textCnt'">
AND text_cnt LIKE CONCAT('%', #{keyword}, '%')
</when>
<when test="option == 'userId'">
AND user_id 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>