select * from safe_xiajingzongbiao inner join safe_Department on safe_xiajingzongbiao.kuangbie=safe_Department.DepartmentName where month(shijian)=month(@shijian) and year(shijian)=year(@shijian) order by safe_Department.ID , safe_xiajingzongbiao.shijian desc