|
@@ -212,6 +212,10 @@
|
|
|
<result property="subjectNames" column="subject_names"/>
|
|
|
<result property="sectionNum" column="section_num"/>
|
|
|
<result property="goodsLearningOrder" column="goods_learning_order"/>
|
|
|
+ <result property="realName" column="realname"/>
|
|
|
+ <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
|
|
|
+ <result property="telPhone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
|
|
|
+ <result property="studyStatus" column="study_status"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
|
|
@@ -539,7 +543,8 @@
|
|
|
(SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = g.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name,
|
|
|
(SELECT `status` from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_status,
|
|
|
(case WHEN(SELECT COUNT(1) from profile_tp where `status`=1 and FIND_IN_SET(g.goods_id,goods_ids) ) >0 then 1 ELSE 0 end) as profile_tp_status,
|
|
|
- (SELECT GROUP_CONCAT(subject_name) from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names
|
|
|
+ (SELECT GROUP_CONCAT(subject_name) from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names,
|
|
|
+ (SELECT count(*) from user_study_record usr where usr.user_id = o.user_id and usr.order_goods_id = og.order_goods_id) as study_status
|
|
|
<if test="userId != null and userId != ''">
|
|
|
,
|
|
|
us.exam_status as sub_exam_status,
|
|
@@ -592,7 +597,78 @@
|
|
|
<if test="studyStatus != null and studyStatus == 1">
|
|
|
and (SELECT count(*) from user_study_record usr where usr.user_id = o.user_id and usr.order_goods_id = og.order_goods_id ) =0
|
|
|
</if>
|
|
|
- order by o.create_time desc
|
|
|
+ order by og.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="goodsStudyProgressList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="GoodsUserVo">
|
|
|
+ SELECT
|
|
|
+ g.*,
|
|
|
+ u.realname,
|
|
|
+ u.id_card,
|
|
|
+ u.telphone,
|
|
|
+ o.user_id,
|
|
|
+ og.order_goods_id,
|
|
|
+ og.grade_id,
|
|
|
+ IFNULL(ge.exam_num,0) as exam_num,
|
|
|
+ (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.grade_id = og.grade_id and ubr.user_id = o.user_id and ubr.current_status = 1) as record_num
|
|
|
+ FROM
|
|
|
+ `order` o
|
|
|
+ LEFT JOIN `user` u ON u.user_id = o.user_id
|
|
|
+ LEFT JOIN order_goods og ON og.order_sn = o.order_sn
|
|
|
+ LEFT JOIN goods g on og.goods_id = g.goods_id
|
|
|
+ LEFT JOIN course_business cb on g.business_id = cb.id
|
|
|
+ LEFT JOIN (SELECT
|
|
|
+ COUNT( m.id ) AS exam_num,
|
|
|
+ c.goods_id
|
|
|
+ FROM
|
|
|
+ course_menu_exam m
|
|
|
+ LEFT JOIN goods_course c ON m.course_id = c.course_id
|
|
|
+ where
|
|
|
+ m.type in (1,3)
|
|
|
+ GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
|
|
|
+ where 1=1
|
|
|
+ AND og.`status` = 1
|
|
|
+ -- AND og.refund_status in (0,1,3)
|
|
|
+ AND og.refund_status in (0,3)
|
|
|
+ AND og.pay_status in (2,3,4)
|
|
|
+ AND g.goods_type =1
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and o.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
+ AND g.education_type_id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="orderGoodsId != null and orderGoodsId != ''">
|
|
|
+ AND og.order_goods_id = #{orderGoodsId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsId != null and goodsId != ''">
|
|
|
+ AND og.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ <if test="oldCompanyId != null and oldCompanyId != ''">
|
|
|
+ AND o.old_company_id = #{oldCompanyId}
|
|
|
+ </if>
|
|
|
+ <if test="oldInstitutionId != null and oldInstitutionId != ''">
|
|
|
+ AND o.old_institution_id = #{oldInstitutionId}
|
|
|
+ </if>
|
|
|
+ <if test="oldCustomerId != null and oldCustomerId != ''">
|
|
|
+ AND o.old_customer_id = #{oldCustomerId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ and o.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="realname != null and realname !='' ">
|
|
|
+ AND u.realname like concat('%', #{realname}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="idCard != null and idCard !='' ">
|
|
|
+ AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
|
|
|
+ </if>
|
|
|
+ <if test="telphone != null and telphone !='' ">
|
|
|
+ AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
|
|
|
+ </if>
|
|
|
+ order by og.create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="goodsHandoutsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="GoodsUserVo">
|