leutu
2024-06-03 3ef35e6cd16bbfa206b26bb3271eac40ad020bcb
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package com.fastbee.iot.mapper;
 
import com.fastbee.iot.domain.Product;
import com.fastbee.iot.model.ChangeProductStatusModel;
import com.fastbee.iot.model.IdAndName;
import com.fastbee.iot.model.ProductCode;
import org.springframework.stereotype.Repository;
 
import java.util.List;
 
/**
 * 产品Mapper接口
 *
 * @author kerwincui
 * @date 2021-12-16
 */
@Repository
public interface ProductMapper
{
    /**
     * 查询产品
     *
     * @param productId 产品主键
     * @return 产品
     */
    public Product selectProductByProductId(Long productId);
 
    /**
     * 查询产品列表
     *
     * @param product 产品
     * @return 产品集合
     */
    public List<Product> selectProductList(Product product);
 
    /**
     * 查询产品简短列表
     *
     * @param product 产品
     * @return 产品集合
     */
    public List<IdAndName> selectProductShortList(Product product);
 
    /**
     * 新增产品
     *
     * @param product 产品
     * @return 结果
     */
    public int insertProduct(Product product);
 
    /**
     * 修改产品
     *
     * @param product 产品
     * @return 结果
     */
    public int updateProduct(Product product);
 
    /**
     * 更新产品状态,1-未发布,2-已发布
     *
     * @param model
     * @return 结果
     */
    public int changeProductStatus(ChangeProductStatusModel model);
 
    /**
     * 修改物模型JSON
     *
     * @param product 产品
     * @return 结果
     */
    public int updateThingsModelJson(Product product);
 
    /**
     * 删除产品
     *
     * @param productId 产品主键
     * @return 结果
     */
    public int deleteProductByProductId(Long productId);
 
    /**
     * 批量删除产品
     *
     * @param productIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteProductByProductIds(Long[] productIds);
 
    /**
     * 批量删除产品物模型
     *
     * @param productIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteProductThingsModelByProductIds(Long[] productIds);
 
 
    /**
     * 产品下的设备数量
     * @param productIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deviceCountInProducts(Long[] productIds);
 
    /**
     * 产品下的物模型数量
     * @param productId 需要删除的数据主键集合
     * @return 结果
     */
    public int thingsCountInProduct(Long productId);
 
    /**
     * 产品下的物模型标识符重复数
     * @param productId 需要删除的数据主键集合
     * @return 结果
     */
    public int thingsRepeatCountInProduct(Long productId);
 
    /**
     * 根据设备编号查询产品信息
     * @param serialNumber 设备编号
     * @return 结果
     */
    public Product getProductBySerialNumber(String serialNumber);
 
    /**
     * 根据设备编号查询协议编号
     * @param serialNumber 设备编号
     * @return 协议编号
     */
    public ProductCode getProtocolBySerialNumber(String serialNumber);
 
    /**
     * 根据产品id获取协议编号
     * @param productId 产品id
     * @return 协议编号
     */
    public String getProtocolByProductId(Long productId);
 
    /**
     * 根据模板id查询所有使用的产品
     * @param templeId 模板id
     * @return
     */
    public List<Product> selectByTempleId(Long templeId);
}