cloudroam
2025-03-10 c306cba52bcc3e2c423f77d4a52c35ad04c52038
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package com.jsh.erp.service;
 
import com.alibaba.fastjson.JSONObject;
 
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
 
/**
 * 通用查询接口
 * 功能:1、单条查询 2、分页+搜索 3、查询数量
 *
 * @author jishenghua
 * @version 1.0
 */
public interface ICommonQuery {
    /**
     * 根据id查询明细。
     *
     * @param id 资源id
     * @return 资源
     */
    Object selectOne(Long id) throws Exception;
 
    /**
     * 自定义查询
     *
     * @param parameterMap 查询参数
     * @return 查询结果
     */
    List<?> select(Map<String, String> parameterMap) throws Exception;
 
    /**
     * 查询数量
     *
     * @param parameterMap 查询参数
     * @return 查询结果
     */
    Long counts(Map<String, String> parameterMap) throws Exception;
 
    /**
     * 新增数据
     *
     * @param obj
     * @return
     */
    int insert(JSONObject obj, HttpServletRequest request) throws Exception;
 
    /**
     * 更新数据
     *
     * @param obj
     * @return
     */
    int update(JSONObject obj, HttpServletRequest request) throws Exception;
 
    /**
     * 删除数据
     *
     * @param id
     * @return
     */
    int delete(Long id, HttpServletRequest request) throws Exception;
 
    /**
     * 批量删除数据
     *
     * @param ids
     * @return
     */
    int deleteBatch(String ids, HttpServletRequest request) throws Exception;
 
    /**
     * 查询名称是否存在
     *
     * @param id
     * @return
     */
    int checkIsNameExist(Long id, String name) throws Exception;
}