mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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.panzhihua.service_community.dao.ComActQuestnaireAnswerContentDAO">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActQuestnaireAnswerContentDO">
        <id column="id" property="id" />
        <result column="create_by" property="createBy" />
        <result column="create_at" property="createAt" />
        <result column="update_by" property="updateBy" />
        <result column="update_at" property="updateAt" />
        <result column="choice" property="choice" />
        <result column="answer_content" property="answerContent" />
        <result column="sub_id" property="subId" />
        <result column="user_id" property="userId" />
        <result column="type" property="type" />
        <result column="selection_id" property="selectionId" />
        <result column="answer_id" property="answerId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, create_by, create_at, update_by, update_at, choice, answer_content, sub_id, user_id, type, selection_id, answer_id
    </sql>
 
    <select id="selectListByQuestnaire" resultType="com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO">
        SELECT
            caqs.type AS optionType,
            caqac.answer_id as reserveRecordId,
            caqac.sub_id as reserveSubId,
            caqac.answer_content,
            caqac.type,
            caqac.id,
            su.nick_name,
            caqua.create_at AS `time`
        FROM
            com_act_questnaire_answer_content caqac
            LEFT JOIN com_act_questnaire_sub caqs ON caqac.sub_id = caqs.id
            LEFT JOIN com_act_questnaire caq ON caqs.que_id = caq.id
            LEFT JOIN sys_user su ON caqac.user_id = su.user_id
            LEFT JOIN com_act_questnaire_user_answer caqua ON caqua.id = caqac.answer_id
        WHERE
            caq.id = #{questId}
        ORDER BY
            caqac.answer_id asc,caqac.id ASC
    </select>
 
</mapper>