package com.ads.business.service.impl;

import com.ads.business.entity.DocHistory;
import com.ads.business.dao.DocHistoryDao;
import com.ads.business.service.DocHistoryService;
import com.ads.business.service.model.response.DocHistoryListResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hou
 * @since 2021-10-21
 */
@Service
public class DocHistoryServiceImpl extends ServiceImpl<DocHistoryDao, DocHistory> implements DocHistoryService {

    @Override
    public List<DocHistoryListResponse> getDocHistoryList(Long docId) {
        QueryWrapper<DocHistoryListResponse> wrapper = new QueryWrapper<>();
        wrapper.eq("hdh.doc_id",docId);
        wrapper.orderByDesc("hdh.create_time");
        return this.baseMapper.getDocHistoryList(wrapper);
    }
}
