BaseService.java
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.bsth.service;
import java.io.Serializable;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
*
* @ClassName: BaseService
* @Description: TODO(基础的Service接口)
* @author PanZhao
* @date 2016年3月17日 下午12:48:43
*
* @param <T>
* @param <ID>
*/
public interface BaseService<T, ID extends Serializable> {
/**
* 根据主键获取单个对象
* @param id
* @return
*/
T findById(ID id);
/**
* 保存
* @param t
* @return
*/
Map<String, Object> save(T t);
/**
*
* @Title: list
* @Description: TODO(多条件分页查询)
* @param @param map 查询条件
* @param @param pageable 分页对象
* @throws
*/
Page<T> list(Map<String, Object> map, Pageable pageable);
/**
*
* @Title: list
* @Description: TODO(多条件查询)
* @throws
*/
Iterable<T> list(Map<String, Object> map);
/**
* 获取所有
* @return
*/
Iterable<T> findAll();
/**
*
* @Title: deleteById
* @Description: TODO(根据主键删除对象)
* @param @param id
* @throws
*/
Map<String, Object> delete(ID id);
}