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">
<!--
작 성 자 : 권지수
작 성 일 : 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,
user_id,
book_id,
unit_id,
prblm_mtr1,
prblm_mtr2,
prblm_mtr3,
prblm_mtr4,
prblm_mtr5,
prblm_mtr6
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,
user_id,
book_id,
unit_id,
prblm_mtr1,
prblm_mtr2,
prblm_mtr3,
prblm_mtr4,
prblm_mtr5,
prblm_mtr6
) VALUES (
#{prblmId},
#{prblmExpln},
#{prblmScr},
#{prblmHint},
#{prblmCmmt},
#{fileMngId},
#{prblmTypeId},
#{prblmCtgryId},
#{userId},
#{bookId},
#{unitId},
#{prblmMtr1},
#{prblmMtr2},
#{prblmMtr3},
#{prblmMtr4},
#{prblmMtr5},
#{prblmMtr6}
)
</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},
user_id = #{userId},
book_id = #{bookId},
unit_id = #{unitId},
prblm_mtr1 = #{prblmMtr1},
prblm_mtr2 = #{prblmMtr2},
prblm_mtr3 = #{prblmMtr3},
prblm_mtr4 = #{prblmMtr4},
prblm_mtr5 = #{prblmMtr5},
prblm_mtr6 = #{prblmMtr6}
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,
user_id,
book_id,
unit_id,
prblm_mtr1,
prblm_mtr2,
prblm_mtr3,
prblm_mtr4,
prblm_mtr5,
prblm_mtr6
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,
p.user_id AS userId,
p.book_id AS bookId,
p.unit_id AS unitId,
p.prblm_mtr1 AS prblmMtr1,
p.prblm_mtr2 AS prblmMtr2,
p.prblm_mtr3 AS prblmMtr3,
p.prblm_mtr4 AS prblmMtr4,
p.prblm_mtr5 AS prblmMtr5,
p.prblm_mtr6 AS prblmMtr6
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>