update DepartmentAppTemplate set orderNum = (select count(*) from DepartmentAppTemplate po where po.id <= DepartmentAppTemplate.id);