|
@@ -121,6 +121,9 @@
|
|
<result property="serviceStartTime" column="service_start_time"/>
|
|
<result property="serviceStartTime" column="service_start_time"/>
|
|
<result property="serviceEndTime" column="service_end_time"/>
|
|
<result property="serviceEndTime" column="service_end_time"/>
|
|
<result property="orderGoodsId" column="order_goods_id"/>
|
|
<result property="orderGoodsId" column="order_goods_id"/>
|
|
|
|
+ <result property="moduleExamNum" column="module_exam_num"/>
|
|
|
|
+ <result property="chapterExamNum" column="chapter_exam_num"/>
|
|
|
|
+ <result property="categoryName" column="category_name"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
|
|
<resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
|
|
@@ -656,6 +659,76 @@
|
|
ORDER BY s.create_time DESC
|
|
ORDER BY s.create_time DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="querDangAnExamStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"
|
|
|
|
+ resultMap="ExamStudyRecordVoResult">
|
|
|
|
+ SELECT
|
|
|
|
+ DISTINCT g.goods_id,
|
|
|
|
+ #{userId} as user_id,
|
|
|
|
+ s.create_time,
|
|
|
|
+ g.goods_name,
|
|
|
|
+ g.`year`,
|
|
|
|
+ g.`code`,
|
|
|
|
+ g.class_hours,
|
|
|
|
+ g.study_start_time,
|
|
|
|
+ g.study_end_time,
|
|
|
|
+ s.service_start_time,
|
|
|
|
+ s.service_end_time,
|
|
|
|
+ s.order_goods_id,
|
|
|
|
+ ( SELECT m.category_name FROM major m WHERE m.id =g.major_id LIMIT 1) AS category_name,
|
|
|
|
+ ( SELECT i.business_name FROM course_business i WHERE i.id = g.business_id LIMIT 1) AS business_name,
|
|
|
|
+ ( SELECT p.project_name FROM course_project_type p WHERE p.id = g.project_id LIMIT 1) AS project_name,
|
|
|
|
+ (SELECT COUNT(*) FROM goods_attached a where a.goods_id=g.goods_id and a.type = 1) as module_exam_num,
|
|
|
|
+ ((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)) as chapter_exam_num,
|
|
|
|
+ ( SELECT e.education_name FROM course_education_type e WHERE e.id = g.education_type_id LIMIT 1) 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_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
|
|
|
|
+ create_time ASC LIMIT 1) as start_time,
|
|
|
|
+ (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
|
|
|
|
+ create_time DESC LIMIT 1) as end_time,
|
|
|
|
+ (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
|
|
|
|
+ as stu_all_num,
|
|
|
|
+ s.service_start_time,
|
|
|
|
+ s.service_end_time
|
|
|
|
+ FROM
|
|
|
|
+ goods g
|
|
|
|
+ LEFT JOIN order_goods s ON g.goods_id = s.goods_id AND s.pay_status in (2,3,4)
|
|
|
|
+ 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>
|
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
|
+ AND g.project_id = #{projectId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
|
+ AND g.education_type_id = #{educationTypeId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="goodsName != null and goodsName != '' ">
|
|
|
|
+ and g.goods_name like concat('%', #{goodsName}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="goodsStatus != null and goodsStatus != '' ">
|
|
|
|
+ and g.`status` = #{goodsStatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="studyStartTime != null and studyStartTime != '' ">
|
|
|
|
+ and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND r.create_time >= #{studyStartTime} )>0
|
|
|
|
+ </if>
|
|
|
|
+ <if test="studyEndTime != null and studyEndTime != '' ">
|
|
|
|
+ and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND #{studyEndTime} >= r.create_time )>0
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY s.create_time DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="listExamSon" parameterType="com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo"
|
|
<select id="listExamSon" parameterType="com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo"
|
|
resultMap="ExamSonStudyRecordVoResult">
|
|
resultMap="ExamSonStudyRecordVoResult">
|
|
SELECT
|
|
SELECT
|