|
|
@@ -212,6 +212,9 @@
|
|
|
<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"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
|
|
|
@@ -592,7 +595,67 @@
|
|
|
<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>
|
|
|
+ order by og.create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="goodsHandoutsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="GoodsUserVo">
|
|
|
@@ -634,7 +697,7 @@
|
|
|
<if test="goodsId != null and goodsId != ''">
|
|
|
AND og.goods_id = #{goodsId}
|
|
|
</if>
|
|
|
- order by o.create_time desc
|
|
|
+ order by og.create_time desc
|
|
|
</select>
|
|
|
|
|
|
|