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.survey.dao.SurveyDAO">
<resultMap id="surveyMap" type="SurveyVO">
<result property="srvyId" column="srvy_id"/>
<result property="srvyType" column="srvy_type"/>
<result property="srvyCnt" column="srvy_cnt"/>
<collection property="surveyDetail" ofType="SurveyDetailVO">
<result property="srvyDtlId" column="srvy_dtl_id" />
<result property="srvyDtlCnt" column="srvy_dtl_cnt" />
</collection>
</resultMap>
<!-- <resultMap id="surveyDetailMap" type="SurveyDetailVO">-->
<!-- <result property="srvyDtlId" column="srvy_dtl_id" />-->
<!-- <result property="srvyDtlCnt" column="srvy_dtl_cnt" />-->
<!-- <result property="srvyId" column="srvy_id" />-->
<!-- <collection property="survey" ofType="SurveyVO">-->
<!-- <result property="srvyId" column="srvy_id"/>-->
<!-- <result property="srvyType" column="srvy_type"/>-->
<!-- <result property="srvyCnt" column="srvy_cnt"/>-->
<!-- </collection>-->
<!-- </resultMap>-->
<!--
작성자 : 박세훈
작성일 : 2024.07.29
내 용 : 설문 조사 정보 등록
-->
<insert id="insertSurvey" parameterType="SurveyVO">
INSERT INTO survey( srvy_id,
srvy_type,
srvy_cnt)
VALUES (#{srvyId},
#{srvyType},
#{srvyCnt});
</insert>
<!--
작성자 : 박세훈
작성일 : 2024.07.30
내 용 : 설문 조사 상세 정보 등록
-->
<insert id="insertSurveyDetail" parameterType="java.util.List">
INSERT INTO survey_detail( srvy_dtl_id,
srvy_dtl_cnt,
srvy_id)
VALUES
<foreach collection="list" item="detail" separator=",">
(#{detail.srvyDtlId},
#{detail.srvyDtlCnt},
#{detail.srvyId})
</foreach>
</insert>
<!--
작성자 : 박세훈
작성일 : 2024.07.29
내 용 : 설문 조사 정보 조회
-->
<select id="surveyList" parameterType="SurveyVO">
SELECT *
FROM survey
</select>
<!--
작성자 : 박세훈
작성일 : 2024.07.30
내 용 : 설문 조사 상세 정보 조회
-->
<select id="surveyDetailList" resultMap="surveyMap">
SELECT s.srvy_id,
s.srvy_cnt,
s.srvy_type,
d.srvy_dtl_cnt,
d.srvy_dtl_id
FROM survey s
LEFT JOIN survey_detail d ON s.srvy_id = d.srvy_id
ORDER BY s.srvy_id DESC
</select>
<!--
작성자 : 박세훈
작성일 : 2024.07.29
내 용 : 설문 조사 정보 수정
-->
<update id="updateSurvey" parameterType="SurveyVO">
UPDATE survey
SET srvy_type = #{srvyType},
srvy_cnt = #{srvyCnt}
WHERE
srvy_id = #{srvyId}
</update>
<!--
작성자 : 박세훈
작성일 : 2024.07.29
내 용 : 설문 조사 정보 삭제
-->
<delete id="deleteSurvey" parameterType="String">
DELETE FROM survey
WHERE srvy_id = #{srvyId}
</delete>
<delete id="deleteSurveyDetail" parameterType="String">
DELETE FROM survey_detail
WHERE srvy_id = #{srvyId}
</delete>
</mapper>