package com.platform.dao;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 基础Dao(还需在XML文件里，有对应的SQL语句)
 *
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2016年9月18日 上午9:31:36
 */
public interface BaseDao<T> {

    int save(T t);

    void save(Map<String, Object> map);

    void saveBatch(List<T> list);

    int update(T t);

    int update(Map<String, Object> map);

    int delete(Object id);

    int delete(Map<String, Object> map);

    int deleteBatch(Object[] id);

    T queryObject(Object id);

    List<T> queryList(Map<String, Object> map);

    List<T> queryListCustom(@Param(value = "brandId") Object brandId ,
                            @Param(value = "isDelete") Object isDelete,
                            @Param(value = "sidx") Object sidx,
                            @Param(value = "order") Object order,
                            @Param(value = "offset") Object offset,
                            @Param(value = "limit") Object limit);

    List<T> queryList(Object id);

    Integer queryTotal(Map<String, Object> map);

    Integer queryTotalCustom(@Param(value = "brandId") Object brandId ,
                             @Param(value = "isDelete") Object isDelete,
                             @Param(value = "sidx") Object sidx,
                             @Param(value = "order") Object order,
                             @Param(value = "offset") Object offset,
                             @Param(value = "limit") Object limit);

    int queryTotal();
}
