| | |
| | | when t1.device_id is null then 1 |
| | | else 2 |
| | | end as type, |
| | | t1.create_time,t1.reformed,t1.responsible_person responsiblePerson |
| | | t1.create_time,t1.reformed,t1.responsible_person responsiblePerson, |
| | | case |
| | | when t5.id is null then 3 |
| | | else t5.state |
| | | end as state |
| | | from record t1 |
| | | left join problem t2 on t1.problem_id = t2.id |
| | | left join task t3 on t1.check_task_id = t3.id |
| | | left join plan t4 on t3.plan_id = t4.id |
| | | left join error_review t5 on t1.error_review_id = t5.id |
| | | where t1.deleted = 0 and t1.level is not null |
| | | and t1.check_task_id in |
| | | <foreach item="item" index="index" collection="taskIds" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | <if test="query.reformed != null"> |
| | | and t1.reformed = #{query.reformed} |
| | | </if> |
| | | |
| | | <if test="query.type == null"> |
| | | and t1.level = 0 |
| | | </if> |
| | |
| | | </if> |
| | | |
| | | ) as o where 1=1 |
| | | <if test="query.reformed != null"> |
| | | and o.state = #{query.reformed} |
| | | </if> |
| | | <if test="query.type != null"> |
| | | and o.type = #{query.type} |
| | | </if> |