|
|
select a.gridName,a.count - IFNULL( b.countQj, 0 ) AS lgbz from ( select b.name as gridName , count(a.id) as count ,b.id from centerdata_t_forest_linleader a , centerdata_t_forest_grid_level b where a.lin_grid_id= b.id
|
|
|
group by b.name ) a left join (SELECT count(a.id) as countQj,a.lin_grid_id FROM `centerdata_t_forest_linleader` a ,centerdata_t_leave b where a.user_id =b.leave_user_id and b.leave_end_time>= curdate() group by a.user_id ,a.lin_grid_id) b on a.id= b.lin_grid_id
|