select @rn:=@rn+1 as rn, a. * from
(select b.cont_id, cust_name, cont_mgr, item_name, agree_info, take_steps, cycle_id, deadline_date, evidence, provider, duty_dept, duty_user
from s0_cont_item_exec a, s0_cont_item b, s0_dic_cont_item c, s0_cont d, s0_cust e
where deadline_date between '${start_date}' and '${end_date}'
and b.cont_id like '%${cont_id}%'
and a.item_id=b.item_id and b.item_code=c.item_code
and b.cont_id1=d.cont_id and d.cust_id=e.cust_id
order by b.cont_id, b.oper_time, a.item_id ) a,
(select @rn:=0) t2
;
(select b.cont_id, cust_name, cont_mgr, item_name, agree_info, take_steps, cycle_id, deadline_date, evidence, provider, duty_dept, duty_user
from s0_cont_item_exec a, s0_cont_item b, s0_dic_cont_item c, s0_cont d, s0_cust e
where deadline_date between '${start_date}' and '${end_date}'
and b.cont_id like '%${cont_id}%'
and a.item_id=b.item_id and b.item_code=c.item_code
and b.cont_id1=d.cont_id and d.cust_id=e.cust_id
order by b.cont_id, b.oper_time, a.item_id ) a,
(select @rn:=0) t2
;