|
|
|
|
@ -125,10 +125,9 @@ namespace CncRepository.Impl.Dashboard
|
|
|
|
|
{
|
|
|
|
|
var sql = $@"
|
|
|
|
|
SELECT w.name AS WorkerName,
|
|
|
|
|
COUNT(DISTINCT wm.machine_id) AS MachineCount,
|
|
|
|
|
COUNT(DISTINCT dp.machine_id) AS MachineCount,
|
|
|
|
|
COALESCE(SUM(dp.end_total_count - dp.base_total_count), 0) AS TotalQuantity
|
|
|
|
|
FROM cnc_worker w
|
|
|
|
|
LEFT JOIN cnc_worker_machine wm ON wm.worker_id = w.id
|
|
|
|
|
LEFT JOIN cnc_daily_production dp ON dp.worker_id = w.id
|
|
|
|
|
AND dp.production_date BETWEEN @Start AND @End
|
|
|
|
|
AND dp.end_total_count > dp.base_total_count
|
|
|
|
|
|