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.problem.dao.ProblemDAO">
<!--resultMap id="problemMap" type="ProblemVO">
<result property="prblmId" column="prblm_id"/>
<result property="prblmExpln" column="prblm_expln"/>
<result property="prblmScr" column="prblm_scr"/>
<result property="prblmHint" column="prblm_hint"/>
<result property="prblmCmmt" column="prblm_cmmt"/>
<result property="fileMngId" column="file_mng_id"/>
<result property="prblmTypeId" column="prblm_type_id"/>
<result property="prblmCtgryId" column="prblm_ctgry_id"/>
</resultMap-->
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.25
내 용 : 문제 정보 read
-->
<select id="problemInfo" parameterType="ProblemVO" resultType="ProblemVO">
SELECT
prblm_id,
prblm_expln,
prblm_scr,
prblm_hint,
prblm_cmmt,
file_mng_id,
prblm_type_id,
prblm_ctgry_id
FROM problem
WHERE prblm_id = #{prblmId}
</select>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.25
내 용 : 문제 선지 리스트
-->
<select id="problemDetailList" parameterType="ProblemDetailVO" resultType="ProblemDetailVO">
SELECT
prblm_dtl_id,
prblm_id,
prblm_dtl_expln,
prblm_yn,
file_mng_id
FROM problem_detail
WHERE prblm_id = #{prblmId}
</select>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.26
내 용 : 문제 정보 insert
-->
<insert id="insertProblem" parameterType="ProblemVO">
INSERT INTO problem (
prblm_id,
prblm_expln,
prblm_scr,
prblm_hint,
prblm_cmmt,
file_mng_id,
prblm_type_id,
prblm_ctgry_id
) VALUES (
#{prblmId},
#{prblmExpln},
#{prblmScr},
#{prblmHint},
#{prblmCmmt},
#{fileMngId},
#{prblmTypeId},
#{prblmCtgryId}
)
</insert>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.26
내 용 : 문제 상세 정보 insert
-->
<insert id="insertProblemDetail" parameterType="ProblemDetailVO">
INSERT INTO problem_detail (
prblm_dtl_id,
prblm_id,
prblm_dtl_expln,
prblm_yn,
file_mng_id
) VALUES (
#{prblmDtlId},
#{prblmId},
#{prblmDtlExpln},
#{prblmYn},
#{fileMngId}
)
</insert>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.26
내 용 : 문제 정보 update
-->
<update id="updateProblem" parameterType="ProblemVO">
UPDATE problem
SET
prblm_expln = #{prblmExpln},
prblm_scr = #{prblmScr},
prblm_hint = #{prblmHint},
prblm_cmmt = #{prblmCmmt},
file_mng_id = #{fileMngId},
prblm_type_id = #{prblmTypeId},
prblm_ctgry_id = #{prblmCtgryId}
WHERE prblm_id = #{prblmId}
</update>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.26
내 용 : 문제 상세 정보 update
-->
<update id="updateProblemDetail" parameterType="ProblemDetailVO">
UPDATE problem_detail
SET
prblm_dtl_expln = #{prblmDtlExpln},
prblm_yn = #{prblmYn},
file_mng_id = #{fileMngId}
WHERE prblm_dtl_id = #{prblmDtlId}
</update>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.26
내 용 : 문제 정보 delete
-->
<delete id="deleteProblem" parameterType="problemVO">
DELETE FROM problem
WHERE prblm_id = #{prblmId}
</delete>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.30
내 용 : 전체 문제 목록 조회
-->
<select id="problemList" parameterType="SearchVO" resultType="ProblemVO">
SELECT
prblm_id,
prblm_expln,
prblm_scr,
prblm_hint,
prblm_cmmt,
file_mng_id,
prblm_type_id,
prblm_ctgry_id
FROM problem
WHERE 1 = 1
<if test="option != null and keyword != null">
<choose>
<when test="option == 'prblm_expln'">
AND prblm_expln LIKE CONCAT('%', #{keyword}, '%')
</when>
<when test="option == 'prblm_type_id'">
AND prblm_type_id = #{keyword}
</when>
<when test="option == 'prblm_ctgry_id'">
AND prblm_ctgry_id = #{keyword}
</when>
<otherwise>
AND (prblm_expln LIKE CONCAT('%', #{keyword}, '%')
OR prblm_type_id = #{keyword}
OR prblm_ctgry_id = #{keyword})
</otherwise>
</choose>
</if>
LIMIT #{pageSize} OFFSET #{startIndex}
</select>
<!--
작 성 자 : 권지수
작 성 일 : 2024.07.25
내 용 : 특정 단원 평가의 문제 목록 조회
-->
<select id="evaluationProblemList" parameterType="SearchVO" resultType="ProblemVO">
SELECT
p.prblm_id AS prblmId,
p.prblm_expln AS prblmExpln,
p.prblm_scr AS prblmScr,
p.prblm_hint AS prblmHint,
p.prblm_cmmt AS prblmCmmt,
p.file_mng_id AS fileMngId,
p.prblm_type_id AS prblmTypeId,
p.prblm_ctgry_id AS prblmCtgryId
FROM
eval_problem ep
JOIN
problem p ON ep.prblm_id = p.prblm_id
WHERE
ep.eval_id = #{evalId}
<if test="option != null and keyword != null">
<choose>
<when test="option == 'prblm_expln'">
AND prblm_expln LIKE CONCAT('%', #{keyword}, '%')
</when>
<when test="option == 'prblm_type_id'">
AND prblm_type_id = #{keyword}
</when>
<when test="option == 'prblm_ctgry_id'">
AND prblm_ctgry_id = #{keyword}
</when>
<otherwise>
AND (prblm_expln LIKE CONCAT('%', #{keyword}, '%')
OR prblm_type_id = #{keyword}
OR prblm_ctgry_id = #{keyword})
</otherwise>
</choose>
</if>
</select>
</mapper>