Commit 81befc5a by 梅存智

增加条件

parent 93e32963
......@@ -153,11 +153,11 @@
</if>
<if test="state == null">
select a.name as name ,a.start_time as startTime,a.end_time as endTime,a.id as id,
select a.name as name ,a.start_time as startTime,a.end_time as endTime,a.id as id,
a.training_project_id as trainingProjectId,a.description as description,
(SELECT MAX(score) FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.state=2) AS score,
(SELECT MAX(score) FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.account_id=#{accountId} AND b.state=2) AS score,
CASE WHEN NOW() > a.end_time THEN 7 ELSE
(SELECT CASE WHEN IFNULL(MAX(score),-1)=-1 THEN 0 ELSE CASE WHEN MAX(score)>=a.qualified_score THEN 6 ELSE 5 END END AS score FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.state=2)
(SELECT CASE WHEN IFNULL(MAX(score),-1)=-1 THEN 0 ELSE CASE WHEN MAX(score)>=a.qualified_score THEN 6 ELSE 5 END END AS score FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.account_id=#{accountId} AND b.state=2)
END AS handle,a.image
from exam a where 1=1 and a.site_id = #{siteId}
<if test="ids!=null">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment