|
|
|
@ -1293,11 +1293,11 @@ 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) " +
|
|
|
|
|
"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 " +
|
|
|
|
|
"GROUP BY pr.workCenterCode", Map.class)
|
|
|
|
|
"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 " +
|
|
|
|
|
"GROUP BY pr.workCenterCode", Map.class)
|
|
|
|
|
.setParameter("organizeCode", cfg.getOrganizeCode())
|
|
|
|
|
.setParameter("isValid", CommonEnumUtil.VALID)
|
|
|
|
|
.setParameter("isDeleted", CommonEnumUtil.FALSE)
|
|
|
|
|