| 123456789 |
- SELECT
- plan.*
- ,(select times.servicetimestart from t_b_maintain_plan_times times where times.maintainplanid=plan.id order by times.servicetimestart limit 1) as firstTimeStart
- FROM
- t_b_maintain_plan plan
- where
- plan.bpm_status='3'
- and plan.contract_id is null
- and exists(select 1 from t_b_maintain_plan_times times where times.maintainplanid=plan.id and times.servicetimestart<=:findDate)
|