package com.hx.common.service;
|
import com.hx.mybatisTool.SqlSentence;
|
|
import java.io.Serializable;
|
import java.util.List;
|
import java.util.Map;
|
|
|
/**
|
* dao通用接口
|
* @author ChenJiaHe
|
* @Date 2020-10-14
|
*/
|
public interface CommonService {
|
|
/**新增,返回主键
|
* @param mapperClass mapper类
|
* @param entity 实体类
|
* @return 条数
|
*/
|
<T extends Serializable> int insert(Class<?> mapperClass, T entity);
|
|
/**查询条数
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return 返回条数
|
*/
|
<T extends Serializable> int selectCount(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**查询列表,返回实体类的List
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return 返回list
|
*/
|
<T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**查询列表,返回Map的List
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return Map的List
|
*/
|
<T extends Serializable> List<Map<String,Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**查询,返回单个实体
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return 返回实体类
|
*/
|
<T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**查询,返回单个map
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return 返回实体类
|
*/
|
<T extends Serializable> Map<String,Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**查询,返回实体类没有大数据的
|
* @param mapperClass mapper类
|
* @param object 数据标识key
|
* @return 返回实体类
|
*/
|
<T extends Serializable> T selectOneByKey(Class<?> mapperClass, Object object);
|
|
/**查询,返回实体类有大数据的
|
* @param mapperClass mapper类
|
* @param object 数据标识key
|
* @return 返回实体类
|
*/
|
<T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass, Object object);
|
|
/**更新,返回更新数量
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return 返回条数
|
*/
|
<T extends Serializable> int updateWhere(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**更新,返回更新数量
|
* @param mapperClass mapper类
|
* @param entity 实体类
|
* @return 返回条数
|
*/
|
<T extends Serializable> int updateAll(Class<?> mapperClass, T entity);
|
|
/**删除,返回删除数量
|
* @param mapperClass mapper类
|
* @param sqlSentence 查询参数类
|
* @return 返回条数
|
*/
|
<T extends Serializable> int deleteWhere(Class<?> mapperClass, SqlSentence sqlSentence);
|
|
/**删除,返回删除数量
|
* @param mapperClass mapper类
|
* @param object 数据标识key
|
* @return 返回条数
|
*/
|
<T extends Serializable> int deleteById(Class<?> mapperClass, Object object);
|
|
}
|