|
|
|
@ -1121,7 +1121,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
|
|
|
|
|
// Use a single query to fetch counts grouped by work center code
|
|
|
|
|
List<Map> productionCounts = entityManager.createQuery(
|
|
|
|
|
"SELECT new map(pr.workCenterCode as workCenterCode, COUNT(DISTINCT(pr.productSn)) as totalCount) " +
|
|
|
|
|
"SELECT new map(pr.workCenterCode as workCenterCode, COUNT(DISTINCT pr.productSn) as totalCount) " +
|
|
|
|
|
"FROM " + MesProductionRecord.class.getName() + " pr " +
|
|
|
|
|
"WHERE pr.organizeCode = :organizeCode AND pr.isDeleted = :isDeleted AND pr.isValid = :isValid " +
|
|
|
|
|
"AND pr.reportType = :reportType AND pr.createDatetime BETWEEN :startDateTime AND :endDateTime " +
|
|
|
|
|