he2802 vor 3 Jahren
Ursprung
Commit
72bc768f8d

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserCertificateQueryBo.java

@@ -74,4 +74,10 @@ public class UserCertificateQueryBo extends BaseEntity {
 	/** 项目ID */
 	@ApiModelProperty("项目ID")
 	private Long projectId;
+
+	@ApiModelProperty("关键词")
+	private String searchKey;
+
+	@ApiModelProperty("证书类型ID")
+	private Long typeId;
 }

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserCertificateMapper.xml

@@ -68,5 +68,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN course_education_type cet ON uc.education_type_id = cet.id
                 LEFT JOIN course_project_type cpt ON uc.project_id = cpt.id
                 LEFT JOIN course_business cb ON uc.business_id = cb.id
+        where 1=1
+        <if test="typeId != null and typeId != ''">
+            AND c.id = #{typeId}
+        </if>
+        <if test="searchKey != null and searchKey != ''">
+            and (u.realname like concat('%', #{searchKey}, '%') or u.id_card like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="trainStartTime != null and trainStartTime != ''">
+            AND uc.train_start_time > #{trainStartTime}
+        </if>
+        <if test="trainEndTime != null and trainEndTime != ''">
+            AND #{trainEndTime} > uc.train_end_time
+        </if>
     </select>
 </mapper>

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -156,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             e.do_type,
             uer.total_question_num
         FROM
-            ( SELECT exam_id, MAX( total_question_num ) total_question_num FROM user_exam_record WHERE user_id = #{userId} AND goods_id = #{goodsId} GROUP BY exam_id ) uer
+            ( SELECT uer.exam_id, count(eq.question_id) total_question_num FROM user_exam_record uer LEFT JOIN exam_question eq on uer.exam_id = eq.exam_id WHERE uer.user_id = #{userId}  AND uer.goods_id = #{goodsId} GROUP BY uer.exam_id) uer
                 LEFT JOIN exam e ON e.exam_id = uer.exam_id
 
     </select>

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -375,6 +375,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
         DISTINCT g.goods_id,
         #{userId} as user_id,
+        s.create_time,
         g.goods_name,
         g.`year`,
         g.`code`,
@@ -391,13 +392,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.goods_id=g.goods_id  AND r.user_id = #{userId}) as stu_all_num
         FROM
         goods g
-        LEFT JOIN order_goods s ON g.goods_id = s.goods_id
+        LEFT JOIN order_goods s ON g.goods_id = s.goods_id AND s.pay_status in (2,3)
         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>
+        ORDER BY s.create_time DESC
     </select>
 
     <select id="listExamSon" parameterType="com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo"  resultMap="ExamSonStudyRecordVoResult">