|
|
@ -31,7 +31,7 @@ public interface SecurityDoorRepository extends JpaRepository<SecurityDoor, Stri |
|
|
|
@Query(nativeQuery = true, |
|
|
|
countQuery = "select count(1) " + |
|
|
|
"from security_door sdr inner join device_info di on sdr.device_id = di.id " + |
|
|
|
"inner join storeroom room on sdr.storeroom_id = room.id left join borrower br on sdr.user_id = br.id " + |
|
|
|
"inner join storeroom room on di.storeroom_id = room.id left join borrower br on sdr.user_id = br.id " + |
|
|
|
"where if(?1 is null,1=1,room.name like ?1) " + |
|
|
|
"and if(?2 is null,1=1,di.device_name like ?2) " + |
|
|
|
"and if(?3 is null,1=1,sdr.create_time >= ?3) " + |
|
|
@ -39,7 +39,7 @@ public interface SecurityDoorRepository extends JpaRepository<SecurityDoor, Stri |
|
|
|
value = "select sdr.id as id,sdr.alarm_level as alarmLevel,room.name as roomName,di.device_name as deviceName,sdr.maintitle as maintitle," + |
|
|
|
"sdr.archive_no as archiveNo,sdr.alarm_msg as alarmMsg,sdr.alarm_event as alarmEvent,br.borrower_name as borrowerName,sdr.create_time as createTime " + |
|
|
|
"from security_door sdr inner join device_info di on sdr.device_id = di.id " + |
|
|
|
"inner join storeroom room on sdr.storeroom_id = room.id left join borrower br on sdr.user_id = br.id " + |
|
|
|
"inner join storeroom room on di.storeroom_id = room.id left join borrower br on sdr.user_id = br.id " + |
|
|
|
"where if(?1 is null,1=1,room.name like ?1) " + |
|
|
|
"and if(?2 is null,1=1,di.device_name like ?2) " + |
|
|
|
"and if(?3 is null,1=1,sdr.create_time >= ?3) " + |
|
|
|