| | |
| | | <if test="testTypeId != null">and t.test_type_id = #{testTypeId}</if> |
| | | <if test="batteryNo != null and batteryNo != ''">and exists (select 1 from t_test_battery fb where fb.test_id = t.test_id and fb.battery_no = #{batteryNo} and fb.del_flag = 0)</if> |
| | | <if test="testStatus != null and testStatus != ''"> |
| | | and case |
| | | when #{testStatus} = 'RUNNING_ABNORMAL' then t.test_status = 'RUNNING' |
| | | and ( |
| | | (#{testStatus} = 'RUNNING_ABNORMAL' and t.test_status = 'RUNNING' |
| | | and exists (select 1 from t_test_collector_exception_interval exception_fact |
| | | where exception_fact.test_id = t.test_id and exception_fact.interval_status = 'OPEN') |
| | | when #{testStatus} = 'RUNNING' then t.test_status = 'RUNNING' |
| | | where exception_fact.test_id = t.test_id and exception_fact.interval_status = 'OPEN')) |
| | | or (#{testStatus} = 'RUNNING' and t.test_status = 'RUNNING' |
| | | and not exists (select 1 from t_test_collector_exception_interval exception_fact |
| | | where exception_fact.test_id = t.test_id and exception_fact.interval_status = 'OPEN') |
| | | else t.test_status = #{testStatus} |
| | | end |
| | | where exception_fact.test_id = t.test_id and exception_fact.interval_status = 'OPEN')) |
| | | or (#{testStatus} not in ('RUNNING', 'RUNNING_ABNORMAL') and t.test_status = #{testStatus}) |
| | | ) |
| | | </if> |
| | | <if test="receptionStatus != null and receptionStatus != ''">and t.reception_status = #{receptionStatus}</if> |
| | | <if test="beginCreateTime != null">and t.create_time >= #{beginCreateTime}</if> |