package net.northking.cctp.common.db;


import net.northking.cctp.common.http.QueryByPage;

import java.util.List;

/**
 * @Title:
 * @Description:
 * @Company: 京北方信息技术股份有限公司
 * @Author: 谢秀松
 * @CreateDate: 2018/3/19
 * @UpdateUser:
 * @Version: 1.0
 */
public interface BasicService<T>
{
  T createEntity();

  BasicDao<T> getDao();

  int deleteByExample(T record);

  int deleteByPrimaryKey(Object id);

  int deleteByPrimaryKeys(List<Object> ids);

  int insert(T record);

  int insertByBatch(List<T> list);

  T findByPrimaryKey(Object id);

  List<T> findByPrimaryKeys(List<Object> ids);

  int updateByPrimaryKey(T record);

  List<T> findAll();

  List<T> findAll(OrderBy orderBy);

  Pagination<T> query(T record, OrderBy orderBy, int pageNo, int pageSize);

  Pagination<T> findAll(int pageNo, int pageSize);

  Pagination<T> findAll(OrderBy orderBy, int pageNo, int pageSize);

  List<T> query(T record);

  Pagination<T> query(T record, int pageNo, int pageSize);

  List<T> query(T record, OrderBy orderBy);

  long count(T record);

  long count();

  <E> Pagination<E> pagingQuery(QueryByPage<?> queryByPage);

  <E> Pagination<E> pagingQuery(QueryByPage<?> queryByPage, PagingQueryDao pagingQueryDao);
}
