package com.ads.business.dao;

import com.ads.business.entity.DocType;
import com.ads.business.service.model.response.DocTypeListResponse;
import com.ads.business.service.model.response.DropListResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author hou
 * @since 2021-10-21
 */
public interface DocTypeDao extends BaseMapper<DocType> {
    /**
     * 分页
     *
     * @param page    分页对象
     * @param wrapper 查询条件
     * @return Page<DocTypeListResponse>
     */
    Page<DocTypeListResponse> findPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper<DocTypeListResponse> wrapper);

    /**
     * 下拉列表
     *
     * @param type 类型  1启用分类 2所有分类
     * @return List<DropListResponse>
     */
    List<DropListResponse> getDropList(@Param("type") Integer type);

}
