|
@@ -0,0 +1,142 @@
|
|
|
|
+package com.taais.biz.service.impl;
|
|
|
|
+
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import com.mybatisflex.core.paginate.Page;
|
|
|
|
+import com.mybatisflex.core.query.QueryWrapper;
|
|
|
|
+import com.taais.common.core.utils.MapstructUtils;
|
|
|
|
+import com.taais.common.orm.core.page.PageQuery;
|
|
|
|
+import com.taais.common.core.core.page.PageResult;
|
|
|
|
+import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
|
+import jakarta.annotation.Resource;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import com.taais.biz.mapper.VideoStableMapper;
|
|
|
|
+import com.taais.biz.domain.VideoStable;
|
|
|
|
+import com.taais.biz.domain.bo.VideoStableBo;
|
|
|
|
+import com.taais.biz.domain.vo.VideoStableVo;
|
|
|
|
+import com.taais.biz.service.IVideoStableService;
|
|
|
|
+
|
|
|
|
+import static com.taais.biz.domain.table.VideoStableTableDef.VIDEO_STABLE;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 视频去抖动Service业务层处理
|
|
|
|
+ *
|
|
|
|
+ * @author 0
|
|
|
|
+ * 2024-08-30
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, VideoStable> implements IVideoStableService {
|
|
|
|
+ @Resource
|
|
|
|
+ private VideoStableMapper videoStableMapper;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public QueryWrapper query() {
|
|
|
|
+ return super.query().from(VIDEO_STABLE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private QueryWrapper buildQueryWrapper(VideoStableBo videoStableBo) {
|
|
|
|
+ QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.NAME.like
|
|
|
|
+ (videoStableBo.getName()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.STATUS.eq
|
|
|
|
+ (videoStableBo.getStatus()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.INPUT_PATH.eq
|
|
|
|
+ (videoStableBo.getInputPath()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.OUT_PATH.eq
|
|
|
|
+ (videoStableBo.getOutPath()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.START_TIME.eq
|
|
|
|
+ (videoStableBo.getStartTime()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.END_TIME.eq
|
|
|
|
+ (videoStableBo.getEndTime()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.COST_SECOND.eq
|
|
|
|
+ (videoStableBo.getCostSecond()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.LOG.eq
|
|
|
|
+ (videoStableBo.getLog()));
|
|
|
|
+ queryWrapper.and(VIDEO_STABLE.REMARKS.eq
|
|
|
|
+ (videoStableBo.getRemarks()));
|
|
|
|
+
|
|
|
|
+ return queryWrapper;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询视频去抖动
|
|
|
|
+ *
|
|
|
|
+ * @param id 视频去抖动主键
|
|
|
|
+ * @return 视频去抖动
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public VideoStableVo selectById(Long id) {
|
|
|
|
+ return this.getOneAs(query().where(VIDEO_STABLE.ID.eq(id)), VideoStableVo.class);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询视频去抖动列表
|
|
|
|
+ *
|
|
|
|
+ * @param videoStableBo 视频去抖动Bo
|
|
|
|
+ * @return 视频去抖动集合
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<VideoStableVo> selectList(VideoStableBo videoStableBo) {
|
|
|
|
+ QueryWrapper queryWrapper = buildQueryWrapper(videoStableBo);
|
|
|
|
+ return this.listAs(queryWrapper, VideoStableVo.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查询视频去抖动列表
|
|
|
|
+ *
|
|
|
|
+ * @param videoStableBo 视频去抖动Bo
|
|
|
|
+ * @return 分页视频去抖动集合
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public PageResult<VideoStableVo> selectPage(VideoStableBo videoStableBo) {
|
|
|
|
+ QueryWrapper queryWrapper = buildQueryWrapper(videoStableBo);
|
|
|
|
+ Page<VideoStableVo> page = this.pageAs(PageQuery.build(), queryWrapper, VideoStableVo.class);
|
|
|
|
+ return PageResult.build(page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增视频去抖动
|
|
|
|
+ *
|
|
|
|
+ * @param videoStableBo 视频去抖动Bo
|
|
|
|
+ * @return 结果:true 操作成功,false 操作失败
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public boolean insert(VideoStableBo videoStableBo) {
|
|
|
|
+ VideoStable videoStable =MapstructUtils.convert(videoStableBo, VideoStable. class);
|
|
|
|
+
|
|
|
|
+ return this.save(videoStable);//使用全局配置的雪花算法主键生成器生成ID值
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改视频去抖动
|
|
|
|
+ *
|
|
|
|
+ * @param videoStableBo 视频去抖动Bo
|
|
|
|
+ * @return 结果:true 更新成功,false 更新失败
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public boolean update(VideoStableBo videoStableBo) {
|
|
|
|
+ VideoStable videoStable =MapstructUtils.convert(videoStableBo, VideoStable. class);
|
|
|
|
+ if (ObjectUtil.isNotNull(videoStable) && ObjectUtil.isNotNull(videoStable.getId())){
|
|
|
|
+ boolean updated = this.updateById(videoStable);
|
|
|
|
+ return updated;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 批量删除视频去抖动
|
|
|
|
+ *
|
|
|
|
+ * @param ids 需要删除的视频去抖动主键集合
|
|
|
|
+ * @return 结果:true 删除成功,false 删除失败
|
|
|
|
+ */
|
|
|
|
+ @Transactional
|
|
|
|
+ @Override
|
|
|
|
+ public boolean deleteByIds(Long[] ids) {
|
|
|
|
+ return this.removeByIds(Arrays.asList(ids));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|