日期:2014-05-16 浏览次数:20696 次
select department.DEPT_NAME as '{AE00D006-4502-4357-8877-F7EE1BE7A612}',
department.DEPT_ID as '{3EF7D5ED-827C-48C7-BCA4-08078BDAB400}',
(select count(*) from (hr_staff_info as T3D25E571FE8641DB9826970A37FA63CC
cross join user as T217284E3419F4B18ADE93B5502351DD3 on T217284E3419F4B18ADE93B5502351DD3.USER_ID = T3D25E571FE8641DB9826970A37FA63CC.USER_ID)
cross join crscell.crs_tabledata1152c13969208821678 as T916C81F30DE24573AF2CEFD39340D687
where ((T916C81F30DE24573AF2CEFD39340D687.col23005 is null or T916C81F30DE24573AF2CEFD39340D687.col23005 = '0000-00-00' or T916C81F30DE24573AF2CEFD39340D687.col23005 = '0000-00-00 00:00:00' or T916C81F30DE24573AF2CEFD39340D687.col23005 = '00:00:00') or (year(if(T916C81F30DE24573AF2CEFD39340D687.col23005 is null, '', T916C81F30DE24573AF2CEFD39340D687.col23005)) - year(if(T3D25E571FE8641DB9826970A37FA63CC.DATES_EMPLOYED is null, '', T3D25E571FE8641DB9826970A37FA63CC.DATES_EMPLOYED)))*12 + (month(if(T916C81F30DE24573AF2CEFD39340D687.col23005 is null, '', T916C81F30DE24573AF2CEFD39340D687.col23005)) - month(if(T3D25E571FE8641DB9826970A37FA63CC.DATES_EMPLOYED is null, '', T3D25E571FE8641DB9826970A37FA63CC.DATES_EMPLOYED))) >= 0) and (T217284E3419F4B18ADE93B5502351DD3.DEPT_ID = department.DEPT_ID) limit 0, 1) as '{84FDFCE2-ED40-4213-BD3E-17A409FF4C92}'
from department cross join crscell.crs_tabledata1152c13969208821678 where (crscell.crs_tabledata1152c13969208821678.col23005 is not null and crscell.crs_tabledata1152c13969208821678.col23005 <> '0000-00-00' and crscell.crs_tabledata1152c13969208821678.col23005 <> '0000-00-00 00:00:00' and crscell.crs_tabledata1152c13969208821678.col23005 <> '00:00:00')
order by department.DEPT_ID asc