You've already forked FrameTour-BE
- 在SourceMapper中新增sourceExists方法,用于校验source是否存在 - 新增filterValidSourceRelations方法,过滤无效的source引用 - 在FaceServiceImpl中增强关联关系创建逻辑,防止重复和无效数据 - 在VideoPieceGetter任务中增加source存在性校验,避免创建孤立关联- 添加详细的日志记录,便于追踪关联关系创建过程 -优化XML映射文件,支持新的校验和过滤查询逻辑
102 lines
3.0 KiB
Java
102 lines
3.0 KiB
Java
package com.ycwl.basic.mapper;
|
|
|
|
import com.ycwl.basic.model.pc.source.entity.MemberSourceEntity;
|
|
import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
|
import com.ycwl.basic.model.pc.source.entity.SourceWatermarkEntity;
|
|
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
|
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @Author:longbinbin
|
|
* @Date:2024/12/2 11:21
|
|
* 视频源
|
|
*/
|
|
@Mapper
|
|
public interface SourceMapper {
|
|
List<SourceRespVO> list(SourceReqQuery sourceReqQuery);
|
|
|
|
SourceRespVO getById(Long id);
|
|
SourceRespVO userGetById(Long id, Long userId);
|
|
|
|
List<SourceEntity> listBySampleIds(List<Long> sourceIds);
|
|
|
|
int add(SourceEntity source);
|
|
|
|
int deleteById(Long id);
|
|
|
|
int update(SourceEntity source);
|
|
|
|
/**
|
|
* @param sourceReqQuery
|
|
* @return
|
|
*/
|
|
List<SourceRespVO> listGroupByType(SourceReqQuery sourceReqQuery);
|
|
|
|
/**
|
|
* 用户素材数量
|
|
*
|
|
* @param userId
|
|
* @return
|
|
*/
|
|
int countByMemberId(String userId);
|
|
|
|
List<SourceEntity> listVideoBySampleIds(List<Long> sampleId);
|
|
|
|
SourceEntity findBySampleId(Long faceSampleId);
|
|
|
|
int addRelation(MemberSourceEntity source);
|
|
|
|
List<SourceRespVO> listUser(SourceReqQuery sourceReqQuery);
|
|
Integer countUser(SourceReqQuery sourceReqQuery);
|
|
SourceRespVO listUserOne(Long userId, Long sourceId);
|
|
|
|
int addRelations(List<MemberSourceEntity> list);
|
|
|
|
List<MemberSourceEntity> filterExistingRelations(List<MemberSourceEntity> list);
|
|
|
|
boolean sourceExists(Long sourceId);
|
|
|
|
List<MemberSourceEntity> filterValidSourceRelations(List<MemberSourceEntity> list);
|
|
|
|
int updateRelation(MemberSourceEntity memberSourceEntity);
|
|
int freeRelations(List<Long> ids, int type);
|
|
|
|
List<SourceRespVO> queryByRelation(SourceReqQuery sourceReqQuery);
|
|
|
|
SourceEntity querySameVideo(Long faceSampleId, Long deviceId);
|
|
|
|
int hasRelationTo(Long memberId, Long sourceId, int type);
|
|
|
|
List<SourceEntity> listVideoByScenicFaceRelation(Long scenicId, Long faceId);
|
|
List<SourceEntity> listVideoByFaceRelation(Long memberId, Long faceId);
|
|
|
|
List<SourceEntity> listImageByFaceRelation(Long memberId, Long faceId);
|
|
List<MemberSourceEntity> listByFaceRelation(Long faceId, Integer type);
|
|
|
|
SourceEntity getEntity(Long id);
|
|
|
|
int deleteNotRelateSource(int type, Date endDate);
|
|
|
|
int deleteNotBuyRelations(Long scenicId, Date endDate);
|
|
|
|
int deleteNotBuyFaceRelation(Long userId, Long faceId);
|
|
List<SourceWatermarkEntity> listSourceWatermark(List<Long> sourceIds, Long faceId, String watermarkType);
|
|
|
|
void addSourceWatermark(Long sourceId, Long faceId, String type, String url);
|
|
|
|
int deleteUselessSource();
|
|
|
|
int updateMemberIdByFaceId(Long faceId, Long memberId);
|
|
|
|
/**
|
|
* 根据faceId查询type=2的source列表
|
|
* @param faceId 人脸ID
|
|
* @return type=2的source列表
|
|
*/
|
|
List<SourceEntity> listImageSourcesByFaceId(Long faceId);
|
|
}
|