|
@@ -128,6 +128,7 @@
|
|
|
<result property="chapterNum" column="chapter_num"/>
|
|
|
<result property="status" column="status"/>
|
|
|
<result property="sectionNum" column="section_num"/>
|
|
|
+ <result property="fileNum" column="file_num"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
|
|
@@ -733,10 +734,68 @@
|
|
|
ORDER BY s.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="querDangAnHandoutsStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"
|
|
|
+ resultMap="ExamStudyRecordVoResult">
|
|
|
+ SELECT
|
|
|
+ g.goods_id,
|
|
|
+ #{userId} as user_id,
|
|
|
+ s.create_time,
|
|
|
+ g.goods_name,
|
|
|
+ g.`year`,
|
|
|
+ g.`status`,
|
|
|
+ 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,
|
|
|
+ s.service_start_time,
|
|
|
+ s.service_end_time,
|
|
|
+ ( SELECT count(*) FROM course_file cf WHERE cf.handouts_id =g.handouts_id AND cf.type = 1 AND cf.`status` = 1 ) AS file_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
|
|
|
+ where 1=1
|
|
|
+ AND s.refund_status in (0,1,3)
|
|
|
+ AND s.pay_status in (2,3,4)
|
|
|
+ AND o.`status` = 1
|
|
|
+ AND g.goods_type = 8
|
|
|
+ <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="querDangAnLiveStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"
|
|
|
resultMap="ExamStudyRecordVoResult">
|
|
|
SELECT
|
|
|
- DISTINCT g.goods_id,
|
|
|
+ g.goods_id,
|
|
|
#{userId} as user_id,
|
|
|
s.create_time,
|
|
|
g.goods_name,
|