diff --git a/src/main/java/com/ycwl/basic/mapper/SourceMapper.java b/src/main/java/com/ycwl/basic/mapper/SourceMapper.java index 55fe26b7..b2e248dd 100644 --- a/src/main/java/com/ycwl/basic/mapper/SourceMapper.java +++ b/src/main/java/com/ycwl/basic/mapper/SourceMapper.java @@ -131,4 +131,14 @@ public interface SourceMapper { * @return 设备ID列表 */ List getDeviceIdsByFaceId(Long faceId); + + /** + * 根据faceId和设备ID获取source + * @param faceId 人脸ID + * @param deviceId 设备ID + * @param type 素材类型(1-视频,2-图片) + * @param sortStrategy 排序策略 + * @return source实体 + */ + SourceEntity getSourceByFaceAndDeviceId(Long faceId, Long deviceId, Integer type, String sortStrategy); } diff --git a/src/main/resources/mapper/SourceMapper.xml b/src/main/resources/mapper/SourceMapper.xml index f91f41dc..e2278194 100644 --- a/src/main/resources/mapper/SourceMapper.xml +++ b/src/main/resources/mapper/SourceMapper.xml @@ -410,4 +410,37 @@ WHERE ms.face_id = #{faceId} ORDER BY s.device_id ASC + +