Код: Выделить всё
@Query(value = "SELECT new com.v3biomed.api.dto.AuditListDTO("
+ "CASE WHEN al.entityName = 'PRACTICE' THEN pt.practiceName"
+ " WHEN al.entityName = 'Practice Provider' THEN "
+ " CASE WHEN pp.practice.practiceName IS NULL THEN CONCAT('Missing Practice Provider (ID: ', al.entityId, ')')"
+ " ELSE pp.practice.practiceName END "
....
+ "FROM AuditLog al "
+ "LEFT JOIN Practice pt ON pt.practiceId = al.entityId "
+ "LEFT JOIN PracticeProvider pp ON pp.providerId = al.entityId "
+ "WHERE ((:entityNames IS NULL OR al.entityName = :entityNames) "
+ " OR (:entityNames = 'Practice' AND al.entityName IN ('Practice', 'Product Product', 'Practice Location', 'Practice Provider', 'Practice Executive' , 'PracticeBiller' ))) "
.....
)
Код: Выделить всё
+ " WHEN al.entityName = 'Practice Provider' THEN "
+ " CASE WHEN pp.practice.practiceName IS NULL THEN CONCAT('Missing Practice Provider (ID: ', al.entityId, ')')"
+ " ELSE pp.practice.practiceName END "
Код: Выделить всё
326097 Practice Provider 189 New Practice Provider is created. CREATE Successful 0f68467fdc28d94c50805729a501fac2 1 192.168.1.103 2024-11-11 18:42:23 2024-11-11 18:42:23
325172 Practice Provider 188 New Practice Provider is created. CREATE Successful 1b8ee0f029f802408b218c597d3b9aa5 1 192.168.1.103 2024-11-11 15:22:38 2024-11-11 15:22:38
311487 Practice Provider 186 New Practice Provider is created. CREATE Successful 1d1c76f87a6e49c9c6e6b65fd50d9105 1 103.156.142.234 2024-10-14 17:04:45 2024-10-14 17:04:45
Код: Выделить всё
189 156 Tulipp P PNPI123412 PTAN1234 2024-11-11 18:42:22
187 154 Malik S 2024-10-14 17:04:44
186 154 Uday M 2024-10-14 17:04:44
185 153 Shalin P 12348962 84621459 MD 2024-10-11 11:16:02
Подробнее здесь: https://stackoverflow.com/questions/792 ... -jpa-query
Мобильная версия