统一业务接口,便于不同的业务实现
包名:cn.ewsd.xxxx.service
命名方式:XxxxService.java
cn.ewsd.frame.service.impl.BaseService
实现cn.ewsd.frame.service.XxxxBaseService中的方法
方法:Listselect(T record); 说明:根据实体中的属性值进行查询,查询条件使用等号 方法:T selectByPrimaryKey(Object key); 说明:根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号 方法:List selectAll(); 说明:查询全部结果,select(null)方法能达到同样的效果 方法:T selectOne(T record); 说明:根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号 方法:int selectCount(T record); 说明:根据实体中的属性查询总数,查询条件使用等号
方法:int insert(T record); 说明:保存一个实体,null的属性也会保存,不会使用数据库默认值 方法:int insertSelective(T record); 说明:保存一个实体,null的属性不会保存,会使用数据库默认值
方法:int updateByPrimaryKey(T record); 说明:根据主键更新实体全部字段,null值会被更新 方法:int updateByPrimaryKeySelective(T record); 说明:根据主键更新属性不为null的值
方法:int delete(T record); 说明:根据实体属性作为条件进行删除,查询条件使用等号 方法:int deleteByPrimaryKey(Object key); 说明:根据主键字段进行删除,方法参数必须包含完整的主键属性
ListgetPageSet(@Param("filterSort") String filterSort); //获得分页集数据 HashMap getDetailByUuid(String uuid); //通过uuid获得详细数据 Integer save(SysUserBase sysUserBase); //保存数据 Integer update(SysUserBase sysUserBase); //更新数据 Integer deleteByUuid(String uuid); //通过uuid删除数据 List > getList(); //获得列表数据 List > getListByLike(String userNameId); //通过包含用户名获得列表数据 List getListBySearializeParam(String userNameId, String password); //通过#{0},#{1}参数形式获得列表数据 List getListByEntityParam(SysUserBase sysUserBase); //通过实体参数名获得列表数据
public interface SysUserBaseService extends MdataBaseService{ PageSet getPageSet(PageParam pageParam, String filterSort,String userNameId); //获取分页集 SysUserBase queryObject(String uuid); //获取对象数据 List queryList(Map map); //获取集合数据 int queryTotal(Map map); //获取统计集合 int executeSave(SysUserBase sysUserBase); //插入数据 int executeUpdate(SysUserBase sysUserBase); //更新数据 int executeDelete(String uuid); //删除数据 int executeDeleteBatch(String[] uuids); //批量删除数据 }