FileDictServiceImpl.java 1.42 KB
package com.subsidy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.model.FileDictDO;
import com.subsidy.mapper.FileDictMapper;
import com.subsidy.model.VodDictDO;
import com.subsidy.service.FileDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.vod.GetContendVodsVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课件表 服务实现类
 * </p>
 *
 * @author DengMin
 * @since 2021-10-11
 */
@Service
public class FileDictServiceImpl extends ServiceImpl<FileDictMapper, FileDictDO> implements FileDictService {

    public List<FileDictDO> getContendFiles(FileDictDO fileDictDO) {
        return this.baseMapper.selectList(new QueryWrapper<FileDictDO>()
        .lambda()
        .eq(FileDictDO::getContentId,fileDictDO.getContentId())
        .like(FileDictDO::getFileName,fileDictDO.getFileName()));
    }

    public String deleteFile(FileDictDO fileDictDO) {
        this.baseMapper.deleteById(fileDictDO.getId());
        return ConstantUtils.DELETE_SUCCESS;
    }

    public String addFile(FileDictDO fileDictDO) {
        this.baseMapper.insert(fileDictDO);
        return ConstantUtils.ADD_SUCCESS;
    }

    public String updateFile(FileDictDO fileDictDO) {
        this.baseMapper.updateById(fileDictDO);
        return ConstantUtils.SET_SUCCESS;
    }

}