select ah.cost_no as costNo ,ah.cost_status as costStatus ,ah.is_passed as isPassed ,ah.approval_time as approvalTime ,c.type_name as typeName,u.username from approval_history ah
select ah.id, ah.cost_no as costNo ,c.cost_form as costFrom,c.is_lend as isLend, s2.statusvalue as costStatus ,ah.is_passed as isPassed ,ah.approval_time as approvalTime ,c.type_name as typeName,u.username
from approval_history ah
left join cost c on c.cost_no = ah.cost_no
left join cost c on c.cost_no = ah.cost_no
left join `user` u on u.userid = ah.approval_user_id
left join `user` u on u.userid = ah.approval_user_id
left join status s2 on s2.statusname = 'cost_status' and s2.statuskey = ah.cost_status
where ah.approval_time between #{startTime} and #{endTime}
where ah.approval_time between #{startTime} and #{endTime}