|
@@ -62,6 +62,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="status" column="status"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.user.vo.ExamStudyRecordVo" id="ExamStudyRecordVoResult">
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="goodsName" column="goods_name"/>
|
|
|
+ <result property="year" column="year"/>
|
|
|
+ <result property="classHours" column="class_hours"/>
|
|
|
+ <result property="startTime" column="start_time"/>
|
|
|
+ <result property="endTime" column="end_time"/>
|
|
|
+ <result property="studyStartTime" column="study_start_time"/>
|
|
|
+ <result property="studyEndTime" column="study_end_time"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="schoolName" column="school_name"/>
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
+ <result property="examNum" column="exam_num"/>
|
|
|
+ <result property="stuAllNum" column="stu_all_num"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
<select id="selectList" parameterType="com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo" resultMap="UserStudyRecordResult">
|
|
|
SELECT DISTINCT
|
|
|
temp.course_id,
|
|
@@ -268,4 +286,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and m.course_id=#{courseId}
|
|
|
and s.section_type=#{sectionType}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="querExamStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo" resultMap="ExamStudyRecordVoResult">
|
|
|
+ SELECT
|
|
|
+ DISTINCT g.goods_id,
|
|
|
+ #{userId} as user_id,
|
|
|
+ g.goods_name,
|
|
|
+ g.`year`,
|
|
|
+ g.`code`,
|
|
|
+ g.class_hours,
|
|
|
+ g.study_start_time,
|
|
|
+ g.study_end_time,
|
|
|
+ ( SELECT i.business_name FROM course_business i WHERE i.id = g.business_id ) AS business_name,
|
|
|
+ ( SELECT p.project_name FROM course_project_type p WHERE p.id = g.business_id ) AS project_name,
|
|
|
+ ( SELECT s.school_name FROM school s WHERE s.id = g.school_id ) AS school_name,
|
|
|
+ ( SELECT e.education_name FROM course_education_type e WHERE e.id = g.education_type_id ) AS education_name,
|
|
|
+ (SELECT COUNT(a.id)+(SELECT COUNT(a.id) FROM goods_attached e LEFT JOIN question_chapter_exam a on e.major_id = a.chapter_exam_id where e.goods_id = g.goods_id and e.type=2)+(SELECT COUNT(h.id) FROM goods_attached e LEFT JOIN question_module_chapter a on e.major_id = a.module_exam_id LEFT JOIN question_chapter_exam h on a.chapter_exam_id = h.chapter_exam_id where e.goods_id = g.goods_id and e.type=1) FROM goods_attached a where a.goods_id=g.goods_id and a.type = 3) as exam_num,
|
|
|
+ (SELECT create_time FROM user_bank_record r where r.goods_id=g.goods_id ORDER BY create_time ASC LIMIT 1) as start_time,
|
|
|
+ (SELECT create_time FROM user_bank_record r where r.goods_id=g.goods_id ORDER BY create_time DESC LIMIT 1) as end_time,
|
|
|
+ (SELECT COUNT(DISTINCT exam_id) FROM user_bank_record r where r.goods_id=g.goods_id) as stu_all_num
|
|
|
+ FROM
|
|
|
+ goods g
|
|
|
+ LEFT JOIN order_goods s ON g.goods_id = s.goods_id
|
|
|
+ LEFT JOIN `order` o ON o.order_sn = s.order_sn
|
|
|
+ WHERE
|
|
|
+ g.goods_type =2
|
|
|
+ <if test="userId != null and userId !=''">
|
|
|
+ AND o.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|