he2802 3 жил өмнө
parent
commit
eddb96344b

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserSubscribeQueryBo.java

@@ -104,4 +104,13 @@ public class UserSubscribeQueryBo extends BaseEntity {
 	/** 查找key */
 	@ApiModelProperty("searchKey")
 	private String searchKey;
+
+	@ApiModelProperty("1可取消")
+	private Integer canCancel;
+
+	@ApiModelProperty("1前培标记")
+	private Integer canBefore;
+
+	@ApiModelProperty("1考试登记")
+	private Integer canExam;
 }

+ 15 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserSubscribeMapper.xml

@@ -83,6 +83,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
         WHERE
             1 =1
+        <if test="canCancel != null and canCancel == 1 ">
+            and us.subscribe_status = 1
+            and UNIX_TIMESTAMP(CONCAT(FROM_UNIXTIME(us.apply_site_exam_time, '%Y-%m-%d '),us.apply_site_start_time)) > unix_timestamp(now())+86400
+            and us.exam_status = 0
+            and us.before_status = 0
+        </if>
+        <if test="canBefore != null and canBefore == 1 ">
+            and us.subscribe_status = 1
+            and us.before_id >0
+            and us.exam_status = 0
+            and (us.before_status = 1 or (SELECT count(*) from user_exam_goods ueg where ueg.user_id = us.user_id and ueg.goods_id = us.goods_id and ueg.do_number - ueg.expend_before>0)>0)
+        </if>
+        <if test="canExam != null and canExam == 1 ">
+            and us.subscribe_status = 1
+        </if>
         <if test="searchKey != null and searchKey != '' ">
             and (u.realname like concat('%', #{searchKey}, '%') or u.id_card like concat('%', #{searchKey}, '%'))
         </if>