he2802 2 tahun lalu
induk
melakukan
ccbe8692f2

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -39,6 +39,8 @@ public interface CourseMapper extends BaseMapper<Course> {
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
+    List<GoodsUserVo> goodsProgressList(CourseQueryBo bo);
+
     List<GoodsUserVo> goodsStudyProgressList(CourseQueryBo bo);
 
     List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -963,7 +963,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
 
     @Override
     public List<GoodsUserVo> goodsProgressList(CourseQueryBo bo) {
-        List<GoodsUserVo> goodsUserVos = baseMapper.goodsList(bo);
+        List<GoodsUserVo> goodsUserVos = baseMapper.goodsProgressList(bo);
         //用户课程得详细信息
         for (GoodsUserVo goodsUserVo : goodsUserVos) {
             //获得当前所在班级

+ 61 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -591,6 +591,67 @@
         </if>
     </select>
 
+    <select id="goodsProgressList" 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,
+        og.create_time as open_goods_time
+        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
+        where 1=1
+        AND og.`status` = 1
+        AND og.refund_status in (0,3)
+        AND og.pay_status in (2,3,4)
+        <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>
+        <if test="studyFinishStatus != null and studyFinishStatus == 1">
+            AND (SELECT cgu.period_wait_time FROM class_grade_user cgu  where cgu.`status`=1  and cgu.grade_id = og.grade_id and cgu.user_id = o.user_id and cgu.order_goods_id = og.order_goods_id) >0
+        </if>
+        <if test="studyFinishStatus != null and studyFinishStatus == 2">
+            AND (SELECT cgu.period_wait_time FROM class_grade_user cgu  where cgu.`status`=1  and cgu.grade_id = og.grade_id and cgu.user_id = o.user_id and cgu.order_goods_id = og.order_goods_id) is null
+        </if>
+        order by og.create_time desc
+    </select>
+
     <select id="goodsStudyProgressList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="GoodsUserVo">
         SELECT
         g.*,