package com.fdkanfang.service;

import com.github.pagehelper.PageInfo;
import tk.mybatis.mapper.entity.Condition;

import java.io.Serializable;
import java.util.List;

public interface IBaseMapperService<T, ID extends Serializable> {

    public abstract T findById(ID id);

    public abstract T findOne(T entity);

    public abstract List<T> findByIds(String ids);

    public abstract long count();

    public abstract boolean exists(ID id);

    public abstract int save(T entity);

    public abstract int saveAll(List<T> entitys);

    public abstract int update(T entity);

    public abstract int updateAll(T entity);

    public abstract int deleteById(ID id);

    public abstract int deleteByIds(String ids);

    public abstract int delete(T entity);

    public abstract List<T> findAll(Condition condition, String orderBy);

    public abstract List<T> findAll(Condition condition);

    public abstract List<T> findAll();

    public abstract PageInfo<T> findAll(int pageNum, int pageSize);

    public abstract PageInfo<T> findAll(int pageNum, int pageSize, String orderBy);

    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize);

    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy);

}
