diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenRecordDao.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenRecordDao.java index 250d957..9e5a294 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenRecordDao.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/dao/TenRecordDao.java @@ -27,6 +27,8 @@ public interface TenRecordDao { List findAll(@Param("cellIds") List cellIds, @Param("params") Map params); + int findAllSize(@Param("cellIds") List cellIds, @Param("params") Map params); + int findHourAll(@Param("cellIds") List cellIds, @Param("params") Map params); IPage findPageBlackRecord(Page page, @Param("cellIds") List cellIds, @Param("params") Map params); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java index 500e0a7..a8965fc 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java @@ -291,7 +291,7 @@ public class TenRecordServiceImpl implements TenRecordService { if (cellIds.size() == 0) { return 0; } - int c = tenRecordDao.findAll(cellIds, params).size(); + int c = tenRecordDao.findAllSize(cellIds, params); return c; } diff --git a/shapelight-admin/src/main/resources/mapper/ten/TenRecordDao.xml b/shapelight-admin/src/main/resources/mapper/ten/TenRecordDao.xml index bf0e5d0..c117ee4 100644 --- a/shapelight-admin/src/main/resources/mapper/ten/TenRecordDao.xml +++ b/shapelight-admin/src/main/resources/mapper/ten/TenRecordDao.xml @@ -336,6 +336,20 @@ + + @@ -486,15 +523,27 @@ and tr.record_face is not null and TO_DAYS(tr.record_time) = TO_DAYS(NOW()) and tp.xa_sync_card = 1 - --> - select tr.* from (select * from ten_record_${tenantId} + + select tr.* from (select * from ten_record_${tenantId} where cell_id = #{cellId} and xa_sync = 0 and TO_DAYS(record_time) = TO_DAYS(NOW()) - and record_face is not null) as tr left join ten_person tp - on tr.person_id = tp.person_id - and tp.xa_sync_card = 1 + and record_face is not null) as tr left join ten_person tp + on tr.person_id = tp.person_id + and tp.xa_sync_card = 1--> + + + select rr.* from (select record_id from ten_record_${tenantId} + where cell_id = #{cellId} + and xa_sync = 0 + and TO_DAYS(record_time) = TO_DAYS(NOW()) + and record_face is not null) as tr + left join ten_record_${tenantId} rr + on tr.record_id = rr.record_id + left join ten_person tp + on rr.person_id = tp.person_id + and tp.xa_sync_card = 1