select id,serial_group_id,state from ap_model order by serial_group_id asc, ( case when state=1 then 1 when state=2 then 2 when state=-1 then 3 when state=3 then 4 when state=0 then 5 else 99 end )
2022-08-18 12:42:51
select id,serial_group_id,state from ap_model order by serial_group_id asc, ( case when state=1 then 1 when state=2 then 2 when state=-1 then 3 when state=3 then 4 when state=0 then 5 else 99 end )