import { DataSource } from 'typeorm';

export function handler(dataSource: DataSource) {
  return dataSource.query(`
    select count(1) value, r.name
    from user u
    left join role r 
    on u.role_id=r.id
    where u.del_flag=0
    group by u.role_id
  `);
}
