|
|
@@ -95,6 +95,10 @@
|
|
|
<result property="gradeId" column="grade_id"/>
|
|
|
<result property="examNum" column="exam_num"/>
|
|
|
<result property="recordNum" column="record_num"/>
|
|
|
+ <result property="applyStatus" column="apply_status"/>
|
|
|
+ <result property="beforeStatus" column="before_status"/>
|
|
|
+ <result property="applyName" column="apply_name"/>
|
|
|
+ <result property="beforeName" column="before_name"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo" id="GoodsPeriodStatusVo">
|
|
|
@@ -335,7 +339,11 @@
|
|
|
ups.`status` =1 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 2) as exam_pass,
|
|
|
(SELECT
|
|
|
COUNT(up.id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
|
|
|
- =0 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 2) as exam_cheat
|
|
|
+ =0 and ups.period_status = 1 and up.goods_id=g.goods_id and up.user_id = cgu.user_id and up.type = 2) as exam_cheat,
|
|
|
+ (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
|
|
|
+ (case WHEN (SELECT COUNT(1) FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) >0 then 1 ELSE 0 end) as before_status,
|
|
|
+ (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) as apply_name,
|
|
|
+ (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 = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name
|
|
|
FROM
|
|
|
class_grade_user cgu
|
|
|
LEFT JOIN class_grade_goods cgg ON cgu.grade_id = cgg.grade_id
|