Commit 66b3bbb456b73325ceaf5442667ce8181f36b254
1 parent
8e622034
添加功能配置接口;
Showing
28 changed files
with
4452 additions
and
62 deletions
Linux服务器监听运维功能.md
... | ... | @@ -7,10 +7,10 @@ |
7 | 7 | | POST | http://ip:port/occupationOfBasicResources/getInfoByModule | |
8 | 8 | | Content-Type | application/json;charset=UTF-8 | |
9 | 9 | |
10 | -| 请求参数 | | | | | | |
11 | -| ----------- | ------------ | ------ | ---- | ------------------------------------- | | |
12 | -| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
13 | -| module | 功能编码 | string | 是 | | | |
10 | +| 请求参数 | | | | | | |
11 | +| -------- | -------- | ------ | ---- | ---- | | |
12 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
13 | +| module | 功能编码 | string | 是 | | | |
14 | 14 | ``` |
15 | 15 | 请求示例 |
16 | 16 | { |
... | ... | @@ -144,6 +144,184 @@ |
144 | 144 | ``` |
145 | 145 | |
146 | 146 | |
147 | +## 1.5 配置启动服务 | |
148 | +### 1.5.1 创建 | |
149 | + | |
150 | +| 调用方式 | 接口地址 | | |
151 | +| ------------ | :------------------------------------------------------ | | |
152 | +| POST | http://ip:port/occupationOfBasicResources/createService | | |
153 | +| Content-Type | application/json;charset=UTF-8 | | |
154 | + | |
155 | +| 请求参数 | | | | | | |
156 | +| ----------- | ------------ | ------- | ---- | -------------- | | |
157 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
158 | +| serviceName | 服务名称 | string | 是 | 服务名称 | | |
159 | +| items | 配置参数信息 | | | | | |
160 | +| +itemName | 配置参数名称 | string | 是 | 配置参数名称 | | |
161 | +| +itemValue | 配置参数值 | string | 是 | 配置参数值 | | |
162 | +| +sort | 配置参数顺序 | Integer | 是 | 参数显示的顺序 | | |
163 | + | |
164 | +``` | |
165 | +请求示例 | |
166 | +{ | |
167 | + "serviceName": "1111", | |
168 | + "items": [ | |
169 | + {"itemName": "1111", | |
170 | + "itemValue": "13", | |
171 | + "sort": 1}, | |
172 | + ... | |
173 | + ] | |
174 | +} | |
175 | +``` | |
176 | + | |
177 | +| 返回结果 | | | | | |
178 | +| -------- | -------- | ------ | --------------------------------- | | |
179 | +| 参数项 | 名称 | 类型 | 描述 | | |
180 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
181 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
182 | +| data | 返回信息 | | | | |
183 | + | |
184 | +``` | |
185 | +响应示例 | |
186 | +{ | |
187 | + "code": 200, | |
188 | + "message": "操作成功", | |
189 | + "data": {} | |
190 | +} | |
191 | +``` | |
192 | + | |
193 | +### 1.5.2 更新 | |
194 | + | |
195 | +| 调用方式 | 接口地址 | | |
196 | +| ------------ | :------------------------------------------------------ | | |
197 | +| POST | http://ip:port/occupationOfBasicResources/updateService | | |
198 | +| Content-Type | application/json;charset=UTF-8 | | |
199 | + | |
200 | +| 请求参数 | | | | | | |
201 | +| ----------- | ------------ | ------- | ---- | -------------- | | |
202 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
203 | +| id | 服务主键 | Integer | 是 | 主键 | | |
204 | +| serviceName | 服务名称 | string | 是 | 服务名称 | | |
205 | +| items | 配置参数信息 | | | | | |
206 | +| +itemName | 配置参数名称 | string | 是 | 配置参数名称 | | |
207 | +| +itemValue | 配置参数值 | string | 是 | 配置参数值 | | |
208 | +| +sort | 配置参数顺序 | Integer | 是 | 参数显示的顺序 | | |
209 | + | |
210 | +``` | |
211 | +请求示例 | |
212 | +{ | |
213 | + "id": 1 | |
214 | + "serviceName": "1111", | |
215 | + "items": [ | |
216 | + {"itemName": "1111", | |
217 | + "itemValue": "13", | |
218 | + "sort": 1}, | |
219 | + ... | |
220 | + ] | |
221 | +} | |
222 | +``` | |
223 | + | |
224 | +| 返回结果 | | | | | |
225 | +| -------- | -------- | ------ | --------------------------------- | | |
226 | +| 参数项 | 名称 | 类型 | 描述 | | |
227 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
228 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
229 | +| data | 返回信息 | | | | |
230 | + | |
231 | +``` | |
232 | +响应示例 | |
233 | +{ | |
234 | + "code": 200, | |
235 | + "message": "操作成功", | |
236 | + "data": {} | |
237 | +} | |
238 | +``` | |
239 | + | |
240 | +### 1.5.3 删除 | |
241 | + | |
242 | +| 调用方式 | 接口地址 | | |
243 | +| ------------ | :------------------------------------------------------ | | |
244 | +| POST | http://ip:port/occupationOfBasicResources/deleteService | | |
245 | +| Content-Type | application/json;charset=UTF-8 | | |
246 | + | |
247 | +| 请求参数 | | | | | | |
248 | +| -------- | -------- | ------- | ---- | ------------------ | | |
249 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
250 | +| id | 服务主键 | Integer | 是 | 主键(formdata形式) | | |
251 | +``` | |
252 | +请求示例 | |
253 | +"id": 1 | |
254 | +``` | |
255 | + | |
256 | +| 返回结果 | | | | | |
257 | +| -------- | -------- | ------ | --------------------------------- | | |
258 | +| 参数项 | 名称 | 类型 | 描述 | | |
259 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
260 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
261 | +| data | 返回信息 | | | | |
262 | + | |
263 | +``` | |
264 | +响应示例 | |
265 | +{ | |
266 | + "code": 200, | |
267 | + "message": "操作成功", | |
268 | + "data": {} | |
269 | +} | |
270 | +``` | |
271 | + | |
272 | +## 1.6 查询配置好的服务运行情况 | |
273 | + | |
274 | +| 调用方式 | 接口地址 | | |
275 | +| ------------ | :----------------------------------------------------- | | |
276 | +| POST | http://ip:port/occupationOfBasicResources/serviceQuery | | |
277 | +| Content-Type | application/json;charset=UTF-8 | | |
278 | + | |
279 | +| 请求参数 | | | | | | |
280 | +| ----------- | -------- | ------- | ---- | ---------------------- | | |
281 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
282 | +| currentPage | 页码 | Integer | 是 | 页码(formdata形式) | | |
283 | +| pageVolume | 页面容量 | Integer | 是 | 页面容量(formdata形式) | | |
284 | + | |
285 | +``` | |
286 | +请求示例 | |
287 | +{ | |
288 | + "currentPage": 1, | |
289 | + "pageVolume": 20 | |
290 | +} | |
291 | +``` | |
292 | + | |
293 | +| 返回结果 | | | | | |
294 | +| ----------- | ------------ | ------ | --------------------------------- | | |
295 | +| 参数项 | 名称 | 类型 | 描述 | | |
296 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
297 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
298 | +| data | 返回信息 | | | | |
299 | +| +gpuId | 显卡id | String | 显卡id | | |
300 | +| +port | ip和端口号 | String | ip和端口号 | | |
301 | +| +items | 配置项 | String | 配置项 | | |
302 | +| +status | 运行状态 | String | 运行状态 | | |
303 | +| +updateTime | 最后更新时间 | String | 最后更新时间 | | |
304 | + | |
305 | +``` | |
306 | +响应示例 | |
307 | +{ | |
308 | + "code": 200, | |
309 | + "message": "操作成功", | |
310 | + "data": [ | |
311 | + { | |
312 | + "gpuId": "1", | |
313 | + "port":"192.168.10.117:8845", | |
314 | + "items":"1,2,3,4,5,6", | |
315 | + "status":"0", | |
316 | + "updateTime":"2019-12-24 10:13:00" | |
317 | + }, | |
318 | + ... | |
319 | + ] | |
320 | +} | |
321 | +``` | |
322 | + | |
323 | + | |
324 | + | |
147 | 325 | |
148 | 326 | # 2. 日志监控 |
149 | 327 | |
... | ... | @@ -325,7 +503,33 @@ |
325 | 503 | ] |
326 | 504 | } |
327 | 505 | ``` |
506 | +## 2.6 下载日志文件 | |
507 | + | |
508 | +| 调用方式 | 接口地址 | | |
509 | +| ------------ | :-------------------------------------- | | |
510 | +| POST | http://ip:port/logListener/download/log | | |
511 | +| Content-Type | application/json;charset=UTF-8 | | |
512 | + | |
513 | +| 请求参数 | | | | | | |
514 | +| -------- | ------------- | ------ | ---- | --------------------------- | | |
515 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
516 | +| logKey | 监听用日志key | string | 是 | 监听用日志key(formdata格式) | | |
328 | 517 | |
518 | +| 返回结果 | | | | | |
519 | +| -------- | -------- | ------ | ----------------------------------------------------- | | |
520 | +| 参数项 | 名称 | 类型 | 描述 | | |
521 | +| code | 响应码 | int | 200为操作成功,其他code表示失败(成功时会直接开启下载) | | |
522 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
523 | +| data | 返回信息 | | | | |
524 | + | |
525 | +``` | |
526 | +响应示例 | |
527 | +{ | |
528 | + "code": 200, | |
529 | + "message": "操作成功", | |
530 | + "data": {} | |
531 | +} | |
532 | +``` | |
329 | 533 | |
330 | 534 | # 3. 监控器调度 |
331 | 535 | |
... | ... | @@ -555,4 +759,203 @@ |
555 | 759 | "data": null |
556 | 760 | } |
557 | 761 | ``` |
762 | +# 4 用户控制 | |
763 | + | |
764 | +## 4.1 登录 | |
765 | + | |
766 | +| 调用方式 | 接口地址 | | |
767 | +| ------------ | :----------------------------- | | |
768 | +| POST | http://ip:port/user/login | | |
769 | +| Content-Type | application/json;charset=UTF-8 | | |
770 | + | |
771 | +| 请求参数 | | | | | | |
772 | +| -------- | ------ | ------ | ---- | ----------------- | | |
773 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
774 | +| username | 用户名 | string | 是 | 用户名(param格式) | | |
775 | +| password | 密码 | string | 是 | 密码(param格式) | | |
776 | + | |
777 | +``` | |
778 | +请求示例 | |
779 | +{ | |
780 | + "username": admin, | |
781 | + "password": admin | |
782 | +} | |
783 | +``` | |
784 | + | |
785 | + | |
786 | +| 返回结果 | | | | | |
787 | +| -------- | -------- | ------ | --------------------------------- | | |
788 | +| 参数项 | 名称 | 类型 | 描述 | | |
789 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
790 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
791 | +| data | 返回信息 | | | | |
792 | + | |
793 | +``` | |
794 | +响应示例 | |
795 | +{ | |
796 | + "code": 200, | |
797 | + "message": "操作成功", | |
798 | + "data": null | |
799 | +} | |
800 | +``` | |
801 | + | |
802 | +## 4.2 修改密码 | |
803 | + | |
804 | +| 调用方式 | 接口地址 | | |
805 | +| ------------ | :------------------------------- | | |
806 | +| POST | http://ip:port/user/changePasswd | | |
807 | +| Content-Type | application/json;charset=UTF-8 | | |
808 | + | |
809 | +| 请求参数 | | | | | | |
810 | +| -------- | ------ | ------ | ---- | ----------------- | | |
811 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
812 | +| username | 用户名 | string | 是 | 用户名(param格式) | | |
813 | +| password | 新密码 | string | 是 | 新密码(param格式) | | |
814 | + | |
815 | +``` | |
816 | +请求示例 | |
817 | +{ | |
818 | + "username": admin, | |
819 | + "password": admin | |
820 | +} | |
821 | +``` | |
822 | + | |
823 | + | |
824 | +| 返回结果 | | | | | |
825 | +| -------- | -------- | ------ | --------------------------------- | | |
826 | +| 参数项 | 名称 | 类型 | 描述 | | |
827 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
828 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
829 | +| data | 返回信息 | | | | |
830 | + | |
831 | +``` | |
832 | +响应示例 | |
833 | +{ | |
834 | + "code": 200, | |
835 | + "message": "操作成功", | |
836 | + "data": null | |
837 | +} | |
838 | +``` | |
839 | + | |
840 | +## 4.3 创建用户 | |
558 | 841 | |
842 | +| 调用方式 | 接口地址 | | |
843 | +| ------------ | :----------------------------- | | |
844 | +| POST | http://ip:port/user/addUser | | |
845 | +| Content-Type | application/json;charset=UTF-8 | | |
846 | + | |
847 | +| 请求参数 | | | | | | |
848 | +| -------- | ------ | ------ | ---- | ----------------- | | |
849 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
850 | +| username | 用户名 | string | 是 | 用户名(param格式) | | |
851 | +| password | 新密码 | string | 是 | 新密码(param格式) | | |
852 | + | |
853 | +``` | |
854 | +请求示例 | |
855 | +{ | |
856 | + "username": admin, | |
857 | + "password": admin | |
858 | +} | |
859 | +``` | |
860 | + | |
861 | + | |
862 | +| 返回结果 | | | | | |
863 | +| -------- | -------- | ------- | --------------------------------- | | |
864 | +| 参数项 | 名称 | 类型 | 描述 | | |
865 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
866 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
867 | +| data | 返回信息 | | | | |
868 | +| +id | 主键 | Integer | 主键 | | |
869 | + | |
870 | +``` | |
871 | +响应示例 | |
872 | +{ | |
873 | + "code": 200, | |
874 | + "message": "操作成功", | |
875 | + "data": {"id": 1} | |
876 | +} | |
877 | +``` | |
878 | + | |
879 | +## 4.4 查询用户信息 | |
880 | + | |
881 | +| 调用方式 | 接口地址 | | |
882 | +| ------------ | :------------------------------ | | |
883 | +| POST | http://ip:port/user/searchUsers | | |
884 | +| Content-Type | application/json;charset=UTF-8 | | |
885 | + | |
886 | +| 请求参数 | | | | | | |
887 | +| ----------- | -------- | ------- | ---- | ------------------- | | |
888 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
889 | +| username | 用户名 | string | 是 | 用户名(param格式) | | |
890 | +| currentPage | 页码 | Integer | 是 | 页码(param格式) | | |
891 | +| pageVolume | 页面容量 | Integer | 是 | 页面容量(param格式) | | |
892 | + | |
893 | +``` | |
894 | +请求示例 | |
895 | +{ | |
896 | + "username": admin, | |
897 | + "currentPage": 1, | |
898 | + "pageVolume": 20 | |
899 | +} | |
900 | +``` | |
901 | + | |
902 | + | |
903 | +| 返回结果 | | | | | |
904 | +| --------- | -------- | ------- | --------------------------------- | | |
905 | +| 参数项 | 名称 | 类型 | 描述 | | |
906 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
907 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
908 | +| data | 返回信息 | | | | |
909 | +| +id | 主键 | Integer | 主键 | | |
910 | +| +username | 用户名 | String | 用户名 | | |
911 | +| +password | 密码 | String | 密码 | | |
912 | + | |
913 | +``` | |
914 | +响应示例 | |
915 | +{ | |
916 | + "code": 200, | |
917 | + "message": "操作成功", | |
918 | + "data": { | |
919 | + "id": 1, | |
920 | + "username": "admin", | |
921 | + "password": "admin" | |
922 | + } | |
923 | +} | |
924 | +``` | |
925 | + | |
926 | +## 4.5 校验用户是否存在 | |
927 | + | |
928 | +| 调用方式 | 接口地址 | | |
929 | +| ------------ | :----------------------------- | | |
930 | +| POST | http://ip:port/user/checkUser | | |
931 | +| Content-Type | application/json;charset=UTF-8 | | |
932 | + | |
933 | +| 请求参数 | | | | | | |
934 | +| -------- | ------ | ------ | ---- | ----------------- | | |
935 | +| 参数项 | 名称 | 类型 | 必选 | 描述 | | |
936 | +| username | 用户名 | string | 是 | 用户名(param格式) | | |
937 | + | |
938 | +``` | |
939 | +请求示例 | |
940 | +{ | |
941 | + "username": admin | |
942 | +} | |
943 | +``` | |
944 | + | |
945 | + | |
946 | +| 返回结果 | | | | | |
947 | +| -------- | -------- | ------- | --------------------------------- | | |
948 | +| 参数项 | 名称 | 类型 | 描述 | | |
949 | +| code | 响应码 | int | 200为操作成功,其他code表示失败 | | |
950 | +| message | 提示信息 | string | 200为操作成功, 其他为对应错误信息 | | |
951 | +| data | 返回信息 | | | | |
952 | +| +count | 存在条数 | Integer | 存在条数 | | |
953 | + | |
954 | +``` | |
955 | +响应示例 | |
956 | +{ | |
957 | + "code": 200, | |
958 | + "message": "操作成功", | |
959 | + "data": {"count": 1} | |
960 | +} | |
961 | +``` | |
559 | 962 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/LinuxListenerApplication.java
... | ... | @@ -21,8 +21,7 @@ public class LinuxListenerApplication { |
21 | 21 | } |
22 | 22 | |
23 | 23 | @Bean |
24 | - public TaskScheduler taskScheduler(){ | |
25 | - | |
24 | + public TaskScheduler taskScheduler() { | |
26 | 25 | ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); |
27 | 26 | threadPoolTaskScheduler.setPoolSize(3); |
28 | 27 | threadPoolTaskScheduler.initialize(); | ... | ... |
src/main/java/com/objecteye/common/PageResult.java
0 → 100644
1 | +package com.objecteye.common; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.List; | |
5 | + | |
6 | +public class PageResult<T> implements Serializable { | |
7 | + | |
8 | + private static final long serialVersionUID = 3161527748709808462L; | |
9 | + | |
10 | + private long total; | |
11 | + | |
12 | + private List<T> row; | |
13 | + | |
14 | + public PageResult() { | |
15 | + } | |
16 | + | |
17 | + public PageResult(long total, List<T> row) { | |
18 | + this.total = total; | |
19 | + this.row = row; | |
20 | + } | |
21 | + | |
22 | + public long gettotal() { | |
23 | + return total; | |
24 | + } | |
25 | + | |
26 | + public void settotal(int total) { | |
27 | + this.total = total; | |
28 | + } | |
29 | + | |
30 | + public List<T> getRow() { | |
31 | + return row; | |
32 | + } | |
33 | + | |
34 | + public void setRow(List<T> row) { | |
35 | + this.row = row; | |
36 | + } | |
37 | +} | ... | ... |
src/main/java/com/objecteye/controller/BackGroundController.java
... | ... | @@ -16,38 +16,26 @@ import java.util.Map; |
16 | 16 | @Api(tags = "background", description = "监控器调度") |
17 | 17 | @RequestMapping("/background") |
18 | 18 | @CrossOrigin |
19 | -public class BackGroundController { | |
19 | +public class BackGroundController extends BasicController { | |
20 | 20 | @Autowired |
21 | 21 | private IBackGroundService iBackGroundService; |
22 | 22 | |
23 | 23 | @ApiOperation("获取正在生效的监控功能") |
24 | 24 | @RequestMapping(value = "/getWorkingListener", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
25 | - public CommonResult getWorkingListener() { | |
26 | - JSONObject resultObj = iBackGroundService.getWorkingListener(); | |
27 | - if (resultObj.containsKey("error")) { | |
28 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
29 | - } | |
30 | - return CommonResult.success(resultObj); | |
25 | + public CommonResult<JSONObject> getWorkingListener() { | |
26 | + return jsonObjectResultHandle(iBackGroundService.getWorkingListener()); | |
31 | 27 | } |
32 | 28 | |
33 | 29 | @ApiOperation("添加新的监控器") |
34 | 30 | @RequestMapping(value = "/addWorkingListener", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
35 | - public CommonResult addWorkingListener(@RequestBody Map<String, Object> requestMap) { | |
36 | - JSONObject resultObj = iBackGroundService.addWorkingListener(requestMap); | |
37 | - if (resultObj.containsKey("error")) { | |
38 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
39 | - } | |
40 | - return CommonResult.success(resultObj); | |
31 | + public CommonResult<JSONObject> addWorkingListener(@RequestBody Map<String, Object> requestMap) { | |
32 | + return jsonObjectResultHandle(iBackGroundService.addWorkingListener(requestMap)); | |
41 | 33 | } |
42 | 34 | |
43 | 35 | @ApiOperation("删除存在的监控器") |
44 | 36 | @RequestMapping(value = "/removeWorkingListener", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
45 | 37 | public CommonResult removeWorkingListener(@RequestBody Map<String, Object> requestMap) { |
46 | - JSONObject resultObj = iBackGroundService.removeWorkingListener(requestMap); | |
47 | - if (resultObj.containsKey("error")) { | |
48 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
49 | - } | |
50 | - return CommonResult.success(resultObj); | |
38 | + return jsonObjectResultHandle(iBackGroundService.removeWorkingListener(requestMap)); | |
51 | 39 | } |
52 | 40 | |
53 | 41 | @ApiOperation("获取module对应的内容") |
... | ... | @@ -63,10 +51,30 @@ public class BackGroundController { |
63 | 51 | @ApiOperation("sdk控制器") |
64 | 52 | @RequestMapping(value = "sdkController", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
65 | 53 | public CommonResult sdkController(@RequestBody Map<String, Object> requestMap) { |
66 | - JSONObject resultObj = iBackGroundService.sdkController(requestMap); | |
67 | - if (resultObj.containsKey("error")) { | |
68 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
69 | - } | |
70 | - return CommonResult.success(resultObj); | |
54 | + return jsonObjectResultHandle(iBackGroundService.sdkController(requestMap)); | |
55 | + } | |
56 | + | |
57 | + @ApiOperation("配置启动服务") | |
58 | + @RequestMapping(value = "createService", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
59 | + public CommonResult createConfig(@RequestBody JSONObject requestObj) { | |
60 | + return CommonResult.success(iBackGroundService.createServiceConfig(requestObj)); | |
61 | + } | |
62 | + | |
63 | + @ApiOperation("配置启动服务") | |
64 | + @RequestMapping(value = "updateService", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
65 | + public CommonResult updateService(@RequestBody JSONObject requestObj) { | |
66 | + return CommonResult.success(iBackGroundService.updateServiceConfig(requestObj)); | |
67 | + } | |
68 | + | |
69 | + @ApiOperation("配置启动服务") | |
70 | + @RequestMapping(value = "deleteService", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
71 | + public CommonResult deleteService(@RequestParam Integer id) { | |
72 | + return CommonResult.success(iBackGroundService.deleteServiceConfig(id)); | |
73 | + } | |
74 | + | |
75 | + @ApiOperation("查询配置好的服务运行情况") | |
76 | + @RequestMapping(value = "serviceQuery", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
77 | + public CommonResult serviceQuery(@RequestParam Integer currentPage, @RequestParam Integer pageVolume) { | |
78 | + return pageResultHandle(iBackGroundService.serviceQuery(currentPage, pageVolume)); | |
71 | 79 | } |
72 | 80 | } | ... | ... |
src/main/java/com/objecteye/controller/BasicController.java
0 → 100644
1 | +package com.objecteye.controller; | |
2 | + | |
3 | +import com.alibaba.fastjson.JSONObject; | |
4 | +import com.objecteye.common.CommonResult; | |
5 | +import com.objecteye.common.PageResult; | |
6 | + | |
7 | +public class BasicController { | |
8 | + | |
9 | + /** | |
10 | + * jsonObject通用处理 | |
11 | + * | |
12 | + * @param resultObj 返回参数 | |
13 | + * @return 结果集 | |
14 | + */ | |
15 | + CommonResult<JSONObject> jsonObjectResultHandle(JSONObject resultObj) { | |
16 | + if (resultObj.containsKey("error")) { | |
17 | + return CommonResult.success(201, resultObj.getString("error"), null); | |
18 | + } | |
19 | + return CommonResult.success(resultObj); | |
20 | + } | |
21 | + | |
22 | + /** | |
23 | + * pageResult统一处理 | |
24 | + * | |
25 | + * @param pageResult 返回参数 | |
26 | + * @return 结果集 | |
27 | + */ | |
28 | + CommonResult pageResultHandle(PageResult<?> pageResult) { | |
29 | + if (pageResult.getRow().size() > 0) { | |
30 | + return CommonResult.success(pageResult); | |
31 | + } else { | |
32 | + return CommonResult.success(201, "没有找到有效数据", null); | |
33 | + } | |
34 | + } | |
35 | +} | ... | ... |
src/main/java/com/objecteye/controller/LogFileListenerController.java
1 | 1 | package com.objecteye.controller; |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.JSONArray; |
4 | -import com.alibaba.fastjson.JSONObject; | |
5 | 4 | import com.objecteye.common.CommonResult; |
6 | 5 | import com.objecteye.service.ILogFileListenerService; |
7 | 6 | import io.swagger.annotations.Api; |
8 | 7 | import io.swagger.annotations.ApiOperation; |
9 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
9 | +import org.springframework.http.MediaType; | |
10 | 10 | import org.springframework.web.bind.annotation.*; |
11 | 11 | |
12 | +import javax.servlet.http.HttpServletResponse; | |
12 | 13 | import java.io.IOException; |
13 | 14 | import java.util.Map; |
14 | 15 | |
... | ... | @@ -16,18 +17,14 @@ import java.util.Map; |
16 | 17 | @Api(tags = "logListener", description = "日志监控") |
17 | 18 | @RequestMapping("/logListener") |
18 | 19 | @CrossOrigin |
19 | -public class LogFileListenerController { | |
20 | +public class LogFileListenerController extends BasicController { | |
20 | 21 | @Autowired |
21 | 22 | private ILogFileListenerService iLogFileListenerService; |
22 | 23 | |
23 | 24 | @ApiOperation("设置log文件所在位置信息") |
24 | 25 | @RequestMapping(value = "/setLogMsg", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
25 | 26 | public CommonResult setLogMsg(@RequestBody Map<String, Object> requestMap) { |
26 | - JSONObject resultObj = iLogFileListenerService.setLogMsg(requestMap); | |
27 | - if (resultObj.containsKey("error")) { | |
28 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
29 | - } | |
30 | - return CommonResult.success(resultObj); | |
27 | + return jsonObjectResultHandle(iLogFileListenerService.setLogMsg(requestMap)); | |
31 | 28 | } |
32 | 29 | |
33 | 30 | @ApiOperation("开启日志监控输出") |
... | ... | @@ -59,4 +56,10 @@ public class LogFileListenerController { |
59 | 56 | } |
60 | 57 | return CommonResult.success(logKeyPathArr); |
61 | 58 | } |
59 | + | |
60 | + @ApiOperation("下载日志文件") | |
61 | + @RequestMapping(value = "download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE, method = RequestMethod.GET) | |
62 | + public CommonResult downloadLogFile(@RequestParam(required = false) String logKey, HttpServletResponse httpServletResponse) { | |
63 | + return jsonObjectResultHandle(iLogFileListenerService.downloadLogFile(httpServletResponse, logKey)); | |
64 | + } | |
62 | 65 | } | ... | ... |
src/main/java/com/objecteye/controller/OccupationOfBasicResourcesController.java
1 | 1 | package com.objecteye.controller; |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.JSONArray; |
4 | -import com.alibaba.fastjson.JSONObject; | |
5 | 4 | import com.objecteye.common.CommonResult; |
6 | 5 | import com.objecteye.service.IOccupationOfBasicResourcesService; |
7 | 6 | import io.swagger.annotations.Api; |
... | ... | @@ -15,7 +14,7 @@ import java.util.Map; |
15 | 14 | @Api(tags = "occupationOfBasicResources", description = "基础资源占用") |
16 | 15 | @RequestMapping("/occupationOfBasicResources") |
17 | 16 | @CrossOrigin |
18 | -public class OccupationOfBasicResourcesController { | |
17 | +public class OccupationOfBasicResourcesController extends BasicController { | |
19 | 18 | @Autowired |
20 | 19 | private IOccupationOfBasicResourcesService iOccupationOfBasicResourcesService; |
21 | 20 | |
... | ... | @@ -33,30 +32,18 @@ public class OccupationOfBasicResourcesController { |
33 | 32 | @ApiOperation("jar包发布") |
34 | 33 | @RequestMapping(value = "/deployJarFile", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
35 | 34 | public CommonResult deployJarFile(@RequestBody Map<String, Object> requestMap) { |
36 | - JSONObject resultObj = iOccupationOfBasicResourcesService.deployJarFile(requestMap); | |
37 | - if (resultObj.containsKey("error")) { | |
38 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
39 | - } | |
40 | - return CommonResult.success(resultObj); | |
35 | + return jsonObjectResultHandle(iOccupationOfBasicResourcesService.deployJarFile(requestMap)); | |
41 | 36 | } |
42 | 37 | |
43 | 38 | @ApiOperation("获取当前进行中的java服务") |
44 | 39 | @RequestMapping(value = "/getJpsInfo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
45 | 40 | public CommonResult getJpsInfo() { |
46 | - JSONObject resultObj = iOccupationOfBasicResourcesService.getJpsInfo(); | |
47 | - if (resultObj.containsKey("error")) { | |
48 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
49 | - } | |
50 | - return CommonResult.success(resultObj); | |
41 | + return jsonObjectResultHandle(iOccupationOfBasicResourcesService.getJpsInfo()); | |
51 | 42 | } |
52 | 43 | |
53 | 44 | @ApiOperation("停止jar包进程") |
54 | 45 | @RequestMapping(value = "/killJarTask", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
55 | 46 | public CommonResult killJarTask(@RequestBody Map<String, Object> requestMap) { |
56 | - JSONObject resultObj = iOccupationOfBasicResourcesService.killJarTask(requestMap); | |
57 | - if (resultObj.containsKey("error")) { | |
58 | - return CommonResult.success(201, resultObj.getString("error"), null); | |
59 | - } | |
60 | - return CommonResult.success(resultObj); | |
47 | + return jsonObjectResultHandle(iOccupationOfBasicResourcesService.killJarTask(requestMap)); | |
61 | 48 | } |
62 | 49 | } | ... | ... |
src/main/java/com/objecteye/controller/UserController.java
0 → 100644
1 | +package com.objecteye.controller; | |
2 | + | |
3 | +import com.objecteye.common.CommonResult; | |
4 | +import com.objecteye.service.IUserService; | |
5 | +import io.swagger.annotations.Api; | |
6 | +import io.swagger.annotations.ApiOperation; | |
7 | +import org.springframework.beans.factory.annotation.Autowired; | |
8 | +import org.springframework.web.bind.annotation.*; | |
9 | + | |
10 | +@RestController | |
11 | +@RequestMapping("user") | |
12 | +@CrossOrigin | |
13 | +@Api(value = "登录", description = "登录") | |
14 | +public class UserController extends BasicController { | |
15 | + | |
16 | + @Autowired | |
17 | + IUserService iUserService; | |
18 | + | |
19 | + @ApiOperation("登录验证") | |
20 | + @RequestMapping(value = "login", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
21 | + public CommonResult login(@RequestParam String username, @RequestParam String password) { | |
22 | + return jsonObjectResultHandle(iUserService.login(username, password)); | |
23 | + } | |
24 | + | |
25 | + @ApiOperation("创建用户") | |
26 | + @RequestMapping(value = "addUser", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
27 | + public CommonResult addUser(@RequestParam String username, @RequestParam String password) { | |
28 | + return jsonObjectResultHandle(iUserService.addUser(username, password)); | |
29 | + } | |
30 | + | |
31 | + @ApiOperation("更新用户") | |
32 | + @RequestMapping(value = "changePasswd", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
33 | + public CommonResult changePasswd(@RequestParam String username, @RequestParam String password) { | |
34 | + return jsonObjectResultHandle(iUserService.updateUser(username, password)); | |
35 | + } | |
36 | + | |
37 | + @ApiOperation("查询用户信息") | |
38 | + @RequestMapping(value = "searchUsers", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
39 | + public CommonResult searchUsers(@RequestParam String username, @RequestParam Integer currentPage, @RequestParam Integer pageVolume) { | |
40 | + return pageResultHandle(iUserService.searchUsers(username, currentPage, pageVolume)); | |
41 | + } | |
42 | + | |
43 | + @ApiOperation("校验用户是否存在") | |
44 | + @RequestMapping(value = "checkUser", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) | |
45 | + public CommonResult checkUser(@RequestParam String username) { | |
46 | + return jsonObjectResultHandle(iUserService.checkUser(username)); | |
47 | + } | |
48 | +} | ... | ... |
src/main/java/com/objecteye/entity/SyServiceConfig.java
0 → 100644
1 | +package com.objecteye.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.ArrayList; | |
5 | +import java.util.Arrays; | |
6 | + | |
7 | +public class SyServiceConfig implements Serializable { | |
8 | + | |
9 | + private static final long serialVersionUID = -8491953881448482420L; | |
10 | + | |
11 | + private Integer id; | |
12 | + | |
13 | + private String serviceName; | |
14 | + | |
15 | + private Integer status; | |
16 | + | |
17 | + private Long createTime; | |
18 | + | |
19 | + private Long updateTime; | |
20 | + | |
21 | + public Integer getId() { | |
22 | + return id; | |
23 | + } | |
24 | + | |
25 | + public void setId(Integer id) { | |
26 | + this.id = id; | |
27 | + } | |
28 | + | |
29 | + public String getServiceName() { | |
30 | + return serviceName; | |
31 | + } | |
32 | + | |
33 | + public void setServiceName(String serviceName) { | |
34 | + this.serviceName = serviceName; | |
35 | + } | |
36 | + | |
37 | + public Integer getStatus() { | |
38 | + return status; | |
39 | + } | |
40 | + | |
41 | + public void setStatus(Integer status) { | |
42 | + this.status = status; | |
43 | + } | |
44 | + | |
45 | + public Long getCreateTime() { | |
46 | + return createTime; | |
47 | + } | |
48 | + | |
49 | + public void setCreateTime(Long createTime) { | |
50 | + this.createTime = createTime; | |
51 | + } | |
52 | + | |
53 | + public Long getUpdateTime() { | |
54 | + return updateTime; | |
55 | + } | |
56 | + | |
57 | + public void setUpdateTime(Long updateTime) { | |
58 | + this.updateTime = updateTime; | |
59 | + } | |
60 | + | |
61 | + public static SyServiceConfig.Builder builder() { | |
62 | + return new SyServiceConfig.Builder(); | |
63 | + } | |
64 | + | |
65 | + public static class Builder { | |
66 | + private SyServiceConfig obj; | |
67 | + | |
68 | + public Builder() { | |
69 | + this.obj = new SyServiceConfig(); | |
70 | + } | |
71 | + | |
72 | + public Builder id(Integer id) { | |
73 | + obj.setId(id); | |
74 | + return this; | |
75 | + } | |
76 | + | |
77 | + public Builder serviceName(String serviceName) { | |
78 | + obj.setServiceName(serviceName); | |
79 | + return this; | |
80 | + } | |
81 | + | |
82 | + public Builder status(Integer status) { | |
83 | + obj.setStatus(status); | |
84 | + return this; | |
85 | + } | |
86 | + | |
87 | + public Builder createTime(Long createTime) { | |
88 | + obj.setCreateTime(createTime); | |
89 | + return this; | |
90 | + } | |
91 | + | |
92 | + public Builder updateTime(Long updateTime) { | |
93 | + obj.setUpdateTime(updateTime); | |
94 | + return this; | |
95 | + } | |
96 | + | |
97 | + public SyServiceConfig build() { | |
98 | + return this.obj; | |
99 | + } | |
100 | + } | |
101 | + | |
102 | + public enum Column { | |
103 | + id("id", "id", "INTEGER", false), | |
104 | + serviceName("service_name", "serviceName", "VARCHAR", false), | |
105 | + status("status", "status", "INTEGER", false), | |
106 | + createTime("create_time", "createTime", "BIGINT", false), | |
107 | + updateTime("update_time", "updateTime", "BIGINT", false); | |
108 | + | |
109 | + private static final String BEGINNING_DELIMITER = "\""; | |
110 | + | |
111 | + private static final String ENDING_DELIMITER = "\""; | |
112 | + | |
113 | + private final String column; | |
114 | + | |
115 | + private final boolean isColumnNameDelimited; | |
116 | + | |
117 | + private final String javaProperty; | |
118 | + | |
119 | + private final String jdbcType; | |
120 | + | |
121 | + public String value() { | |
122 | + return this.column; | |
123 | + } | |
124 | + | |
125 | + public String getValue() { | |
126 | + return this.column; | |
127 | + } | |
128 | + | |
129 | + public String getJavaProperty() { | |
130 | + return this.javaProperty; | |
131 | + } | |
132 | + | |
133 | + public String getJdbcType() { | |
134 | + return this.jdbcType; | |
135 | + } | |
136 | + | |
137 | + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { | |
138 | + this.column = column; | |
139 | + this.javaProperty = javaProperty; | |
140 | + this.jdbcType = jdbcType; | |
141 | + this.isColumnNameDelimited = isColumnNameDelimited; | |
142 | + } | |
143 | + | |
144 | + public String desc() { | |
145 | + return this.getEscapedColumnName() + " DESC"; | |
146 | + } | |
147 | + | |
148 | + public String asc() { | |
149 | + return this.getEscapedColumnName() + " ASC"; | |
150 | + } | |
151 | + | |
152 | + public static Column[] excludes(Column... excludes) { | |
153 | + ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values())); | |
154 | + if (excludes != null && excludes.length > 0) { | |
155 | + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); | |
156 | + } | |
157 | + return columns.toArray(new Column[]{}); | |
158 | + } | |
159 | + | |
160 | + public static Column[] all() { | |
161 | + return Column.values(); | |
162 | + } | |
163 | + | |
164 | + public String getEscapedColumnName() { | |
165 | + if (this.isColumnNameDelimited) { | |
166 | + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); | |
167 | + } else { | |
168 | + return this.column; | |
169 | + } | |
170 | + } | |
171 | + | |
172 | + public String getAliasedEscapedColumnName() { | |
173 | + return this.getEscapedColumnName(); | |
174 | + } | |
175 | + } | |
176 | +} | |
0 | 177 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/entity/SyServiceConfigExample.java
0 → 100644
1 | +package com.objecteye.entity; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.List; | |
5 | + | |
6 | +public class SyServiceConfigExample { | |
7 | + protected String orderByClause; | |
8 | + | |
9 | + protected boolean distinct; | |
10 | + | |
11 | + protected List<Criteria> oredCriteria; | |
12 | + | |
13 | + protected Integer offset; | |
14 | + | |
15 | + protected Integer rows; | |
16 | + | |
17 | + public SyServiceConfigExample() { | |
18 | + oredCriteria = new ArrayList<Criteria>(); | |
19 | + } | |
20 | + | |
21 | + public void setOrderByClause(String orderByClause) { | |
22 | + this.orderByClause = orderByClause; | |
23 | + } | |
24 | + | |
25 | + public String getOrderByClause() { | |
26 | + return orderByClause; | |
27 | + } | |
28 | + | |
29 | + public void setDistinct(boolean distinct) { | |
30 | + this.distinct = distinct; | |
31 | + } | |
32 | + | |
33 | + public boolean isDistinct() { | |
34 | + return distinct; | |
35 | + } | |
36 | + | |
37 | + public List<Criteria> getOredCriteria() { | |
38 | + return oredCriteria; | |
39 | + } | |
40 | + | |
41 | + public void or(Criteria criteria) { | |
42 | + oredCriteria.add(criteria); | |
43 | + } | |
44 | + | |
45 | + public Criteria or() { | |
46 | + Criteria criteria = createCriteriaInternal(); | |
47 | + oredCriteria.add(criteria); | |
48 | + return criteria; | |
49 | + } | |
50 | + | |
51 | + public SyServiceConfigExample orderBy(String orderByClause) { | |
52 | + this.setOrderByClause(orderByClause); | |
53 | + return this; | |
54 | + } | |
55 | + | |
56 | + public SyServiceConfigExample orderBy(String... orderByClauses) { | |
57 | + StringBuffer sb = new StringBuffer(); | |
58 | + for (int i = 0; i < orderByClauses.length; i++) { | |
59 | + sb.append(orderByClauses[i]); | |
60 | + if (i < orderByClauses.length - 1) { | |
61 | + sb.append(" , "); | |
62 | + } | |
63 | + } | |
64 | + this.setOrderByClause(sb.toString()); | |
65 | + return this; | |
66 | + } | |
67 | + | |
68 | + public Criteria createCriteria() { | |
69 | + Criteria criteria = createCriteriaInternal(); | |
70 | + if (oredCriteria.size() == 0) { | |
71 | + oredCriteria.add(criteria); | |
72 | + } | |
73 | + return criteria; | |
74 | + } | |
75 | + | |
76 | + protected Criteria createCriteriaInternal() { | |
77 | + Criteria criteria = new Criteria(this); | |
78 | + return criteria; | |
79 | + } | |
80 | + | |
81 | + public void clear() { | |
82 | + oredCriteria.clear(); | |
83 | + orderByClause = null; | |
84 | + distinct = false; | |
85 | + rows = null; | |
86 | + offset = null; | |
87 | + } | |
88 | + | |
89 | + public void setOffset(Integer offset) { | |
90 | + this.offset = offset; | |
91 | + } | |
92 | + | |
93 | + public Integer getOffset() { | |
94 | + return this.offset; | |
95 | + } | |
96 | + | |
97 | + public void setRows(Integer rows) { | |
98 | + this.rows = rows; | |
99 | + } | |
100 | + | |
101 | + public Integer getRows() { | |
102 | + return this.rows; | |
103 | + } | |
104 | + | |
105 | + public SyServiceConfigExample limit(Integer rows) { | |
106 | + this.rows = rows; | |
107 | + return this; | |
108 | + } | |
109 | + | |
110 | + public SyServiceConfigExample limit(Integer offset, Integer rows) { | |
111 | + this.offset = offset; | |
112 | + this.rows = rows; | |
113 | + return this; | |
114 | + } | |
115 | + | |
116 | + public SyServiceConfigExample page(Integer page, Integer pageSize) { | |
117 | + this.offset = (page - 1) * pageSize; | |
118 | + this.rows = pageSize; | |
119 | + return this; | |
120 | + } | |
121 | + | |
122 | + public static Criteria newAndCreateCriteria() { | |
123 | + SyServiceConfigExample example = new SyServiceConfigExample(); | |
124 | + return example.createCriteria(); | |
125 | + } | |
126 | + | |
127 | + public SyServiceConfigExample when(boolean condition, IExampleWhen then) { | |
128 | + if (condition) { | |
129 | + then.example(this); | |
130 | + } | |
131 | + return this; | |
132 | + } | |
133 | + | |
134 | + public SyServiceConfigExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) { | |
135 | + if (condition) { | |
136 | + then.example(this); | |
137 | + } else { | |
138 | + otherwise.example(this); | |
139 | + } | |
140 | + return this; | |
141 | + } | |
142 | + | |
143 | + protected abstract static class GeneratedCriteria { | |
144 | + protected List<Criterion> criteria; | |
145 | + | |
146 | + protected GeneratedCriteria() { | |
147 | + super(); | |
148 | + criteria = new ArrayList<Criterion>(); | |
149 | + } | |
150 | + | |
151 | + public boolean isValid() { | |
152 | + return criteria.size() > 0; | |
153 | + } | |
154 | + | |
155 | + public List<Criterion> getAllCriteria() { | |
156 | + return criteria; | |
157 | + } | |
158 | + | |
159 | + public List<Criterion> getCriteria() { | |
160 | + return criteria; | |
161 | + } | |
162 | + | |
163 | + protected void addCriterion(String condition) { | |
164 | + if (condition == null) { | |
165 | + throw new RuntimeException("Value for condition cannot be null"); | |
166 | + } | |
167 | + criteria.add(new Criterion(condition)); | |
168 | + } | |
169 | + | |
170 | + protected void addCriterion(String condition, Object value, String property) { | |
171 | + if (value == null) { | |
172 | + throw new RuntimeException("Value for " + property + " cannot be null"); | |
173 | + } | |
174 | + criteria.add(new Criterion(condition, value)); | |
175 | + } | |
176 | + | |
177 | + protected void addCriterion(String condition, Object value1, Object value2, String property) { | |
178 | + if (value1 == null || value2 == null) { | |
179 | + throw new RuntimeException("Between values for " + property + " cannot be null"); | |
180 | + } | |
181 | + criteria.add(new Criterion(condition, value1, value2)); | |
182 | + } | |
183 | + | |
184 | + public Criteria andIdIsNull() { | |
185 | + addCriterion("id is null"); | |
186 | + return (Criteria) this; | |
187 | + } | |
188 | + | |
189 | + public Criteria andIdIsNotNull() { | |
190 | + addCriterion("id is not null"); | |
191 | + return (Criteria) this; | |
192 | + } | |
193 | + | |
194 | + public Criteria andIdEqualTo(Integer value) { | |
195 | + addCriterion("id =", value, "id"); | |
196 | + return (Criteria) this; | |
197 | + } | |
198 | + | |
199 | + public Criteria andIdEqualToColumn(SyServiceConfig.Column column) { | |
200 | + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); | |
201 | + return (Criteria) this; | |
202 | + } | |
203 | + | |
204 | + public Criteria andIdNotEqualTo(Integer value) { | |
205 | + addCriterion("id <>", value, "id"); | |
206 | + return (Criteria) this; | |
207 | + } | |
208 | + | |
209 | + public Criteria andIdNotEqualToColumn(SyServiceConfig.Column column) { | |
210 | + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); | |
211 | + return (Criteria) this; | |
212 | + } | |
213 | + | |
214 | + public Criteria andIdGreaterThan(Integer value) { | |
215 | + addCriterion("id >", value, "id"); | |
216 | + return (Criteria) this; | |
217 | + } | |
218 | + | |
219 | + public Criteria andIdGreaterThanColumn(SyServiceConfig.Column column) { | |
220 | + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); | |
221 | + return (Criteria) this; | |
222 | + } | |
223 | + | |
224 | + public Criteria andIdGreaterThanOrEqualTo(Integer value) { | |
225 | + addCriterion("id >=", value, "id"); | |
226 | + return (Criteria) this; | |
227 | + } | |
228 | + | |
229 | + public Criteria andIdGreaterThanOrEqualToColumn(SyServiceConfig.Column column) { | |
230 | + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); | |
231 | + return (Criteria) this; | |
232 | + } | |
233 | + | |
234 | + public Criteria andIdLessThan(Integer value) { | |
235 | + addCriterion("id <", value, "id"); | |
236 | + return (Criteria) this; | |
237 | + } | |
238 | + | |
239 | + public Criteria andIdLessThanColumn(SyServiceConfig.Column column) { | |
240 | + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); | |
241 | + return (Criteria) this; | |
242 | + } | |
243 | + | |
244 | + public Criteria andIdLessThanOrEqualTo(Integer value) { | |
245 | + addCriterion("id <=", value, "id"); | |
246 | + return (Criteria) this; | |
247 | + } | |
248 | + | |
249 | + public Criteria andIdLessThanOrEqualToColumn(SyServiceConfig.Column column) { | |
250 | + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); | |
251 | + return (Criteria) this; | |
252 | + } | |
253 | + | |
254 | + public Criteria andIdIn(List<Integer> values) { | |
255 | + addCriterion("id in", values, "id"); | |
256 | + return (Criteria) this; | |
257 | + } | |
258 | + | |
259 | + public Criteria andIdNotIn(List<Integer> values) { | |
260 | + addCriterion("id not in", values, "id"); | |
261 | + return (Criteria) this; | |
262 | + } | |
263 | + | |
264 | + public Criteria andIdBetween(Integer value1, Integer value2) { | |
265 | + addCriterion("id between", value1, value2, "id"); | |
266 | + return (Criteria) this; | |
267 | + } | |
268 | + | |
269 | + public Criteria andIdNotBetween(Integer value1, Integer value2) { | |
270 | + addCriterion("id not between", value1, value2, "id"); | |
271 | + return (Criteria) this; | |
272 | + } | |
273 | + | |
274 | + public Criteria andServiceNameIsNull() { | |
275 | + addCriterion("service_name is null"); | |
276 | + return (Criteria) this; | |
277 | + } | |
278 | + | |
279 | + public Criteria andServiceNameIsNotNull() { | |
280 | + addCriterion("service_name is not null"); | |
281 | + return (Criteria) this; | |
282 | + } | |
283 | + | |
284 | + public Criteria andServiceNameEqualTo(String value) { | |
285 | + addCriterion("service_name =", value, "serviceName"); | |
286 | + return (Criteria) this; | |
287 | + } | |
288 | + | |
289 | + public Criteria andServiceNameEqualToColumn(SyServiceConfig.Column column) { | |
290 | + addCriterion(new StringBuilder("service_name = ").append(column.getEscapedColumnName()).toString()); | |
291 | + return (Criteria) this; | |
292 | + } | |
293 | + | |
294 | + public Criteria andServiceNameNotEqualTo(String value) { | |
295 | + addCriterion("service_name <>", value, "serviceName"); | |
296 | + return (Criteria) this; | |
297 | + } | |
298 | + | |
299 | + public Criteria andServiceNameNotEqualToColumn(SyServiceConfig.Column column) { | |
300 | + addCriterion(new StringBuilder("service_name <> ").append(column.getEscapedColumnName()).toString()); | |
301 | + return (Criteria) this; | |
302 | + } | |
303 | + | |
304 | + public Criteria andServiceNameGreaterThan(String value) { | |
305 | + addCriterion("service_name >", value, "serviceName"); | |
306 | + return (Criteria) this; | |
307 | + } | |
308 | + | |
309 | + public Criteria andServiceNameGreaterThanColumn(SyServiceConfig.Column column) { | |
310 | + addCriterion(new StringBuilder("service_name > ").append(column.getEscapedColumnName()).toString()); | |
311 | + return (Criteria) this; | |
312 | + } | |
313 | + | |
314 | + public Criteria andServiceNameGreaterThanOrEqualTo(String value) { | |
315 | + addCriterion("service_name >=", value, "serviceName"); | |
316 | + return (Criteria) this; | |
317 | + } | |
318 | + | |
319 | + public Criteria andServiceNameGreaterThanOrEqualToColumn(SyServiceConfig.Column column) { | |
320 | + addCriterion(new StringBuilder("service_name >= ").append(column.getEscapedColumnName()).toString()); | |
321 | + return (Criteria) this; | |
322 | + } | |
323 | + | |
324 | + public Criteria andServiceNameLessThan(String value) { | |
325 | + addCriterion("service_name <", value, "serviceName"); | |
326 | + return (Criteria) this; | |
327 | + } | |
328 | + | |
329 | + public Criteria andServiceNameLessThanColumn(SyServiceConfig.Column column) { | |
330 | + addCriterion(new StringBuilder("service_name < ").append(column.getEscapedColumnName()).toString()); | |
331 | + return (Criteria) this; | |
332 | + } | |
333 | + | |
334 | + public Criteria andServiceNameLessThanOrEqualTo(String value) { | |
335 | + addCriterion("service_name <=", value, "serviceName"); | |
336 | + return (Criteria) this; | |
337 | + } | |
338 | + | |
339 | + public Criteria andServiceNameLessThanOrEqualToColumn(SyServiceConfig.Column column) { | |
340 | + addCriterion(new StringBuilder("service_name <= ").append(column.getEscapedColumnName()).toString()); | |
341 | + return (Criteria) this; | |
342 | + } | |
343 | + | |
344 | + public Criteria andServiceNameLike(String value) { | |
345 | + addCriterion("service_name like", value, "serviceName"); | |
346 | + return (Criteria) this; | |
347 | + } | |
348 | + | |
349 | + public Criteria andServiceNameNotLike(String value) { | |
350 | + addCriterion("service_name not like", value, "serviceName"); | |
351 | + return (Criteria) this; | |
352 | + } | |
353 | + | |
354 | + public Criteria andServiceNameIn(List<String> values) { | |
355 | + addCriterion("service_name in", values, "serviceName"); | |
356 | + return (Criteria) this; | |
357 | + } | |
358 | + | |
359 | + public Criteria andServiceNameNotIn(List<String> values) { | |
360 | + addCriterion("service_name not in", values, "serviceName"); | |
361 | + return (Criteria) this; | |
362 | + } | |
363 | + | |
364 | + public Criteria andServiceNameBetween(String value1, String value2) { | |
365 | + addCriterion("service_name between", value1, value2, "serviceName"); | |
366 | + return (Criteria) this; | |
367 | + } | |
368 | + | |
369 | + public Criteria andServiceNameNotBetween(String value1, String value2) { | |
370 | + addCriterion("service_name not between", value1, value2, "serviceName"); | |
371 | + return (Criteria) this; | |
372 | + } | |
373 | + | |
374 | + public Criteria andStatusIsNull() { | |
375 | + addCriterion("status is null"); | |
376 | + return (Criteria) this; | |
377 | + } | |
378 | + | |
379 | + public Criteria andStatusIsNotNull() { | |
380 | + addCriterion("status is not null"); | |
381 | + return (Criteria) this; | |
382 | + } | |
383 | + | |
384 | + public Criteria andStatusEqualTo(Integer value) { | |
385 | + addCriterion("status =", value, "status"); | |
386 | + return (Criteria) this; | |
387 | + } | |
388 | + | |
389 | + public Criteria andStatusEqualToColumn(SyServiceConfig.Column column) { | |
390 | + addCriterion(new StringBuilder("status = ").append(column.getEscapedColumnName()).toString()); | |
391 | + return (Criteria) this; | |
392 | + } | |
393 | + | |
394 | + public Criteria andStatusNotEqualTo(Integer value) { | |
395 | + addCriterion("status <>", value, "status"); | |
396 | + return (Criteria) this; | |
397 | + } | |
398 | + | |
399 | + public Criteria andStatusNotEqualToColumn(SyServiceConfig.Column column) { | |
400 | + addCriterion(new StringBuilder("status <> ").append(column.getEscapedColumnName()).toString()); | |
401 | + return (Criteria) this; | |
402 | + } | |
403 | + | |
404 | + public Criteria andStatusGreaterThan(Integer value) { | |
405 | + addCriterion("status >", value, "status"); | |
406 | + return (Criteria) this; | |
407 | + } | |
408 | + | |
409 | + public Criteria andStatusGreaterThanColumn(SyServiceConfig.Column column) { | |
410 | + addCriterion(new StringBuilder("status > ").append(column.getEscapedColumnName()).toString()); | |
411 | + return (Criteria) this; | |
412 | + } | |
413 | + | |
414 | + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { | |
415 | + addCriterion("status >=", value, "status"); | |
416 | + return (Criteria) this; | |
417 | + } | |
418 | + | |
419 | + public Criteria andStatusGreaterThanOrEqualToColumn(SyServiceConfig.Column column) { | |
420 | + addCriterion(new StringBuilder("status >= ").append(column.getEscapedColumnName()).toString()); | |
421 | + return (Criteria) this; | |
422 | + } | |
423 | + | |
424 | + public Criteria andStatusLessThan(Integer value) { | |
425 | + addCriterion("status <", value, "status"); | |
426 | + return (Criteria) this; | |
427 | + } | |
428 | + | |
429 | + public Criteria andStatusLessThanColumn(SyServiceConfig.Column column) { | |
430 | + addCriterion(new StringBuilder("status < ").append(column.getEscapedColumnName()).toString()); | |
431 | + return (Criteria) this; | |
432 | + } | |
433 | + | |
434 | + public Criteria andStatusLessThanOrEqualTo(Integer value) { | |
435 | + addCriterion("status <=", value, "status"); | |
436 | + return (Criteria) this; | |
437 | + } | |
438 | + | |
439 | + public Criteria andStatusLessThanOrEqualToColumn(SyServiceConfig.Column column) { | |
440 | + addCriterion(new StringBuilder("status <= ").append(column.getEscapedColumnName()).toString()); | |
441 | + return (Criteria) this; | |
442 | + } | |
443 | + | |
444 | + public Criteria andStatusIn(List<Integer> values) { | |
445 | + addCriterion("status in", values, "status"); | |
446 | + return (Criteria) this; | |
447 | + } | |
448 | + | |
449 | + public Criteria andStatusNotIn(List<Integer> values) { | |
450 | + addCriterion("status not in", values, "status"); | |
451 | + return (Criteria) this; | |
452 | + } | |
453 | + | |
454 | + public Criteria andStatusBetween(Integer value1, Integer value2) { | |
455 | + addCriterion("status between", value1, value2, "status"); | |
456 | + return (Criteria) this; | |
457 | + } | |
458 | + | |
459 | + public Criteria andStatusNotBetween(Integer value1, Integer value2) { | |
460 | + addCriterion("status not between", value1, value2, "status"); | |
461 | + return (Criteria) this; | |
462 | + } | |
463 | + | |
464 | + public Criteria andCreateTimeIsNull() { | |
465 | + addCriterion("create_time is null"); | |
466 | + return (Criteria) this; | |
467 | + } | |
468 | + | |
469 | + public Criteria andCreateTimeIsNotNull() { | |
470 | + addCriterion("create_time is not null"); | |
471 | + return (Criteria) this; | |
472 | + } | |
473 | + | |
474 | + public Criteria andCreateTimeEqualTo(Long value) { | |
475 | + addCriterion("create_time =", value, "createTime"); | |
476 | + return (Criteria) this; | |
477 | + } | |
478 | + | |
479 | + public Criteria andCreateTimeEqualToColumn(SyServiceConfig.Column column) { | |
480 | + addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString()); | |
481 | + return (Criteria) this; | |
482 | + } | |
483 | + | |
484 | + public Criteria andCreateTimeNotEqualTo(Long value) { | |
485 | + addCriterion("create_time <>", value, "createTime"); | |
486 | + return (Criteria) this; | |
487 | + } | |
488 | + | |
489 | + public Criteria andCreateTimeNotEqualToColumn(SyServiceConfig.Column column) { | |
490 | + addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString()); | |
491 | + return (Criteria) this; | |
492 | + } | |
493 | + | |
494 | + public Criteria andCreateTimeGreaterThan(Long value) { | |
495 | + addCriterion("create_time >", value, "createTime"); | |
496 | + return (Criteria) this; | |
497 | + } | |
498 | + | |
499 | + public Criteria andCreateTimeGreaterThanColumn(SyServiceConfig.Column column) { | |
500 | + addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString()); | |
501 | + return (Criteria) this; | |
502 | + } | |
503 | + | |
504 | + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { | |
505 | + addCriterion("create_time >=", value, "createTime"); | |
506 | + return (Criteria) this; | |
507 | + } | |
508 | + | |
509 | + public Criteria andCreateTimeGreaterThanOrEqualToColumn(SyServiceConfig.Column column) { | |
510 | + addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString()); | |
511 | + return (Criteria) this; | |
512 | + } | |
513 | + | |
514 | + public Criteria andCreateTimeLessThan(Long value) { | |
515 | + addCriterion("create_time <", value, "createTime"); | |
516 | + return (Criteria) this; | |
517 | + } | |
518 | + | |
519 | + public Criteria andCreateTimeLessThanColumn(SyServiceConfig.Column column) { | |
520 | + addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString()); | |
521 | + return (Criteria) this; | |
522 | + } | |
523 | + | |
524 | + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { | |
525 | + addCriterion("create_time <=", value, "createTime"); | |
526 | + return (Criteria) this; | |
527 | + } | |
528 | + | |
529 | + public Criteria andCreateTimeLessThanOrEqualToColumn(SyServiceConfig.Column column) { | |
530 | + addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString()); | |
531 | + return (Criteria) this; | |
532 | + } | |
533 | + | |
534 | + public Criteria andCreateTimeIn(List<Long> values) { | |
535 | + addCriterion("create_time in", values, "createTime"); | |
536 | + return (Criteria) this; | |
537 | + } | |
538 | + | |
539 | + public Criteria andCreateTimeNotIn(List<Long> values) { | |
540 | + addCriterion("create_time not in", values, "createTime"); | |
541 | + return (Criteria) this; | |
542 | + } | |
543 | + | |
544 | + public Criteria andCreateTimeBetween(Long value1, Long value2) { | |
545 | + addCriterion("create_time between", value1, value2, "createTime"); | |
546 | + return (Criteria) this; | |
547 | + } | |
548 | + | |
549 | + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { | |
550 | + addCriterion("create_time not between", value1, value2, "createTime"); | |
551 | + return (Criteria) this; | |
552 | + } | |
553 | + | |
554 | + public Criteria andUpdateTimeIsNull() { | |
555 | + addCriterion("update_time is null"); | |
556 | + return (Criteria) this; | |
557 | + } | |
558 | + | |
559 | + public Criteria andUpdateTimeIsNotNull() { | |
560 | + addCriterion("update_time is not null"); | |
561 | + return (Criteria) this; | |
562 | + } | |
563 | + | |
564 | + public Criteria andUpdateTimeEqualTo(Long value) { | |
565 | + addCriterion("update_time =", value, "updateTime"); | |
566 | + return (Criteria) this; | |
567 | + } | |
568 | + | |
569 | + public Criteria andUpdateTimeEqualToColumn(SyServiceConfig.Column column) { | |
570 | + addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString()); | |
571 | + return (Criteria) this; | |
572 | + } | |
573 | + | |
574 | + public Criteria andUpdateTimeNotEqualTo(Long value) { | |
575 | + addCriterion("update_time <>", value, "updateTime"); | |
576 | + return (Criteria) this; | |
577 | + } | |
578 | + | |
579 | + public Criteria andUpdateTimeNotEqualToColumn(SyServiceConfig.Column column) { | |
580 | + addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString()); | |
581 | + return (Criteria) this; | |
582 | + } | |
583 | + | |
584 | + public Criteria andUpdateTimeGreaterThan(Long value) { | |
585 | + addCriterion("update_time >", value, "updateTime"); | |
586 | + return (Criteria) this; | |
587 | + } | |
588 | + | |
589 | + public Criteria andUpdateTimeGreaterThanColumn(SyServiceConfig.Column column) { | |
590 | + addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString()); | |
591 | + return (Criteria) this; | |
592 | + } | |
593 | + | |
594 | + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { | |
595 | + addCriterion("update_time >=", value, "updateTime"); | |
596 | + return (Criteria) this; | |
597 | + } | |
598 | + | |
599 | + public Criteria andUpdateTimeGreaterThanOrEqualToColumn(SyServiceConfig.Column column) { | |
600 | + addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString()); | |
601 | + return (Criteria) this; | |
602 | + } | |
603 | + | |
604 | + public Criteria andUpdateTimeLessThan(Long value) { | |
605 | + addCriterion("update_time <", value, "updateTime"); | |
606 | + return (Criteria) this; | |
607 | + } | |
608 | + | |
609 | + public Criteria andUpdateTimeLessThanColumn(SyServiceConfig.Column column) { | |
610 | + addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString()); | |
611 | + return (Criteria) this; | |
612 | + } | |
613 | + | |
614 | + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { | |
615 | + addCriterion("update_time <=", value, "updateTime"); | |
616 | + return (Criteria) this; | |
617 | + } | |
618 | + | |
619 | + public Criteria andUpdateTimeLessThanOrEqualToColumn(SyServiceConfig.Column column) { | |
620 | + addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString()); | |
621 | + return (Criteria) this; | |
622 | + } | |
623 | + | |
624 | + public Criteria andUpdateTimeIn(List<Long> values) { | |
625 | + addCriterion("update_time in", values, "updateTime"); | |
626 | + return (Criteria) this; | |
627 | + } | |
628 | + | |
629 | + public Criteria andUpdateTimeNotIn(List<Long> values) { | |
630 | + addCriterion("update_time not in", values, "updateTime"); | |
631 | + return (Criteria) this; | |
632 | + } | |
633 | + | |
634 | + public Criteria andUpdateTimeBetween(Long value1, Long value2) { | |
635 | + addCriterion("update_time between", value1, value2, "updateTime"); | |
636 | + return (Criteria) this; | |
637 | + } | |
638 | + | |
639 | + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { | |
640 | + addCriterion("update_time not between", value1, value2, "updateTime"); | |
641 | + return (Criteria) this; | |
642 | + } | |
643 | + } | |
644 | + | |
645 | + public static class Criteria extends GeneratedCriteria { | |
646 | + private SyServiceConfigExample example; | |
647 | + | |
648 | + protected Criteria(SyServiceConfigExample example) { | |
649 | + super(); | |
650 | + this.example = example; | |
651 | + } | |
652 | + | |
653 | + public SyServiceConfigExample example() { | |
654 | + return this.example; | |
655 | + } | |
656 | + | |
657 | + @Deprecated | |
658 | + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { | |
659 | + if (ifAdd) { | |
660 | + add.add(this); | |
661 | + } | |
662 | + return this; | |
663 | + } | |
664 | + | |
665 | + public Criteria when(boolean condition, ICriteriaWhen then) { | |
666 | + if (condition) { | |
667 | + then.criteria(this); | |
668 | + } | |
669 | + return this; | |
670 | + } | |
671 | + | |
672 | + public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) { | |
673 | + if (condition) { | |
674 | + then.criteria(this); | |
675 | + } else { | |
676 | + otherwise.criteria(this); | |
677 | + } | |
678 | + return this; | |
679 | + } | |
680 | + | |
681 | + @Deprecated | |
682 | + public interface ICriteriaAdd { | |
683 | + Criteria add(Criteria add); | |
684 | + } | |
685 | + } | |
686 | + | |
687 | + public static class Criterion { | |
688 | + private String condition; | |
689 | + | |
690 | + private Object value; | |
691 | + | |
692 | + private Object secondValue; | |
693 | + | |
694 | + private boolean noValue; | |
695 | + | |
696 | + private boolean singleValue; | |
697 | + | |
698 | + private boolean betweenValue; | |
699 | + | |
700 | + private boolean listValue; | |
701 | + | |
702 | + private String typeHandler; | |
703 | + | |
704 | + public String getCondition() { | |
705 | + return condition; | |
706 | + } | |
707 | + | |
708 | + public Object getValue() { | |
709 | + return value; | |
710 | + } | |
711 | + | |
712 | + public Object getSecondValue() { | |
713 | + return secondValue; | |
714 | + } | |
715 | + | |
716 | + public boolean isNoValue() { | |
717 | + return noValue; | |
718 | + } | |
719 | + | |
720 | + public boolean isSingleValue() { | |
721 | + return singleValue; | |
722 | + } | |
723 | + | |
724 | + public boolean isBetweenValue() { | |
725 | + return betweenValue; | |
726 | + } | |
727 | + | |
728 | + public boolean isListValue() { | |
729 | + return listValue; | |
730 | + } | |
731 | + | |
732 | + public String getTypeHandler() { | |
733 | + return typeHandler; | |
734 | + } | |
735 | + | |
736 | + protected Criterion(String condition) { | |
737 | + super(); | |
738 | + this.condition = condition; | |
739 | + this.typeHandler = null; | |
740 | + this.noValue = true; | |
741 | + } | |
742 | + | |
743 | + protected Criterion(String condition, Object value, String typeHandler) { | |
744 | + super(); | |
745 | + this.condition = condition; | |
746 | + this.value = value; | |
747 | + this.typeHandler = typeHandler; | |
748 | + if (value instanceof List<?>) { | |
749 | + this.listValue = true; | |
750 | + } else { | |
751 | + this.singleValue = true; | |
752 | + } | |
753 | + } | |
754 | + | |
755 | + protected Criterion(String condition, Object value) { | |
756 | + this(condition, value, null); | |
757 | + } | |
758 | + | |
759 | + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { | |
760 | + super(); | |
761 | + this.condition = condition; | |
762 | + this.value = value; | |
763 | + this.secondValue = secondValue; | |
764 | + this.typeHandler = typeHandler; | |
765 | + this.betweenValue = true; | |
766 | + } | |
767 | + | |
768 | + protected Criterion(String condition, Object value, Object secondValue) { | |
769 | + this(condition, value, secondValue, null); | |
770 | + } | |
771 | + } | |
772 | + | |
773 | + public interface ICriteriaWhen { | |
774 | + void criteria(Criteria criteria); | |
775 | + } | |
776 | + | |
777 | + public interface IExampleWhen { | |
778 | + void example(com.objecteye.entity.SyServiceConfigExample example); | |
779 | + } | |
780 | +} | |
0 | 781 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/entity/SyServiceConfigItem.java
0 → 100644
1 | +package com.objecteye.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.ArrayList; | |
5 | +import java.util.Arrays; | |
6 | + | |
7 | +public class SyServiceConfigItem implements Serializable { | |
8 | + | |
9 | + private static final long serialVersionUID = 8096485962480204701L; | |
10 | + | |
11 | + private Integer id; | |
12 | + | |
13 | + private Integer configId; | |
14 | + | |
15 | + private String itemName; | |
16 | + | |
17 | + private String itemValue; | |
18 | + | |
19 | + private Integer sort; | |
20 | + | |
21 | + public Integer getId() { | |
22 | + return id; | |
23 | + } | |
24 | + | |
25 | + public void setId(Integer id) { | |
26 | + this.id = id; | |
27 | + } | |
28 | + | |
29 | + public Integer getConfigId() { | |
30 | + return configId; | |
31 | + } | |
32 | + | |
33 | + public void setConfigId(Integer configId) { | |
34 | + this.configId = configId; | |
35 | + } | |
36 | + | |
37 | + public String getItemName() { | |
38 | + return itemName; | |
39 | + } | |
40 | + | |
41 | + public void setItemName(String itemName) { | |
42 | + this.itemName = itemName; | |
43 | + } | |
44 | + | |
45 | + public String getItemValue() { | |
46 | + return itemValue; | |
47 | + } | |
48 | + | |
49 | + public void setItemValue(String itemValue) { | |
50 | + this.itemValue = itemValue; | |
51 | + } | |
52 | + | |
53 | + public Integer getSort() { | |
54 | + return sort; | |
55 | + } | |
56 | + | |
57 | + public void setSort(Integer sort) { | |
58 | + this.sort = sort; | |
59 | + } | |
60 | + | |
61 | + public static SyServiceConfigItem.Builder builder() { | |
62 | + return new SyServiceConfigItem.Builder(); | |
63 | + } | |
64 | + | |
65 | + public static class Builder { | |
66 | + private SyServiceConfigItem obj; | |
67 | + | |
68 | + public Builder() { | |
69 | + this.obj = new SyServiceConfigItem(); | |
70 | + } | |
71 | + | |
72 | + public Builder id(Integer id) { | |
73 | + obj.setId(id); | |
74 | + return this; | |
75 | + } | |
76 | + | |
77 | + public Builder configId(Integer configId) { | |
78 | + obj.setConfigId(configId); | |
79 | + return this; | |
80 | + } | |
81 | + | |
82 | + public Builder itemName(String itemName) { | |
83 | + obj.setItemName(itemName); | |
84 | + return this; | |
85 | + } | |
86 | + | |
87 | + public Builder itemValue(String itemValue) { | |
88 | + obj.setItemValue(itemValue); | |
89 | + return this; | |
90 | + } | |
91 | + | |
92 | + public Builder sort(Integer sort) { | |
93 | + obj.setSort(sort); | |
94 | + return this; | |
95 | + } | |
96 | + | |
97 | + public SyServiceConfigItem build() { | |
98 | + return this.obj; | |
99 | + } | |
100 | + } | |
101 | + | |
102 | + public enum Column { | |
103 | + id("id", "id", "INTEGER", false), | |
104 | + configId("config_id", "configId", "INTEGER", false), | |
105 | + itemName("item_name", "itemName", "VARCHAR", false), | |
106 | + itemValue("item_value", "itemValue", "VARCHAR", false), | |
107 | + sort("sort", "sort", "INTEGER", false); | |
108 | + | |
109 | + private static final String BEGINNING_DELIMITER = "\""; | |
110 | + | |
111 | + private static final String ENDING_DELIMITER = "\""; | |
112 | + | |
113 | + private final String column; | |
114 | + | |
115 | + private final boolean isColumnNameDelimited; | |
116 | + | |
117 | + private final String javaProperty; | |
118 | + | |
119 | + private final String jdbcType; | |
120 | + | |
121 | + public String value() { | |
122 | + return this.column; | |
123 | + } | |
124 | + | |
125 | + public String getValue() { | |
126 | + return this.column; | |
127 | + } | |
128 | + | |
129 | + public String getJavaProperty() { | |
130 | + return this.javaProperty; | |
131 | + } | |
132 | + | |
133 | + public String getJdbcType() { | |
134 | + return this.jdbcType; | |
135 | + } | |
136 | + | |
137 | + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { | |
138 | + this.column = column; | |
139 | + this.javaProperty = javaProperty; | |
140 | + this.jdbcType = jdbcType; | |
141 | + this.isColumnNameDelimited = isColumnNameDelimited; | |
142 | + } | |
143 | + | |
144 | + public String desc() { | |
145 | + return this.getEscapedColumnName() + " DESC"; | |
146 | + } | |
147 | + | |
148 | + public String asc() { | |
149 | + return this.getEscapedColumnName() + " ASC"; | |
150 | + } | |
151 | + | |
152 | + public static Column[] excludes(Column... excludes) { | |
153 | + ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values())); | |
154 | + if (excludes != null && excludes.length > 0) { | |
155 | + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); | |
156 | + } | |
157 | + return columns.toArray(new Column[]{}); | |
158 | + } | |
159 | + | |
160 | + public static Column[] all() { | |
161 | + return Column.values(); | |
162 | + } | |
163 | + | |
164 | + public String getEscapedColumnName() { | |
165 | + if (this.isColumnNameDelimited) { | |
166 | + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); | |
167 | + } else { | |
168 | + return this.column; | |
169 | + } | |
170 | + } | |
171 | + | |
172 | + public String getAliasedEscapedColumnName() { | |
173 | + return this.getEscapedColumnName(); | |
174 | + } | |
175 | + } | |
176 | +} | |
0 | 177 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/entity/SyServiceConfigItemExample.java
0 → 100644
1 | +package com.objecteye.entity; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.List; | |
5 | + | |
6 | +public class SyServiceConfigItemExample { | |
7 | + protected String orderByClause; | |
8 | + | |
9 | + protected boolean distinct; | |
10 | + | |
11 | + protected List<Criteria> oredCriteria; | |
12 | + | |
13 | + protected Integer offset; | |
14 | + | |
15 | + protected Integer rows; | |
16 | + | |
17 | + public SyServiceConfigItemExample() { | |
18 | + oredCriteria = new ArrayList<Criteria>(); | |
19 | + } | |
20 | + | |
21 | + public void setOrderByClause(String orderByClause) { | |
22 | + this.orderByClause = orderByClause; | |
23 | + } | |
24 | + | |
25 | + public String getOrderByClause() { | |
26 | + return orderByClause; | |
27 | + } | |
28 | + | |
29 | + public void setDistinct(boolean distinct) { | |
30 | + this.distinct = distinct; | |
31 | + } | |
32 | + | |
33 | + public boolean isDistinct() { | |
34 | + return distinct; | |
35 | + } | |
36 | + | |
37 | + public List<Criteria> getOredCriteria() { | |
38 | + return oredCriteria; | |
39 | + } | |
40 | + | |
41 | + public void or(Criteria criteria) { | |
42 | + oredCriteria.add(criteria); | |
43 | + } | |
44 | + | |
45 | + public Criteria or() { | |
46 | + Criteria criteria = createCriteriaInternal(); | |
47 | + oredCriteria.add(criteria); | |
48 | + return criteria; | |
49 | + } | |
50 | + | |
51 | + public SyServiceConfigItemExample orderBy(String orderByClause) { | |
52 | + this.setOrderByClause(orderByClause); | |
53 | + return this; | |
54 | + } | |
55 | + | |
56 | + public SyServiceConfigItemExample orderBy(String... orderByClauses) { | |
57 | + StringBuffer sb = new StringBuffer(); | |
58 | + for (int i = 0; i < orderByClauses.length; i++) { | |
59 | + sb.append(orderByClauses[i]); | |
60 | + if (i < orderByClauses.length - 1) { | |
61 | + sb.append(" , "); | |
62 | + } | |
63 | + } | |
64 | + this.setOrderByClause(sb.toString()); | |
65 | + return this; | |
66 | + } | |
67 | + | |
68 | + public Criteria createCriteria() { | |
69 | + Criteria criteria = createCriteriaInternal(); | |
70 | + if (oredCriteria.size() == 0) { | |
71 | + oredCriteria.add(criteria); | |
72 | + } | |
73 | + return criteria; | |
74 | + } | |
75 | + | |
76 | + protected Criteria createCriteriaInternal() { | |
77 | + Criteria criteria = new Criteria(this); | |
78 | + return criteria; | |
79 | + } | |
80 | + | |
81 | + public void clear() { | |
82 | + oredCriteria.clear(); | |
83 | + orderByClause = null; | |
84 | + distinct = false; | |
85 | + rows = null; | |
86 | + offset = null; | |
87 | + } | |
88 | + | |
89 | + public void setOffset(Integer offset) { | |
90 | + this.offset = offset; | |
91 | + } | |
92 | + | |
93 | + public Integer getOffset() { | |
94 | + return this.offset; | |
95 | + } | |
96 | + | |
97 | + public void setRows(Integer rows) { | |
98 | + this.rows = rows; | |
99 | + } | |
100 | + | |
101 | + public Integer getRows() { | |
102 | + return this.rows; | |
103 | + } | |
104 | + | |
105 | + public SyServiceConfigItemExample limit(Integer rows) { | |
106 | + this.rows = rows; | |
107 | + return this; | |
108 | + } | |
109 | + | |
110 | + public SyServiceConfigItemExample limit(Integer offset, Integer rows) { | |
111 | + this.offset = offset; | |
112 | + this.rows = rows; | |
113 | + return this; | |
114 | + } | |
115 | + | |
116 | + public SyServiceConfigItemExample page(Integer page, Integer pageSize) { | |
117 | + this.offset = (page - 1) * pageSize; | |
118 | + this.rows = pageSize; | |
119 | + return this; | |
120 | + } | |
121 | + | |
122 | + public static Criteria newAndCreateCriteria() { | |
123 | + SyServiceConfigItemExample example = new SyServiceConfigItemExample(); | |
124 | + return example.createCriteria(); | |
125 | + } | |
126 | + | |
127 | + public SyServiceConfigItemExample when(boolean condition, IExampleWhen then) { | |
128 | + if (condition) { | |
129 | + then.example(this); | |
130 | + } | |
131 | + return this; | |
132 | + } | |
133 | + | |
134 | + public SyServiceConfigItemExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) { | |
135 | + if (condition) { | |
136 | + then.example(this); | |
137 | + } else { | |
138 | + otherwise.example(this); | |
139 | + } | |
140 | + return this; | |
141 | + } | |
142 | + | |
143 | + protected abstract static class GeneratedCriteria { | |
144 | + protected List<Criterion> criteria; | |
145 | + | |
146 | + protected GeneratedCriteria() { | |
147 | + super(); | |
148 | + criteria = new ArrayList<Criterion>(); | |
149 | + } | |
150 | + | |
151 | + public boolean isValid() { | |
152 | + return criteria.size() > 0; | |
153 | + } | |
154 | + | |
155 | + public List<Criterion> getAllCriteria() { | |
156 | + return criteria; | |
157 | + } | |
158 | + | |
159 | + public List<Criterion> getCriteria() { | |
160 | + return criteria; | |
161 | + } | |
162 | + | |
163 | + protected void addCriterion(String condition) { | |
164 | + if (condition == null) { | |
165 | + throw new RuntimeException("Value for condition cannot be null"); | |
166 | + } | |
167 | + criteria.add(new Criterion(condition)); | |
168 | + } | |
169 | + | |
170 | + protected void addCriterion(String condition, Object value, String property) { | |
171 | + if (value == null) { | |
172 | + throw new RuntimeException("Value for " + property + " cannot be null"); | |
173 | + } | |
174 | + criteria.add(new Criterion(condition, value)); | |
175 | + } | |
176 | + | |
177 | + protected void addCriterion(String condition, Object value1, Object value2, String property) { | |
178 | + if (value1 == null || value2 == null) { | |
179 | + throw new RuntimeException("Between values for " + property + " cannot be null"); | |
180 | + } | |
181 | + criteria.add(new Criterion(condition, value1, value2)); | |
182 | + } | |
183 | + | |
184 | + public Criteria andIdIsNull() { | |
185 | + addCriterion("id is null"); | |
186 | + return (Criteria) this; | |
187 | + } | |
188 | + | |
189 | + public Criteria andIdIsNotNull() { | |
190 | + addCriterion("id is not null"); | |
191 | + return (Criteria) this; | |
192 | + } | |
193 | + | |
194 | + public Criteria andIdEqualTo(Integer value) { | |
195 | + addCriterion("id =", value, "id"); | |
196 | + return (Criteria) this; | |
197 | + } | |
198 | + | |
199 | + public Criteria andIdEqualToColumn(SyServiceConfigItem.Column column) { | |
200 | + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); | |
201 | + return (Criteria) this; | |
202 | + } | |
203 | + | |
204 | + public Criteria andIdNotEqualTo(Integer value) { | |
205 | + addCriterion("id <>", value, "id"); | |
206 | + return (Criteria) this; | |
207 | + } | |
208 | + | |
209 | + public Criteria andIdNotEqualToColumn(SyServiceConfigItem.Column column) { | |
210 | + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); | |
211 | + return (Criteria) this; | |
212 | + } | |
213 | + | |
214 | + public Criteria andIdGreaterThan(Integer value) { | |
215 | + addCriterion("id >", value, "id"); | |
216 | + return (Criteria) this; | |
217 | + } | |
218 | + | |
219 | + public Criteria andIdGreaterThanColumn(SyServiceConfigItem.Column column) { | |
220 | + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); | |
221 | + return (Criteria) this; | |
222 | + } | |
223 | + | |
224 | + public Criteria andIdGreaterThanOrEqualTo(Integer value) { | |
225 | + addCriterion("id >=", value, "id"); | |
226 | + return (Criteria) this; | |
227 | + } | |
228 | + | |
229 | + public Criteria andIdGreaterThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
230 | + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); | |
231 | + return (Criteria) this; | |
232 | + } | |
233 | + | |
234 | + public Criteria andIdLessThan(Integer value) { | |
235 | + addCriterion("id <", value, "id"); | |
236 | + return (Criteria) this; | |
237 | + } | |
238 | + | |
239 | + public Criteria andIdLessThanColumn(SyServiceConfigItem.Column column) { | |
240 | + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); | |
241 | + return (Criteria) this; | |
242 | + } | |
243 | + | |
244 | + public Criteria andIdLessThanOrEqualTo(Integer value) { | |
245 | + addCriterion("id <=", value, "id"); | |
246 | + return (Criteria) this; | |
247 | + } | |
248 | + | |
249 | + public Criteria andIdLessThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
250 | + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); | |
251 | + return (Criteria) this; | |
252 | + } | |
253 | + | |
254 | + public Criteria andIdIn(List<Integer> values) { | |
255 | + addCriterion("id in", values, "id"); | |
256 | + return (Criteria) this; | |
257 | + } | |
258 | + | |
259 | + public Criteria andIdNotIn(List<Integer> values) { | |
260 | + addCriterion("id not in", values, "id"); | |
261 | + return (Criteria) this; | |
262 | + } | |
263 | + | |
264 | + public Criteria andIdBetween(Integer value1, Integer value2) { | |
265 | + addCriterion("id between", value1, value2, "id"); | |
266 | + return (Criteria) this; | |
267 | + } | |
268 | + | |
269 | + public Criteria andIdNotBetween(Integer value1, Integer value2) { | |
270 | + addCriterion("id not between", value1, value2, "id"); | |
271 | + return (Criteria) this; | |
272 | + } | |
273 | + | |
274 | + public Criteria andConfigIdIsNull() { | |
275 | + addCriterion("config_id is null"); | |
276 | + return (Criteria) this; | |
277 | + } | |
278 | + | |
279 | + public Criteria andConfigIdIsNotNull() { | |
280 | + addCriterion("config_id is not null"); | |
281 | + return (Criteria) this; | |
282 | + } | |
283 | + | |
284 | + public Criteria andConfigIdEqualTo(Integer value) { | |
285 | + addCriterion("config_id =", value, "configId"); | |
286 | + return (Criteria) this; | |
287 | + } | |
288 | + | |
289 | + public Criteria andConfigIdEqualToColumn(SyServiceConfigItem.Column column) { | |
290 | + addCriterion(new StringBuilder("config_id = ").append(column.getEscapedColumnName()).toString()); | |
291 | + return (Criteria) this; | |
292 | + } | |
293 | + | |
294 | + public Criteria andConfigIdNotEqualTo(Integer value) { | |
295 | + addCriterion("config_id <>", value, "configId"); | |
296 | + return (Criteria) this; | |
297 | + } | |
298 | + | |
299 | + public Criteria andConfigIdNotEqualToColumn(SyServiceConfigItem.Column column) { | |
300 | + addCriterion(new StringBuilder("config_id <> ").append(column.getEscapedColumnName()).toString()); | |
301 | + return (Criteria) this; | |
302 | + } | |
303 | + | |
304 | + public Criteria andConfigIdGreaterThan(Integer value) { | |
305 | + addCriterion("config_id >", value, "configId"); | |
306 | + return (Criteria) this; | |
307 | + } | |
308 | + | |
309 | + public Criteria andConfigIdGreaterThanColumn(SyServiceConfigItem.Column column) { | |
310 | + addCriterion(new StringBuilder("config_id > ").append(column.getEscapedColumnName()).toString()); | |
311 | + return (Criteria) this; | |
312 | + } | |
313 | + | |
314 | + public Criteria andConfigIdGreaterThanOrEqualTo(Integer value) { | |
315 | + addCriterion("config_id >=", value, "configId"); | |
316 | + return (Criteria) this; | |
317 | + } | |
318 | + | |
319 | + public Criteria andConfigIdGreaterThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
320 | + addCriterion(new StringBuilder("config_id >= ").append(column.getEscapedColumnName()).toString()); | |
321 | + return (Criteria) this; | |
322 | + } | |
323 | + | |
324 | + public Criteria andConfigIdLessThan(Integer value) { | |
325 | + addCriterion("config_id <", value, "configId"); | |
326 | + return (Criteria) this; | |
327 | + } | |
328 | + | |
329 | + public Criteria andConfigIdLessThanColumn(SyServiceConfigItem.Column column) { | |
330 | + addCriterion(new StringBuilder("config_id < ").append(column.getEscapedColumnName()).toString()); | |
331 | + return (Criteria) this; | |
332 | + } | |
333 | + | |
334 | + public Criteria andConfigIdLessThanOrEqualTo(Integer value) { | |
335 | + addCriterion("config_id <=", value, "configId"); | |
336 | + return (Criteria) this; | |
337 | + } | |
338 | + | |
339 | + public Criteria andConfigIdLessThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
340 | + addCriterion(new StringBuilder("config_id <= ").append(column.getEscapedColumnName()).toString()); | |
341 | + return (Criteria) this; | |
342 | + } | |
343 | + | |
344 | + public Criteria andConfigIdIn(List<Integer> values) { | |
345 | + addCriterion("config_id in", values, "configId"); | |
346 | + return (Criteria) this; | |
347 | + } | |
348 | + | |
349 | + public Criteria andConfigIdNotIn(List<Integer> values) { | |
350 | + addCriterion("config_id not in", values, "configId"); | |
351 | + return (Criteria) this; | |
352 | + } | |
353 | + | |
354 | + public Criteria andConfigIdBetween(Integer value1, Integer value2) { | |
355 | + addCriterion("config_id between", value1, value2, "configId"); | |
356 | + return (Criteria) this; | |
357 | + } | |
358 | + | |
359 | + public Criteria andConfigIdNotBetween(Integer value1, Integer value2) { | |
360 | + addCriterion("config_id not between", value1, value2, "configId"); | |
361 | + return (Criteria) this; | |
362 | + } | |
363 | + | |
364 | + public Criteria andItemNameIsNull() { | |
365 | + addCriterion("item_name is null"); | |
366 | + return (Criteria) this; | |
367 | + } | |
368 | + | |
369 | + public Criteria andItemNameIsNotNull() { | |
370 | + addCriterion("item_name is not null"); | |
371 | + return (Criteria) this; | |
372 | + } | |
373 | + | |
374 | + public Criteria andItemNameEqualTo(String value) { | |
375 | + addCriterion("item_name =", value, "itemName"); | |
376 | + return (Criteria) this; | |
377 | + } | |
378 | + | |
379 | + public Criteria andItemNameEqualToColumn(SyServiceConfigItem.Column column) { | |
380 | + addCriterion(new StringBuilder("item_name = ").append(column.getEscapedColumnName()).toString()); | |
381 | + return (Criteria) this; | |
382 | + } | |
383 | + | |
384 | + public Criteria andItemNameNotEqualTo(String value) { | |
385 | + addCriterion("item_name <>", value, "itemName"); | |
386 | + return (Criteria) this; | |
387 | + } | |
388 | + | |
389 | + public Criteria andItemNameNotEqualToColumn(SyServiceConfigItem.Column column) { | |
390 | + addCriterion(new StringBuilder("item_name <> ").append(column.getEscapedColumnName()).toString()); | |
391 | + return (Criteria) this; | |
392 | + } | |
393 | + | |
394 | + public Criteria andItemNameGreaterThan(String value) { | |
395 | + addCriterion("item_name >", value, "itemName"); | |
396 | + return (Criteria) this; | |
397 | + } | |
398 | + | |
399 | + public Criteria andItemNameGreaterThanColumn(SyServiceConfigItem.Column column) { | |
400 | + addCriterion(new StringBuilder("item_name > ").append(column.getEscapedColumnName()).toString()); | |
401 | + return (Criteria) this; | |
402 | + } | |
403 | + | |
404 | + public Criteria andItemNameGreaterThanOrEqualTo(String value) { | |
405 | + addCriterion("item_name >=", value, "itemName"); | |
406 | + return (Criteria) this; | |
407 | + } | |
408 | + | |
409 | + public Criteria andItemNameGreaterThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
410 | + addCriterion(new StringBuilder("item_name >= ").append(column.getEscapedColumnName()).toString()); | |
411 | + return (Criteria) this; | |
412 | + } | |
413 | + | |
414 | + public Criteria andItemNameLessThan(String value) { | |
415 | + addCriterion("item_name <", value, "itemName"); | |
416 | + return (Criteria) this; | |
417 | + } | |
418 | + | |
419 | + public Criteria andItemNameLessThanColumn(SyServiceConfigItem.Column column) { | |
420 | + addCriterion(new StringBuilder("item_name < ").append(column.getEscapedColumnName()).toString()); | |
421 | + return (Criteria) this; | |
422 | + } | |
423 | + | |
424 | + public Criteria andItemNameLessThanOrEqualTo(String value) { | |
425 | + addCriterion("item_name <=", value, "itemName"); | |
426 | + return (Criteria) this; | |
427 | + } | |
428 | + | |
429 | + public Criteria andItemNameLessThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
430 | + addCriterion(new StringBuilder("item_name <= ").append(column.getEscapedColumnName()).toString()); | |
431 | + return (Criteria) this; | |
432 | + } | |
433 | + | |
434 | + public Criteria andItemNameLike(String value) { | |
435 | + addCriterion("item_name like", value, "itemName"); | |
436 | + return (Criteria) this; | |
437 | + } | |
438 | + | |
439 | + public Criteria andItemNameNotLike(String value) { | |
440 | + addCriterion("item_name not like", value, "itemName"); | |
441 | + return (Criteria) this; | |
442 | + } | |
443 | + | |
444 | + public Criteria andItemNameIn(List<String> values) { | |
445 | + addCriterion("item_name in", values, "itemName"); | |
446 | + return (Criteria) this; | |
447 | + } | |
448 | + | |
449 | + public Criteria andItemNameNotIn(List<String> values) { | |
450 | + addCriterion("item_name not in", values, "itemName"); | |
451 | + return (Criteria) this; | |
452 | + } | |
453 | + | |
454 | + public Criteria andItemNameBetween(String value1, String value2) { | |
455 | + addCriterion("item_name between", value1, value2, "itemName"); | |
456 | + return (Criteria) this; | |
457 | + } | |
458 | + | |
459 | + public Criteria andItemNameNotBetween(String value1, String value2) { | |
460 | + addCriterion("item_name not between", value1, value2, "itemName"); | |
461 | + return (Criteria) this; | |
462 | + } | |
463 | + | |
464 | + public Criteria andItemValueIsNull() { | |
465 | + addCriterion("item_value is null"); | |
466 | + return (Criteria) this; | |
467 | + } | |
468 | + | |
469 | + public Criteria andItemValueIsNotNull() { | |
470 | + addCriterion("item_value is not null"); | |
471 | + return (Criteria) this; | |
472 | + } | |
473 | + | |
474 | + public Criteria andItemValueEqualTo(String value) { | |
475 | + addCriterion("item_value =", value, "itemValue"); | |
476 | + return (Criteria) this; | |
477 | + } | |
478 | + | |
479 | + public Criteria andItemValueEqualToColumn(SyServiceConfigItem.Column column) { | |
480 | + addCriterion(new StringBuilder("item_value = ").append(column.getEscapedColumnName()).toString()); | |
481 | + return (Criteria) this; | |
482 | + } | |
483 | + | |
484 | + public Criteria andItemValueNotEqualTo(String value) { | |
485 | + addCriterion("item_value <>", value, "itemValue"); | |
486 | + return (Criteria) this; | |
487 | + } | |
488 | + | |
489 | + public Criteria andItemValueNotEqualToColumn(SyServiceConfigItem.Column column) { | |
490 | + addCriterion(new StringBuilder("item_value <> ").append(column.getEscapedColumnName()).toString()); | |
491 | + return (Criteria) this; | |
492 | + } | |
493 | + | |
494 | + public Criteria andItemValueGreaterThan(String value) { | |
495 | + addCriterion("item_value >", value, "itemValue"); | |
496 | + return (Criteria) this; | |
497 | + } | |
498 | + | |
499 | + public Criteria andItemValueGreaterThanColumn(SyServiceConfigItem.Column column) { | |
500 | + addCriterion(new StringBuilder("item_value > ").append(column.getEscapedColumnName()).toString()); | |
501 | + return (Criteria) this; | |
502 | + } | |
503 | + | |
504 | + public Criteria andItemValueGreaterThanOrEqualTo(String value) { | |
505 | + addCriterion("item_value >=", value, "itemValue"); | |
506 | + return (Criteria) this; | |
507 | + } | |
508 | + | |
509 | + public Criteria andItemValueGreaterThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
510 | + addCriterion(new StringBuilder("item_value >= ").append(column.getEscapedColumnName()).toString()); | |
511 | + return (Criteria) this; | |
512 | + } | |
513 | + | |
514 | + public Criteria andItemValueLessThan(String value) { | |
515 | + addCriterion("item_value <", value, "itemValue"); | |
516 | + return (Criteria) this; | |
517 | + } | |
518 | + | |
519 | + public Criteria andItemValueLessThanColumn(SyServiceConfigItem.Column column) { | |
520 | + addCriterion(new StringBuilder("item_value < ").append(column.getEscapedColumnName()).toString()); | |
521 | + return (Criteria) this; | |
522 | + } | |
523 | + | |
524 | + public Criteria andItemValueLessThanOrEqualTo(String value) { | |
525 | + addCriterion("item_value <=", value, "itemValue"); | |
526 | + return (Criteria) this; | |
527 | + } | |
528 | + | |
529 | + public Criteria andItemValueLessThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
530 | + addCriterion(new StringBuilder("item_value <= ").append(column.getEscapedColumnName()).toString()); | |
531 | + return (Criteria) this; | |
532 | + } | |
533 | + | |
534 | + public Criteria andItemValueLike(String value) { | |
535 | + addCriterion("item_value like", value, "itemValue"); | |
536 | + return (Criteria) this; | |
537 | + } | |
538 | + | |
539 | + public Criteria andItemValueNotLike(String value) { | |
540 | + addCriterion("item_value not like", value, "itemValue"); | |
541 | + return (Criteria) this; | |
542 | + } | |
543 | + | |
544 | + public Criteria andItemValueIn(List<String> values) { | |
545 | + addCriterion("item_value in", values, "itemValue"); | |
546 | + return (Criteria) this; | |
547 | + } | |
548 | + | |
549 | + public Criteria andItemValueNotIn(List<String> values) { | |
550 | + addCriterion("item_value not in", values, "itemValue"); | |
551 | + return (Criteria) this; | |
552 | + } | |
553 | + | |
554 | + public Criteria andItemValueBetween(String value1, String value2) { | |
555 | + addCriterion("item_value between", value1, value2, "itemValue"); | |
556 | + return (Criteria) this; | |
557 | + } | |
558 | + | |
559 | + public Criteria andItemValueNotBetween(String value1, String value2) { | |
560 | + addCriterion("item_value not between", value1, value2, "itemValue"); | |
561 | + return (Criteria) this; | |
562 | + } | |
563 | + | |
564 | + public Criteria andSortIsNull() { | |
565 | + addCriterion("sort is null"); | |
566 | + return (Criteria) this; | |
567 | + } | |
568 | + | |
569 | + public Criteria andSortIsNotNull() { | |
570 | + addCriterion("sort is not null"); | |
571 | + return (Criteria) this; | |
572 | + } | |
573 | + | |
574 | + public Criteria andSortEqualTo(Integer value) { | |
575 | + addCriterion("sort =", value, "sort"); | |
576 | + return (Criteria) this; | |
577 | + } | |
578 | + | |
579 | + public Criteria andSortEqualToColumn(SyServiceConfigItem.Column column) { | |
580 | + addCriterion(new StringBuilder("sort = ").append(column.getEscapedColumnName()).toString()); | |
581 | + return (Criteria) this; | |
582 | + } | |
583 | + | |
584 | + public Criteria andSortNotEqualTo(Integer value) { | |
585 | + addCriterion("sort <>", value, "sort"); | |
586 | + return (Criteria) this; | |
587 | + } | |
588 | + | |
589 | + public Criteria andSortNotEqualToColumn(SyServiceConfigItem.Column column) { | |
590 | + addCriterion(new StringBuilder("sort <> ").append(column.getEscapedColumnName()).toString()); | |
591 | + return (Criteria) this; | |
592 | + } | |
593 | + | |
594 | + public Criteria andSortGreaterThan(Integer value) { | |
595 | + addCriterion("sort >", value, "sort"); | |
596 | + return (Criteria) this; | |
597 | + } | |
598 | + | |
599 | + public Criteria andSortGreaterThanColumn(SyServiceConfigItem.Column column) { | |
600 | + addCriterion(new StringBuilder("sort > ").append(column.getEscapedColumnName()).toString()); | |
601 | + return (Criteria) this; | |
602 | + } | |
603 | + | |
604 | + public Criteria andSortGreaterThanOrEqualTo(Integer value) { | |
605 | + addCriterion("sort >=", value, "sort"); | |
606 | + return (Criteria) this; | |
607 | + } | |
608 | + | |
609 | + public Criteria andSortGreaterThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
610 | + addCriterion(new StringBuilder("sort >= ").append(column.getEscapedColumnName()).toString()); | |
611 | + return (Criteria) this; | |
612 | + } | |
613 | + | |
614 | + public Criteria andSortLessThan(Integer value) { | |
615 | + addCriterion("sort <", value, "sort"); | |
616 | + return (Criteria) this; | |
617 | + } | |
618 | + | |
619 | + public Criteria andSortLessThanColumn(SyServiceConfigItem.Column column) { | |
620 | + addCriterion(new StringBuilder("sort < ").append(column.getEscapedColumnName()).toString()); | |
621 | + return (Criteria) this; | |
622 | + } | |
623 | + | |
624 | + public Criteria andSortLessThanOrEqualTo(Integer value) { | |
625 | + addCriterion("sort <=", value, "sort"); | |
626 | + return (Criteria) this; | |
627 | + } | |
628 | + | |
629 | + public Criteria andSortLessThanOrEqualToColumn(SyServiceConfigItem.Column column) { | |
630 | + addCriterion(new StringBuilder("sort <= ").append(column.getEscapedColumnName()).toString()); | |
631 | + return (Criteria) this; | |
632 | + } | |
633 | + | |
634 | + public Criteria andSortIn(List<Integer> values) { | |
635 | + addCriterion("sort in", values, "sort"); | |
636 | + return (Criteria) this; | |
637 | + } | |
638 | + | |
639 | + public Criteria andSortNotIn(List<Integer> values) { | |
640 | + addCriterion("sort not in", values, "sort"); | |
641 | + return (Criteria) this; | |
642 | + } | |
643 | + | |
644 | + public Criteria andSortBetween(Integer value1, Integer value2) { | |
645 | + addCriterion("sort between", value1, value2, "sort"); | |
646 | + return (Criteria) this; | |
647 | + } | |
648 | + | |
649 | + public Criteria andSortNotBetween(Integer value1, Integer value2) { | |
650 | + addCriterion("sort not between", value1, value2, "sort"); | |
651 | + return (Criteria) this; | |
652 | + } | |
653 | + } | |
654 | + | |
655 | + public static class Criteria extends GeneratedCriteria { | |
656 | + private SyServiceConfigItemExample example; | |
657 | + | |
658 | + protected Criteria(SyServiceConfigItemExample example) { | |
659 | + super(); | |
660 | + this.example = example; | |
661 | + } | |
662 | + | |
663 | + public SyServiceConfigItemExample example() { | |
664 | + return this.example; | |
665 | + } | |
666 | + | |
667 | + @Deprecated | |
668 | + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { | |
669 | + if (ifAdd) { | |
670 | + add.add(this); | |
671 | + } | |
672 | + return this; | |
673 | + } | |
674 | + | |
675 | + public Criteria when(boolean condition, ICriteriaWhen then) { | |
676 | + if (condition) { | |
677 | + then.criteria(this); | |
678 | + } | |
679 | + return this; | |
680 | + } | |
681 | + | |
682 | + public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) { | |
683 | + if (condition) { | |
684 | + then.criteria(this); | |
685 | + } else { | |
686 | + otherwise.criteria(this); | |
687 | + } | |
688 | + return this; | |
689 | + } | |
690 | + | |
691 | + @Deprecated | |
692 | + public interface ICriteriaAdd { | |
693 | + Criteria add(Criteria add); | |
694 | + } | |
695 | + } | |
696 | + | |
697 | + public static class Criterion { | |
698 | + private String condition; | |
699 | + | |
700 | + private Object value; | |
701 | + | |
702 | + private Object secondValue; | |
703 | + | |
704 | + private boolean noValue; | |
705 | + | |
706 | + private boolean singleValue; | |
707 | + | |
708 | + private boolean betweenValue; | |
709 | + | |
710 | + private boolean listValue; | |
711 | + | |
712 | + private String typeHandler; | |
713 | + | |
714 | + public String getCondition() { | |
715 | + return condition; | |
716 | + } | |
717 | + | |
718 | + public Object getValue() { | |
719 | + return value; | |
720 | + } | |
721 | + | |
722 | + public Object getSecondValue() { | |
723 | + return secondValue; | |
724 | + } | |
725 | + | |
726 | + public boolean isNoValue() { | |
727 | + return noValue; | |
728 | + } | |
729 | + | |
730 | + public boolean isSingleValue() { | |
731 | + return singleValue; | |
732 | + } | |
733 | + | |
734 | + public boolean isBetweenValue() { | |
735 | + return betweenValue; | |
736 | + } | |
737 | + | |
738 | + public boolean isListValue() { | |
739 | + return listValue; | |
740 | + } | |
741 | + | |
742 | + public String getTypeHandler() { | |
743 | + return typeHandler; | |
744 | + } | |
745 | + | |
746 | + protected Criterion(String condition) { | |
747 | + super(); | |
748 | + this.condition = condition; | |
749 | + this.typeHandler = null; | |
750 | + this.noValue = true; | |
751 | + } | |
752 | + | |
753 | + protected Criterion(String condition, Object value, String typeHandler) { | |
754 | + super(); | |
755 | + this.condition = condition; | |
756 | + this.value = value; | |
757 | + this.typeHandler = typeHandler; | |
758 | + if (value instanceof List<?>) { | |
759 | + this.listValue = true; | |
760 | + } else { | |
761 | + this.singleValue = true; | |
762 | + } | |
763 | + } | |
764 | + | |
765 | + protected Criterion(String condition, Object value) { | |
766 | + this(condition, value, null); | |
767 | + } | |
768 | + | |
769 | + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { | |
770 | + super(); | |
771 | + this.condition = condition; | |
772 | + this.value = value; | |
773 | + this.secondValue = secondValue; | |
774 | + this.typeHandler = typeHandler; | |
775 | + this.betweenValue = true; | |
776 | + } | |
777 | + | |
778 | + protected Criterion(String condition, Object value, Object secondValue) { | |
779 | + this(condition, value, secondValue, null); | |
780 | + } | |
781 | + } | |
782 | + | |
783 | + public interface ICriteriaWhen { | |
784 | + void criteria(Criteria criteria); | |
785 | + } | |
786 | + | |
787 | + public interface IExampleWhen { | |
788 | + void example(com.objecteye.entity.SyServiceConfigItemExample example); | |
789 | + } | |
790 | +} | |
0 | 791 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/entity/SyUser.java
0 → 100644
1 | +package com.objecteye.entity; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.ArrayList; | |
5 | +import java.util.Arrays; | |
6 | + | |
7 | +public class SyUser implements Serializable { | |
8 | + | |
9 | + private static final long serialVersionUID = 8187391691743163276L; | |
10 | + | |
11 | + private Integer id; | |
12 | + | |
13 | + private String username; | |
14 | + | |
15 | + private String password; | |
16 | + | |
17 | + public Integer getId() { | |
18 | + return id; | |
19 | + } | |
20 | + | |
21 | + public void setId(Integer id) { | |
22 | + this.id = id; | |
23 | + } | |
24 | + | |
25 | + public String getUsername() { | |
26 | + return username; | |
27 | + } | |
28 | + | |
29 | + public void setUsername(String username) { | |
30 | + this.username = username; | |
31 | + } | |
32 | + | |
33 | + public String getPassword() { | |
34 | + return password; | |
35 | + } | |
36 | + | |
37 | + public void setPassword(String password) { | |
38 | + this.password = password; | |
39 | + } | |
40 | + | |
41 | + public static SyUser.Builder builder() { | |
42 | + return new SyUser.Builder(); | |
43 | + } | |
44 | + | |
45 | + public static class Builder { | |
46 | + private SyUser obj; | |
47 | + | |
48 | + public Builder() { | |
49 | + this.obj = new SyUser(); | |
50 | + } | |
51 | + | |
52 | + public Builder id(Integer id) { | |
53 | + obj.setId(id); | |
54 | + return this; | |
55 | + } | |
56 | + | |
57 | + public Builder username(String username) { | |
58 | + obj.setUsername(username); | |
59 | + return this; | |
60 | + } | |
61 | + | |
62 | + public Builder password(String password) { | |
63 | + obj.setPassword(password); | |
64 | + return this; | |
65 | + } | |
66 | + | |
67 | + public SyUser build() { | |
68 | + return this.obj; | |
69 | + } | |
70 | + } | |
71 | + | |
72 | + public enum Column { | |
73 | + id("id", "id", "INTEGER", false), | |
74 | + username("username", "username", "VARCHAR", false), | |
75 | + password("password", "password", "VARCHAR", false); | |
76 | + | |
77 | + private static final String BEGINNING_DELIMITER = "\""; | |
78 | + | |
79 | + private static final String ENDING_DELIMITER = "\""; | |
80 | + | |
81 | + private final String column; | |
82 | + | |
83 | + private final boolean isColumnNameDelimited; | |
84 | + | |
85 | + private final String javaProperty; | |
86 | + | |
87 | + private final String jdbcType; | |
88 | + | |
89 | + public String value() { | |
90 | + return this.column; | |
91 | + } | |
92 | + | |
93 | + public String getValue() { | |
94 | + return this.column; | |
95 | + } | |
96 | + | |
97 | + public String getJavaProperty() { | |
98 | + return this.javaProperty; | |
99 | + } | |
100 | + | |
101 | + public String getJdbcType() { | |
102 | + return this.jdbcType; | |
103 | + } | |
104 | + | |
105 | + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { | |
106 | + this.column = column; | |
107 | + this.javaProperty = javaProperty; | |
108 | + this.jdbcType = jdbcType; | |
109 | + this.isColumnNameDelimited = isColumnNameDelimited; | |
110 | + } | |
111 | + | |
112 | + public String desc() { | |
113 | + return this.getEscapedColumnName() + " DESC"; | |
114 | + } | |
115 | + | |
116 | + public String asc() { | |
117 | + return this.getEscapedColumnName() + " ASC"; | |
118 | + } | |
119 | + | |
120 | + public static Column[] excludes(Column... excludes) { | |
121 | + ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values())); | |
122 | + if (excludes != null && excludes.length > 0) { | |
123 | + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); | |
124 | + } | |
125 | + return columns.toArray(new Column[]{}); | |
126 | + } | |
127 | + | |
128 | + public static Column[] all() { | |
129 | + return Column.values(); | |
130 | + } | |
131 | + | |
132 | + public String getEscapedColumnName() { | |
133 | + if (this.isColumnNameDelimited) { | |
134 | + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); | |
135 | + } else { | |
136 | + return this.column; | |
137 | + } | |
138 | + } | |
139 | + | |
140 | + public String getAliasedEscapedColumnName() { | |
141 | + return this.getEscapedColumnName(); | |
142 | + } | |
143 | + } | |
144 | +} | |
0 | 145 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/entity/SyUserExample.java
0 → 100644
1 | +package com.objecteye.entity; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.List; | |
5 | + | |
6 | +public class SyUserExample { | |
7 | + protected String orderByClause; | |
8 | + | |
9 | + protected boolean distinct; | |
10 | + | |
11 | + protected List<Criteria> oredCriteria; | |
12 | + | |
13 | + protected Integer offset; | |
14 | + | |
15 | + protected Integer rows; | |
16 | + | |
17 | + public SyUserExample() { | |
18 | + oredCriteria = new ArrayList<Criteria>(); | |
19 | + } | |
20 | + | |
21 | + public void setOrderByClause(String orderByClause) { | |
22 | + this.orderByClause = orderByClause; | |
23 | + } | |
24 | + | |
25 | + public String getOrderByClause() { | |
26 | + return orderByClause; | |
27 | + } | |
28 | + | |
29 | + public void setDistinct(boolean distinct) { | |
30 | + this.distinct = distinct; | |
31 | + } | |
32 | + | |
33 | + public boolean isDistinct() { | |
34 | + return distinct; | |
35 | + } | |
36 | + | |
37 | + public List<Criteria> getOredCriteria() { | |
38 | + return oredCriteria; | |
39 | + } | |
40 | + | |
41 | + public void or(Criteria criteria) { | |
42 | + oredCriteria.add(criteria); | |
43 | + } | |
44 | + | |
45 | + public Criteria or() { | |
46 | + Criteria criteria = createCriteriaInternal(); | |
47 | + oredCriteria.add(criteria); | |
48 | + return criteria; | |
49 | + } | |
50 | + | |
51 | + public SyUserExample orderBy(String orderByClause) { | |
52 | + this.setOrderByClause(orderByClause); | |
53 | + return this; | |
54 | + } | |
55 | + | |
56 | + public SyUserExample orderBy(String... orderByClauses) { | |
57 | + StringBuffer sb = new StringBuffer(); | |
58 | + for (int i = 0; i < orderByClauses.length; i++) { | |
59 | + sb.append(orderByClauses[i]); | |
60 | + if (i < orderByClauses.length - 1) { | |
61 | + sb.append(" , "); | |
62 | + } | |
63 | + } | |
64 | + this.setOrderByClause(sb.toString()); | |
65 | + return this; | |
66 | + } | |
67 | + | |
68 | + public Criteria createCriteria() { | |
69 | + Criteria criteria = createCriteriaInternal(); | |
70 | + if (oredCriteria.size() == 0) { | |
71 | + oredCriteria.add(criteria); | |
72 | + } | |
73 | + return criteria; | |
74 | + } | |
75 | + | |
76 | + protected Criteria createCriteriaInternal() { | |
77 | + Criteria criteria = new Criteria(this); | |
78 | + return criteria; | |
79 | + } | |
80 | + | |
81 | + public void clear() { | |
82 | + oredCriteria.clear(); | |
83 | + orderByClause = null; | |
84 | + distinct = false; | |
85 | + rows = null; | |
86 | + offset = null; | |
87 | + } | |
88 | + | |
89 | + public void setOffset(Integer offset) { | |
90 | + this.offset = offset; | |
91 | + } | |
92 | + | |
93 | + public Integer getOffset() { | |
94 | + return this.offset; | |
95 | + } | |
96 | + | |
97 | + public void setRows(Integer rows) { | |
98 | + this.rows = rows; | |
99 | + } | |
100 | + | |
101 | + public Integer getRows() { | |
102 | + return this.rows; | |
103 | + } | |
104 | + | |
105 | + public SyUserExample limit(Integer rows) { | |
106 | + this.rows = rows; | |
107 | + return this; | |
108 | + } | |
109 | + | |
110 | + public SyUserExample limit(Integer offset, Integer rows) { | |
111 | + this.offset = offset; | |
112 | + this.rows = rows; | |
113 | + return this; | |
114 | + } | |
115 | + | |
116 | + public SyUserExample page(Integer page, Integer pageSize) { | |
117 | + this.offset = (page - 1) * pageSize; | |
118 | + this.rows = pageSize; | |
119 | + return this; | |
120 | + } | |
121 | + | |
122 | + public static Criteria newAndCreateCriteria() { | |
123 | + SyUserExample example = new SyUserExample(); | |
124 | + return example.createCriteria(); | |
125 | + } | |
126 | + | |
127 | + public SyUserExample when(boolean condition, IExampleWhen then) { | |
128 | + if (condition) { | |
129 | + then.example(this); | |
130 | + } | |
131 | + return this; | |
132 | + } | |
133 | + | |
134 | + public SyUserExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) { | |
135 | + if (condition) { | |
136 | + then.example(this); | |
137 | + } else { | |
138 | + otherwise.example(this); | |
139 | + } | |
140 | + return this; | |
141 | + } | |
142 | + | |
143 | + protected abstract static class GeneratedCriteria { | |
144 | + protected List<Criterion> criteria; | |
145 | + | |
146 | + protected GeneratedCriteria() { | |
147 | + super(); | |
148 | + criteria = new ArrayList<Criterion>(); | |
149 | + } | |
150 | + | |
151 | + public boolean isValid() { | |
152 | + return criteria.size() > 0; | |
153 | + } | |
154 | + | |
155 | + public List<Criterion> getAllCriteria() { | |
156 | + return criteria; | |
157 | + } | |
158 | + | |
159 | + public List<Criterion> getCriteria() { | |
160 | + return criteria; | |
161 | + } | |
162 | + | |
163 | + protected void addCriterion(String condition) { | |
164 | + if (condition == null) { | |
165 | + throw new RuntimeException("Value for condition cannot be null"); | |
166 | + } | |
167 | + criteria.add(new Criterion(condition)); | |
168 | + } | |
169 | + | |
170 | + protected void addCriterion(String condition, Object value, String property) { | |
171 | + if (value == null) { | |
172 | + throw new RuntimeException("Value for " + property + " cannot be null"); | |
173 | + } | |
174 | + criteria.add(new Criterion(condition, value)); | |
175 | + } | |
176 | + | |
177 | + protected void addCriterion(String condition, Object value1, Object value2, String property) { | |
178 | + if (value1 == null || value2 == null) { | |
179 | + throw new RuntimeException("Between values for " + property + " cannot be null"); | |
180 | + } | |
181 | + criteria.add(new Criterion(condition, value1, value2)); | |
182 | + } | |
183 | + | |
184 | + public Criteria andIdIsNull() { | |
185 | + addCriterion("id is null"); | |
186 | + return (Criteria) this; | |
187 | + } | |
188 | + | |
189 | + public Criteria andIdIsNotNull() { | |
190 | + addCriterion("id is not null"); | |
191 | + return (Criteria) this; | |
192 | + } | |
193 | + | |
194 | + public Criteria andIdEqualTo(Integer value) { | |
195 | + addCriterion("id =", value, "id"); | |
196 | + return (Criteria) this; | |
197 | + } | |
198 | + | |
199 | + public Criteria andIdEqualToColumn(SyUser.Column column) { | |
200 | + addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString()); | |
201 | + return (Criteria) this; | |
202 | + } | |
203 | + | |
204 | + public Criteria andIdNotEqualTo(Integer value) { | |
205 | + addCriterion("id <>", value, "id"); | |
206 | + return (Criteria) this; | |
207 | + } | |
208 | + | |
209 | + public Criteria andIdNotEqualToColumn(SyUser.Column column) { | |
210 | + addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString()); | |
211 | + return (Criteria) this; | |
212 | + } | |
213 | + | |
214 | + public Criteria andIdGreaterThan(Integer value) { | |
215 | + addCriterion("id >", value, "id"); | |
216 | + return (Criteria) this; | |
217 | + } | |
218 | + | |
219 | + public Criteria andIdGreaterThanColumn(SyUser.Column column) { | |
220 | + addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString()); | |
221 | + return (Criteria) this; | |
222 | + } | |
223 | + | |
224 | + public Criteria andIdGreaterThanOrEqualTo(Integer value) { | |
225 | + addCriterion("id >=", value, "id"); | |
226 | + return (Criteria) this; | |
227 | + } | |
228 | + | |
229 | + public Criteria andIdGreaterThanOrEqualToColumn(SyUser.Column column) { | |
230 | + addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString()); | |
231 | + return (Criteria) this; | |
232 | + } | |
233 | + | |
234 | + public Criteria andIdLessThan(Integer value) { | |
235 | + addCriterion("id <", value, "id"); | |
236 | + return (Criteria) this; | |
237 | + } | |
238 | + | |
239 | + public Criteria andIdLessThanColumn(SyUser.Column column) { | |
240 | + addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString()); | |
241 | + return (Criteria) this; | |
242 | + } | |
243 | + | |
244 | + public Criteria andIdLessThanOrEqualTo(Integer value) { | |
245 | + addCriterion("id <=", value, "id"); | |
246 | + return (Criteria) this; | |
247 | + } | |
248 | + | |
249 | + public Criteria andIdLessThanOrEqualToColumn(SyUser.Column column) { | |
250 | + addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString()); | |
251 | + return (Criteria) this; | |
252 | + } | |
253 | + | |
254 | + public Criteria andIdIn(List<Integer> values) { | |
255 | + addCriterion("id in", values, "id"); | |
256 | + return (Criteria) this; | |
257 | + } | |
258 | + | |
259 | + public Criteria andIdNotIn(List<Integer> values) { | |
260 | + addCriterion("id not in", values, "id"); | |
261 | + return (Criteria) this; | |
262 | + } | |
263 | + | |
264 | + public Criteria andIdBetween(Integer value1, Integer value2) { | |
265 | + addCriterion("id between", value1, value2, "id"); | |
266 | + return (Criteria) this; | |
267 | + } | |
268 | + | |
269 | + public Criteria andIdNotBetween(Integer value1, Integer value2) { | |
270 | + addCriterion("id not between", value1, value2, "id"); | |
271 | + return (Criteria) this; | |
272 | + } | |
273 | + | |
274 | + public Criteria andUsernameIsNull() { | |
275 | + addCriterion("username is null"); | |
276 | + return (Criteria) this; | |
277 | + } | |
278 | + | |
279 | + public Criteria andUsernameIsNotNull() { | |
280 | + addCriterion("username is not null"); | |
281 | + return (Criteria) this; | |
282 | + } | |
283 | + | |
284 | + public Criteria andUsernameEqualTo(String value) { | |
285 | + addCriterion("username =", value, "username"); | |
286 | + return (Criteria) this; | |
287 | + } | |
288 | + | |
289 | + public Criteria andUsernameEqualToColumn(SyUser.Column column) { | |
290 | + addCriterion(new StringBuilder("username = ").append(column.getEscapedColumnName()).toString()); | |
291 | + return (Criteria) this; | |
292 | + } | |
293 | + | |
294 | + public Criteria andUsernameNotEqualTo(String value) { | |
295 | + addCriterion("username <>", value, "username"); | |
296 | + return (Criteria) this; | |
297 | + } | |
298 | + | |
299 | + public Criteria andUsernameNotEqualToColumn(SyUser.Column column) { | |
300 | + addCriterion(new StringBuilder("username <> ").append(column.getEscapedColumnName()).toString()); | |
301 | + return (Criteria) this; | |
302 | + } | |
303 | + | |
304 | + public Criteria andUsernameGreaterThan(String value) { | |
305 | + addCriterion("username >", value, "username"); | |
306 | + return (Criteria) this; | |
307 | + } | |
308 | + | |
309 | + public Criteria andUsernameGreaterThanColumn(SyUser.Column column) { | |
310 | + addCriterion(new StringBuilder("username > ").append(column.getEscapedColumnName()).toString()); | |
311 | + return (Criteria) this; | |
312 | + } | |
313 | + | |
314 | + public Criteria andUsernameGreaterThanOrEqualTo(String value) { | |
315 | + addCriterion("username >=", value, "username"); | |
316 | + return (Criteria) this; | |
317 | + } | |
318 | + | |
319 | + public Criteria andUsernameGreaterThanOrEqualToColumn(SyUser.Column column) { | |
320 | + addCriterion(new StringBuilder("username >= ").append(column.getEscapedColumnName()).toString()); | |
321 | + return (Criteria) this; | |
322 | + } | |
323 | + | |
324 | + public Criteria andUsernameLessThan(String value) { | |
325 | + addCriterion("username <", value, "username"); | |
326 | + return (Criteria) this; | |
327 | + } | |
328 | + | |
329 | + public Criteria andUsernameLessThanColumn(SyUser.Column column) { | |
330 | + addCriterion(new StringBuilder("username < ").append(column.getEscapedColumnName()).toString()); | |
331 | + return (Criteria) this; | |
332 | + } | |
333 | + | |
334 | + public Criteria andUsernameLessThanOrEqualTo(String value) { | |
335 | + addCriterion("username <=", value, "username"); | |
336 | + return (Criteria) this; | |
337 | + } | |
338 | + | |
339 | + public Criteria andUsernameLessThanOrEqualToColumn(SyUser.Column column) { | |
340 | + addCriterion(new StringBuilder("username <= ").append(column.getEscapedColumnName()).toString()); | |
341 | + return (Criteria) this; | |
342 | + } | |
343 | + | |
344 | + public Criteria andUsernameLike(String value) { | |
345 | + addCriterion("username like", value, "username"); | |
346 | + return (Criteria) this; | |
347 | + } | |
348 | + | |
349 | + public Criteria andUsernameNotLike(String value) { | |
350 | + addCriterion("username not like", value, "username"); | |
351 | + return (Criteria) this; | |
352 | + } | |
353 | + | |
354 | + public Criteria andUsernameIn(List<String> values) { | |
355 | + addCriterion("username in", values, "username"); | |
356 | + return (Criteria) this; | |
357 | + } | |
358 | + | |
359 | + public Criteria andUsernameNotIn(List<String> values) { | |
360 | + addCriterion("username not in", values, "username"); | |
361 | + return (Criteria) this; | |
362 | + } | |
363 | + | |
364 | + public Criteria andUsernameBetween(String value1, String value2) { | |
365 | + addCriterion("username between", value1, value2, "username"); | |
366 | + return (Criteria) this; | |
367 | + } | |
368 | + | |
369 | + public Criteria andUsernameNotBetween(String value1, String value2) { | |
370 | + addCriterion("username not between", value1, value2, "username"); | |
371 | + return (Criteria) this; | |
372 | + } | |
373 | + | |
374 | + public Criteria andPasswordIsNull() { | |
375 | + addCriterion("password is null"); | |
376 | + return (Criteria) this; | |
377 | + } | |
378 | + | |
379 | + public Criteria andPasswordIsNotNull() { | |
380 | + addCriterion("password is not null"); | |
381 | + return (Criteria) this; | |
382 | + } | |
383 | + | |
384 | + public Criteria andPasswordEqualTo(String value) { | |
385 | + addCriterion("password =", value, "password"); | |
386 | + return (Criteria) this; | |
387 | + } | |
388 | + | |
389 | + public Criteria andPasswordEqualToColumn(SyUser.Column column) { | |
390 | + addCriterion(new StringBuilder("password = ").append(column.getEscapedColumnName()).toString()); | |
391 | + return (Criteria) this; | |
392 | + } | |
393 | + | |
394 | + public Criteria andPasswordNotEqualTo(String value) { | |
395 | + addCriterion("password <>", value, "password"); | |
396 | + return (Criteria) this; | |
397 | + } | |
398 | + | |
399 | + public Criteria andPasswordNotEqualToColumn(SyUser.Column column) { | |
400 | + addCriterion(new StringBuilder("password <> ").append(column.getEscapedColumnName()).toString()); | |
401 | + return (Criteria) this; | |
402 | + } | |
403 | + | |
404 | + public Criteria andPasswordGreaterThan(String value) { | |
405 | + addCriterion("password >", value, "password"); | |
406 | + return (Criteria) this; | |
407 | + } | |
408 | + | |
409 | + public Criteria andPasswordGreaterThanColumn(SyUser.Column column) { | |
410 | + addCriterion(new StringBuilder("password > ").append(column.getEscapedColumnName()).toString()); | |
411 | + return (Criteria) this; | |
412 | + } | |
413 | + | |
414 | + public Criteria andPasswordGreaterThanOrEqualTo(String value) { | |
415 | + addCriterion("password >=", value, "password"); | |
416 | + return (Criteria) this; | |
417 | + } | |
418 | + | |
419 | + public Criteria andPasswordGreaterThanOrEqualToColumn(SyUser.Column column) { | |
420 | + addCriterion(new StringBuilder("password >= ").append(column.getEscapedColumnName()).toString()); | |
421 | + return (Criteria) this; | |
422 | + } | |
423 | + | |
424 | + public Criteria andPasswordLessThan(String value) { | |
425 | + addCriterion("password <", value, "password"); | |
426 | + return (Criteria) this; | |
427 | + } | |
428 | + | |
429 | + public Criteria andPasswordLessThanColumn(SyUser.Column column) { | |
430 | + addCriterion(new StringBuilder("password < ").append(column.getEscapedColumnName()).toString()); | |
431 | + return (Criteria) this; | |
432 | + } | |
433 | + | |
434 | + public Criteria andPasswordLessThanOrEqualTo(String value) { | |
435 | + addCriterion("password <=", value, "password"); | |
436 | + return (Criteria) this; | |
437 | + } | |
438 | + | |
439 | + public Criteria andPasswordLessThanOrEqualToColumn(SyUser.Column column) { | |
440 | + addCriterion(new StringBuilder("password <= ").append(column.getEscapedColumnName()).toString()); | |
441 | + return (Criteria) this; | |
442 | + } | |
443 | + | |
444 | + public Criteria andPasswordLike(String value) { | |
445 | + addCriterion("password like", value, "password"); | |
446 | + return (Criteria) this; | |
447 | + } | |
448 | + | |
449 | + public Criteria andPasswordNotLike(String value) { | |
450 | + addCriterion("password not like", value, "password"); | |
451 | + return (Criteria) this; | |
452 | + } | |
453 | + | |
454 | + public Criteria andPasswordIn(List<String> values) { | |
455 | + addCriterion("password in", values, "password"); | |
456 | + return (Criteria) this; | |
457 | + } | |
458 | + | |
459 | + public Criteria andPasswordNotIn(List<String> values) { | |
460 | + addCriterion("password not in", values, "password"); | |
461 | + return (Criteria) this; | |
462 | + } | |
463 | + | |
464 | + public Criteria andPasswordBetween(String value1, String value2) { | |
465 | + addCriterion("password between", value1, value2, "password"); | |
466 | + return (Criteria) this; | |
467 | + } | |
468 | + | |
469 | + public Criteria andPasswordNotBetween(String value1, String value2) { | |
470 | + addCriterion("password not between", value1, value2, "password"); | |
471 | + return (Criteria) this; | |
472 | + } | |
473 | + } | |
474 | + | |
475 | + public static class Criteria extends GeneratedCriteria { | |
476 | + private SyUserExample example; | |
477 | + | |
478 | + protected Criteria(SyUserExample example) { | |
479 | + super(); | |
480 | + this.example = example; | |
481 | + } | |
482 | + | |
483 | + public SyUserExample example() { | |
484 | + return this.example; | |
485 | + } | |
486 | + | |
487 | + @Deprecated | |
488 | + public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { | |
489 | + if (ifAdd) { | |
490 | + add.add(this); | |
491 | + } | |
492 | + return this; | |
493 | + } | |
494 | + | |
495 | + public Criteria when(boolean condition, ICriteriaWhen then) { | |
496 | + if (condition) { | |
497 | + then.criteria(this); | |
498 | + } | |
499 | + return this; | |
500 | + } | |
501 | + | |
502 | + public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) { | |
503 | + if (condition) { | |
504 | + then.criteria(this); | |
505 | + } else { | |
506 | + otherwise.criteria(this); | |
507 | + } | |
508 | + return this; | |
509 | + } | |
510 | + | |
511 | + @Deprecated | |
512 | + public interface ICriteriaAdd { | |
513 | + Criteria add(Criteria add); | |
514 | + } | |
515 | + } | |
516 | + | |
517 | + public static class Criterion { | |
518 | + private String condition; | |
519 | + | |
520 | + private Object value; | |
521 | + | |
522 | + private Object secondValue; | |
523 | + | |
524 | + private boolean noValue; | |
525 | + | |
526 | + private boolean singleValue; | |
527 | + | |
528 | + private boolean betweenValue; | |
529 | + | |
530 | + private boolean listValue; | |
531 | + | |
532 | + private String typeHandler; | |
533 | + | |
534 | + public String getCondition() { | |
535 | + return condition; | |
536 | + } | |
537 | + | |
538 | + public Object getValue() { | |
539 | + return value; | |
540 | + } | |
541 | + | |
542 | + public Object getSecondValue() { | |
543 | + return secondValue; | |
544 | + } | |
545 | + | |
546 | + public boolean isNoValue() { | |
547 | + return noValue; | |
548 | + } | |
549 | + | |
550 | + public boolean isSingleValue() { | |
551 | + return singleValue; | |
552 | + } | |
553 | + | |
554 | + public boolean isBetweenValue() { | |
555 | + return betweenValue; | |
556 | + } | |
557 | + | |
558 | + public boolean isListValue() { | |
559 | + return listValue; | |
560 | + } | |
561 | + | |
562 | + public String getTypeHandler() { | |
563 | + return typeHandler; | |
564 | + } | |
565 | + | |
566 | + protected Criterion(String condition) { | |
567 | + super(); | |
568 | + this.condition = condition; | |
569 | + this.typeHandler = null; | |
570 | + this.noValue = true; | |
571 | + } | |
572 | + | |
573 | + protected Criterion(String condition, Object value, String typeHandler) { | |
574 | + super(); | |
575 | + this.condition = condition; | |
576 | + this.value = value; | |
577 | + this.typeHandler = typeHandler; | |
578 | + if (value instanceof List<?>) { | |
579 | + this.listValue = true; | |
580 | + } else { | |
581 | + this.singleValue = true; | |
582 | + } | |
583 | + } | |
584 | + | |
585 | + protected Criterion(String condition, Object value) { | |
586 | + this(condition, value, null); | |
587 | + } | |
588 | + | |
589 | + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { | |
590 | + super(); | |
591 | + this.condition = condition; | |
592 | + this.value = value; | |
593 | + this.secondValue = secondValue; | |
594 | + this.typeHandler = typeHandler; | |
595 | + this.betweenValue = true; | |
596 | + } | |
597 | + | |
598 | + protected Criterion(String condition, Object value, Object secondValue) { | |
599 | + this(condition, value, secondValue, null); | |
600 | + } | |
601 | + } | |
602 | + | |
603 | + public interface ICriteriaWhen { | |
604 | + void criteria(Criteria criteria); | |
605 | + } | |
606 | + | |
607 | + public interface IExampleWhen { | |
608 | + void example(com.objecteye.entity.SyUserExample example); | |
609 | + } | |
610 | +} | |
0 | 611 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/mapper/SyServiceConfigItemMapper.java
0 → 100644
1 | +package com.objecteye.mapper; | |
2 | + | |
3 | +import com.objecteye.entity.SyServiceConfigItem; | |
4 | +import com.objecteye.entity.SyServiceConfigItemExample; | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +public interface SyServiceConfigItemMapper { | |
10 | + long countByExample(SyServiceConfigItemExample example); | |
11 | + | |
12 | + int deleteByExample(SyServiceConfigItemExample example); | |
13 | + | |
14 | + int deleteByPrimaryKey(Integer id); | |
15 | + | |
16 | + int insert(SyServiceConfigItem record); | |
17 | + | |
18 | + int insertSelective(SyServiceConfigItem record); | |
19 | + | |
20 | + SyServiceConfigItem selectOneByExample(SyServiceConfigItemExample example); | |
21 | + | |
22 | + List<SyServiceConfigItem> selectByExample(SyServiceConfigItemExample example); | |
23 | + | |
24 | + SyServiceConfigItem selectByPrimaryKey(Integer id); | |
25 | + | |
26 | + int updateByExampleSelective(@Param("record") SyServiceConfigItem record, @Param("example") SyServiceConfigItemExample example); | |
27 | + | |
28 | + int updateByExample(@Param("record") SyServiceConfigItem record, @Param("example") SyServiceConfigItemExample example); | |
29 | + | |
30 | + int updateByPrimaryKeySelective(SyServiceConfigItem record); | |
31 | + | |
32 | + int updateByPrimaryKey(SyServiceConfigItem record); | |
33 | +} | |
0 | 34 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/mapper/SyServiceConfigMapper.java
0 → 100644
1 | +package com.objecteye.mapper; | |
2 | + | |
3 | +import com.objecteye.entity.SyServiceConfig; | |
4 | +import com.objecteye.entity.SyServiceConfigExample; | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +public interface SyServiceConfigMapper { | |
10 | + long countByExample(SyServiceConfigExample example); | |
11 | + | |
12 | + int deleteByExample(SyServiceConfigExample example); | |
13 | + | |
14 | + int deleteByPrimaryKey(Integer id); | |
15 | + | |
16 | + int insert(SyServiceConfig record); | |
17 | + | |
18 | + int insertSelective(SyServiceConfig record); | |
19 | + | |
20 | + SyServiceConfig selectOneByExample(SyServiceConfigExample example); | |
21 | + | |
22 | + List<SyServiceConfig> selectByExample(SyServiceConfigExample example); | |
23 | + | |
24 | + SyServiceConfig selectByPrimaryKey(Integer id); | |
25 | + | |
26 | + int updateByExampleSelective(@Param("record") SyServiceConfig record, @Param("example") SyServiceConfigExample example); | |
27 | + | |
28 | + int updateByExample(@Param("record") SyServiceConfig record, @Param("example") SyServiceConfigExample example); | |
29 | + | |
30 | + int updateByPrimaryKeySelective(SyServiceConfig record); | |
31 | + | |
32 | + int updateByPrimaryKey(SyServiceConfig record); | |
33 | +} | |
0 | 34 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/mapper/SyUserMapper.java
0 → 100644
1 | +package com.objecteye.mapper; | |
2 | + | |
3 | +import com.objecteye.entity.SyUser; | |
4 | +import com.objecteye.entity.SyUserExample; | |
5 | +import org.apache.ibatis.annotations.Param; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +public interface SyUserMapper { | |
10 | + long countByExample(SyUserExample example); | |
11 | + | |
12 | + int deleteByExample(SyUserExample example); | |
13 | + | |
14 | + int deleteByPrimaryKey(Integer id); | |
15 | + | |
16 | + int insert(SyUser record); | |
17 | + | |
18 | + int insertSelective(SyUser record); | |
19 | + | |
20 | + SyUser selectOneByExample(SyUserExample example); | |
21 | + | |
22 | + List<SyUser> selectByExample(SyUserExample example); | |
23 | + | |
24 | + SyUser selectByPrimaryKey(Integer id); | |
25 | + | |
26 | + int updateByExampleSelective(@Param("record") SyUser record, @Param("example") SyUserExample example); | |
27 | + | |
28 | + int updateByExample(@Param("record") SyUser record, @Param("example") SyUserExample example); | |
29 | + | |
30 | + int updateByPrimaryKeySelective(SyUser record); | |
31 | + | |
32 | + int updateByPrimaryKey(SyUser record); | |
33 | +} | |
0 | 34 | \ No newline at end of file | ... | ... |
src/main/java/com/objecteye/service/IBackGroundService.java
1 | 1 | package com.objecteye.service; |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.JSONObject; |
4 | +import com.objecteye.common.PageResult; | |
4 | 5 | import com.objecteye.entity.SyBasicResourceHistory; |
5 | 6 | |
6 | 7 | import java.util.List; |
... | ... | @@ -56,4 +57,37 @@ public interface IBackGroundService { |
56 | 57 | * @return 结果集 |
57 | 58 | */ |
58 | 59 | JSONObject sdkController(Map<String, Object> requestMap); |
60 | + | |
61 | + /** | |
62 | + * 配置启动服务 | |
63 | + * | |
64 | + * @param requestObj 启动服务参数 | |
65 | + * @return 结果集 | |
66 | + */ | |
67 | + JSONObject createServiceConfig(JSONObject requestObj); | |
68 | + | |
69 | + /** | |
70 | + * 配置启动服务 | |
71 | + * | |
72 | + * @param requestObj 启动服务参数 | |
73 | + * @return 结果集 | |
74 | + */ | |
75 | + JSONObject updateServiceConfig(JSONObject requestObj); | |
76 | + | |
77 | + /** | |
78 | + * 配置启动服务 | |
79 | + * | |
80 | + * @param id 启动服务参数 | |
81 | + * @return 结果集 | |
82 | + */ | |
83 | + JSONObject deleteServiceConfig(Integer id); | |
84 | + | |
85 | + /** | |
86 | + * 查询配置好的服务运行情况 | |
87 | + * | |
88 | + * @param currentPage 页码 | |
89 | + * @param pageVolume 页面容量 | |
90 | + * @return 结果集 | |
91 | + */ | |
92 | + PageResult serviceQuery(Integer currentPage, Integer pageVolume); | |
59 | 93 | } | ... | ... |
src/main/java/com/objecteye/service/ILogFileListenerService.java
... | ... | @@ -3,6 +3,7 @@ package com.objecteye.service; |
3 | 3 | import com.alibaba.fastjson.JSONArray; |
4 | 4 | import com.alibaba.fastjson.JSONObject; |
5 | 5 | |
6 | +import javax.servlet.http.HttpServletResponse; | |
6 | 7 | import java.io.IOException; |
7 | 8 | import java.util.Map; |
8 | 9 | |
... | ... | @@ -44,4 +45,13 @@ public interface ILogFileListenerService { |
44 | 45 | * @return 输出内容 |
45 | 46 | */ |
46 | 47 | JSONArray getAllListeningLog(); |
48 | + | |
49 | + /** | |
50 | + * 下载logKey对应的日志文件 | |
51 | + * | |
52 | + * @param httpServletResponse http返回信息 | |
53 | + * @param logKey 日志key | |
54 | + * @return 操作状态 | |
55 | + */ | |
56 | + JSONObject downloadLogFile(HttpServletResponse httpServletResponse, String logKey); | |
47 | 57 | } | ... | ... |
src/main/java/com/objecteye/service/IUserService.java
0 → 100644
1 | +package com.objecteye.service; | |
2 | + | |
3 | +import com.alibaba.fastjson.JSONObject; | |
4 | +import com.objecteye.common.PageResult; | |
5 | +import com.objecteye.entity.SyUser; | |
6 | + | |
7 | +public interface IUserService { | |
8 | + | |
9 | + /** | |
10 | + * 登录 | |
11 | + * | |
12 | + * @param username 用户名 | |
13 | + * @param password 密码 | |
14 | + * @return | |
15 | + */ | |
16 | + JSONObject login(String username, String password); | |
17 | + | |
18 | + /** | |
19 | + * 创建用户 | |
20 | + * | |
21 | + * @param username 用户名 | |
22 | + * @param password 密码 | |
23 | + * @return 操作主键 | |
24 | + */ | |
25 | + JSONObject addUser(String username, String password); | |
26 | + | |
27 | + /** | |
28 | + * 更新用户 | |
29 | + * | |
30 | + * @param username 用户名 | |
31 | + * @param password 密码 | |
32 | + * @return 操作状态 | |
33 | + */ | |
34 | + JSONObject updateUser(String username, String password); | |
35 | + | |
36 | + /** | |
37 | + * 查询用户信息 | |
38 | + * | |
39 | + * @param username 用户名 | |
40 | + * @param currentPage 页码 | |
41 | + * @param pageVolume 页面容量 | |
42 | + * @return 用户信息 | |
43 | + */ | |
44 | + PageResult<SyUser> searchUsers(String username, Integer currentPage, Integer pageVolume); | |
45 | + | |
46 | + /** | |
47 | + * 校验用户是否存在 | |
48 | + * | |
49 | + * @param username 用户名 | |
50 | + * @return 结果集 | |
51 | + */ | |
52 | + JSONObject checkUser(String username); | |
53 | +} | ... | ... |
src/main/java/com/objecteye/service/impl/BackGroundServiceImpl.java
1 | 1 | package com.objecteye.service.impl; |
2 | 2 | |
3 | +import cn.hutool.core.date.DateUtil; | |
4 | +import com.alibaba.fastjson.JSON; | |
3 | 5 | import com.alibaba.fastjson.JSONArray; |
4 | 6 | import com.alibaba.fastjson.JSONObject; |
5 | 7 | import com.objecteye.common.GeneralContent; |
6 | -import com.objecteye.entity.SyBasicResourceHistory; | |
8 | +import com.objecteye.common.PageResult; | |
9 | +import com.objecteye.entity.*; | |
7 | 10 | import com.objecteye.mapper.SyBasicResourceHistoryMapper; |
11 | +import com.objecteye.mapper.SyServiceConfigItemMapper; | |
12 | +import com.objecteye.mapper.SyServiceConfigMapper; | |
8 | 13 | import com.objecteye.service.IBackGroundService; |
9 | 14 | import com.objecteye.service.IOccupationOfBasicResourcesService; |
10 | 15 | import com.objecteye.utils.LinuxUtils; |
16 | +import com.objecteye.vo.VSyServiceMainTable; | |
11 | 17 | import lombok.extern.slf4j.Slf4j; |
12 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
13 | 19 | import org.springframework.data.redis.core.RedisTemplate; |
14 | 20 | import org.springframework.scheduling.annotation.Async; |
15 | 21 | import org.springframework.scheduling.annotation.Scheduled; |
16 | 22 | import org.springframework.stereotype.Component; |
23 | +import org.springframework.transaction.annotation.Transactional; | |
17 | 24 | |
18 | 25 | import java.util.*; |
26 | +import java.util.stream.Collectors; | |
19 | 27 | |
20 | 28 | @Component |
21 | 29 | @Slf4j |
... | ... | @@ -26,6 +34,10 @@ public class BackGroundServiceImpl implements IBackGroundService { |
26 | 34 | private IOccupationOfBasicResourcesService iOccupationOfBasicResourcesService; |
27 | 35 | @Autowired |
28 | 36 | private RedisTemplate redisTemplate; |
37 | + @Autowired | |
38 | + private SyServiceConfigMapper syServiceConfigMapper; | |
39 | + @Autowired | |
40 | + private SyServiceConfigItemMapper syServiceConfigItemMapper; | |
29 | 41 | |
30 | 42 | /** |
31 | 43 | * 定时写入的定制信息 |
... | ... | @@ -33,7 +45,7 @@ public class BackGroundServiceImpl implements IBackGroundService { |
33 | 45 | @Override |
34 | 46 | @Scheduled(fixedRate = 3 * 1000) |
35 | 47 | public void jobController() { |
36 | - String moduleStr = (String) redisTemplate.opsForValue().get(GeneralContent.REDIS_RECORD_MODULE); | |
48 | + /*String moduleStr = (String) redisTemplate.opsForValue().get(GeneralContent.REDIS_RECORD_MODULE); | |
37 | 49 | if (moduleStr == null || "".equals(moduleStr)) { |
38 | 50 | return; |
39 | 51 | } |
... | ... | @@ -54,7 +66,7 @@ public class BackGroundServiceImpl implements IBackGroundService { |
54 | 66 | doGpuUtilization(); |
55 | 67 | break; |
56 | 68 | } |
57 | - } | |
69 | + }*/ | |
58 | 70 | } |
59 | 71 | |
60 | 72 | /** |
... | ... | @@ -63,11 +75,11 @@ public class BackGroundServiceImpl implements IBackGroundService { |
63 | 75 | @Override |
64 | 76 | @Scheduled(fixedRate = 1000 * 60) |
65 | 77 | public void removeOverTimeData() { |
66 | - Calendar calendar = Calendar.getInstance(); | |
78 | + /*Calendar calendar = Calendar.getInstance(); | |
67 | 79 | calendar.setTimeInMillis(System.currentTimeMillis()); |
68 | 80 | calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 1); |
69 | 81 | long lastTime = calendar.getTimeInMillis(); |
70 | - syBasicResourceHistoryMapper.deleteLteTime(lastTime); | |
82 | + syBasicResourceHistoryMapper.deleteLteTime(lastTime);*/ | |
71 | 83 | } |
72 | 84 | |
73 | 85 | /** |
... | ... | @@ -241,4 +253,135 @@ public class BackGroundServiceImpl implements IBackGroundService { |
241 | 253 | } |
242 | 254 | return resultObj; |
243 | 255 | } |
256 | + | |
257 | + /** | |
258 | + * 配置启动服务 | |
259 | + * | |
260 | + * @param requestObj 启动服务参数 | |
261 | + * @return 结果集 | |
262 | + */ | |
263 | + @Override | |
264 | + @Transactional | |
265 | + public JSONObject createServiceConfig(JSONObject requestObj) { | |
266 | + SyServiceConfig syServiceConfig = JSON.parseObject(JSON.toJSONString(requestObj.getJSONObject("config")), SyServiceConfig.class); | |
267 | + long nowTime = System.currentTimeMillis(); | |
268 | + syServiceConfig.setCreateTime(nowTime); | |
269 | + syServiceConfig.setUpdateTime(nowTime); | |
270 | + syServiceConfig.setStatus(0); | |
271 | + syServiceConfigMapper.insertSelective(syServiceConfig); | |
272 | + | |
273 | + JSONArray itemsArr = requestObj.getJSONArray("items"); | |
274 | + syServiceConfigItemInsert(itemsArr, syServiceConfig.getId()); | |
275 | + | |
276 | + return new JSONObject(); | |
277 | + } | |
278 | + | |
279 | + /** | |
280 | + * 配置启动服务 | |
281 | + * | |
282 | + * @param requestObj 启动服务参数 | |
283 | + * @return 结果集 | |
284 | + */ | |
285 | + @Override | |
286 | + @Transactional | |
287 | + public JSONObject updateServiceConfig(JSONObject requestObj) { | |
288 | + SyServiceConfig syServiceConfig = JSON.parseObject(JSON.toJSONString(requestObj.getJSONObject("config")), SyServiceConfig.class); | |
289 | + syServiceConfig.setUpdateTime(System.currentTimeMillis()); | |
290 | + syServiceConfigMapper.updateByPrimaryKeySelective(syServiceConfig); | |
291 | + | |
292 | + SyServiceConfigItemExample syServiceConfigItemExample = SyServiceConfigItemExample | |
293 | + .newAndCreateCriteria().andConfigIdEqualTo(syServiceConfig.getId()).example(); | |
294 | + syServiceConfigItemMapper.deleteByExample(syServiceConfigItemExample); | |
295 | + JSONArray itemsArr = requestObj.getJSONArray("items"); | |
296 | + syServiceConfigItemInsert(itemsArr, syServiceConfig.getId()); | |
297 | + | |
298 | + return new JSONObject(); | |
299 | + } | |
300 | + | |
301 | + /** | |
302 | + * 服务配置表明细项 内容插入 | |
303 | + * | |
304 | + * @param itemsArr 插入数据 | |
305 | + * @param configId 关联配置表主键 | |
306 | + */ | |
307 | + private void syServiceConfigItemInsert(JSONArray itemsArr, Integer configId) { | |
308 | + for (int i = 0; i < itemsArr.size(); i++) { | |
309 | + JSONObject itemObj = itemsArr.getJSONObject(i); | |
310 | + if (itemObj == null) { | |
311 | + continue; | |
312 | + } | |
313 | + SyServiceConfigItem syServiceConfigItem = JSON.parseObject(itemObj.toJSONString(), SyServiceConfigItem.class); | |
314 | + syServiceConfigItem.setConfigId(configId); | |
315 | + syServiceConfigItemMapper.insertSelective(syServiceConfigItem); | |
316 | + } | |
317 | + } | |
318 | + | |
319 | + /** | |
320 | + * 配置启动服务 | |
321 | + * | |
322 | + * @param id 启动服务参数 | |
323 | + * @return 结果集 | |
324 | + */ | |
325 | + @Override | |
326 | + @Transactional | |
327 | + public JSONObject deleteServiceConfig(Integer id) { | |
328 | + syServiceConfigMapper.deleteByPrimaryKey(id); | |
329 | + SyServiceConfigItemExample syServiceConfigItemExample = SyServiceConfigItemExample | |
330 | + .newAndCreateCriteria().andConfigIdEqualTo(id).example(); | |
331 | + syServiceConfigItemMapper.deleteByExample(syServiceConfigItemExample); | |
332 | + return new JSONObject(); | |
333 | + } | |
334 | + | |
335 | + /** | |
336 | + * 查询配置好的服务运行情况 | |
337 | + * | |
338 | + * @param currentPage 页码 | |
339 | + * @param pageVolume 页面容量 | |
340 | + * @return 结果集 | |
341 | + */ | |
342 | + @Override | |
343 | + public PageResult serviceQuery(Integer currentPage, Integer pageVolume) { | |
344 | + List<SyServiceConfig> syServiceConfigs = syServiceConfigMapper.selectByExample(SyServiceConfigExample.newAndCreateCriteria() | |
345 | + .example().page(currentPage, currentPage)); | |
346 | + long total = syServiceConfigMapper.countByExample(SyServiceConfigExample.newAndCreateCriteria().example()); | |
347 | + if (total == 0) { | |
348 | + return new PageResult<>(0, new ArrayList<>()); | |
349 | + } | |
350 | + List<Integer> configIds = syServiceConfigs.stream().map(SyServiceConfig::getId).collect(Collectors.toList()); | |
351 | + | |
352 | + List<SyServiceConfigItem> syServiceConfigItems = syServiceConfigItemMapper.selectByExample(SyServiceConfigItemExample.newAndCreateCriteria() | |
353 | + .andConfigIdIn(configIds).example()); | |
354 | + Map<Integer, List<SyServiceConfigItem>> configIdItemsMap = syServiceConfigItems.stream().collect(Collectors.groupingBy(SyServiceConfigItem::getConfigId)); | |
355 | + | |
356 | + List<VSyServiceMainTable> resultList = new ArrayList<>(); | |
357 | + for (SyServiceConfig syServiceConfig : syServiceConfigs) { | |
358 | + if (!configIdItemsMap.containsKey(syServiceConfig.getId())) { | |
359 | + continue; | |
360 | + } | |
361 | + List<SyServiceConfigItem> configItems = configIdItemsMap.get(syServiceConfig.getId()); | |
362 | + VSyServiceMainTable vSyServiceMainTable = new VSyServiceMainTable(); | |
363 | + vSyServiceMainTable.setUpdateTime(DateUtil.format(new Date(syServiceConfig.getUpdateTime()), "yyyy-MM-dd HH:mm:ss")); | |
364 | + | |
365 | + String ip = null; | |
366 | + String port = null; | |
367 | + List<String> otherParams = new ArrayList<>(); | |
368 | + for (SyServiceConfigItem syServiceConfigItem : configItems) { | |
369 | + String itemName = syServiceConfigItem.getItemName(); | |
370 | + String itemValue = syServiceConfigItem.getItemValue(); | |
371 | + if ("gpuId".equals(itemName)) { | |
372 | + vSyServiceMainTable.setGpuId(itemValue); | |
373 | + } else if ("port".equals(itemName)) { | |
374 | + port = itemValue; | |
375 | + } else if ("ip".equals(itemName)) { | |
376 | + ip = itemValue; | |
377 | + } else { | |
378 | + otherParams.add(itemName); | |
379 | + } | |
380 | + } | |
381 | + vSyServiceMainTable.setPort(ip + ":" + port); | |
382 | + vSyServiceMainTable.setItems(String.join(",", otherParams)); | |
383 | + resultList.add(vSyServiceMainTable); | |
384 | + } | |
385 | + return new PageResult<>((int) Math.ceil((double) total / pageVolume), resultList); | |
386 | + } | |
244 | 387 | } | ... | ... |
src/main/java/com/objecteye/service/impl/LogFileListenerServiceImpl.java
... | ... | @@ -9,9 +9,9 @@ import org.springframework.data.redis.core.RedisTemplate; |
9 | 9 | import org.springframework.scheduling.annotation.Async; |
10 | 10 | import org.springframework.stereotype.Component; |
11 | 11 | |
12 | -import java.io.File; | |
13 | -import java.io.IOException; | |
14 | -import java.io.RandomAccessFile; | |
12 | +import javax.servlet.http.HttpServletResponse; | |
13 | +import java.io.*; | |
14 | +import java.net.URLEncoder; | |
15 | 15 | import java.nio.charset.StandardCharsets; |
16 | 16 | import java.util.List; |
17 | 17 | import java.util.Map; |
... | ... | @@ -129,4 +129,45 @@ public class LogFileListenerServiceImpl implements ILogFileListenerService { |
129 | 129 | } |
130 | 130 | return resultArr; |
131 | 131 | } |
132 | + | |
133 | + /** | |
134 | + * 下载logKey对应的日志文件 | |
135 | + * | |
136 | + * @param httpServletResponse http返回信息 | |
137 | + * @param logKey 日志key | |
138 | + * @return 操作状态 | |
139 | + */ | |
140 | + @Override | |
141 | + public JSONObject downloadLogFile(HttpServletResponse httpServletResponse, String logKey) { | |
142 | +// String logPath = (String) redisTemplate.opsForHash().get(GeneralContent.REDIS_LOG_KEY_PATH, logKey); | |
143 | + String logPath = "E:\\testResources\\111.jpg"; | |
144 | + JSONObject resultObj = new JSONObject(); | |
145 | + if (logPath == null) { | |
146 | + resultObj.put("error", "找不到文件"); | |
147 | + return resultObj; | |
148 | + } | |
149 | + String filename = logPath.substring(logPath.lastIndexOf(File.separator) + 1); | |
150 | + File file = new File(logPath); | |
151 | + // 如果文件存在,则进行下载 | |
152 | + if (file.exists()) { | |
153 | + try (FileInputStream fis = new FileInputStream(file); | |
154 | + BufferedInputStream bis = new BufferedInputStream(fis)) { | |
155 | + // 下载文件能正常显示中文 | |
156 | + httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8")); | |
157 | + // 实现文件下载 | |
158 | + byte[] buffer = new byte[1024]; | |
159 | + OutputStream os = httpServletResponse.getOutputStream(); | |
160 | + int i = bis.read(buffer); | |
161 | + while (i != -1) { | |
162 | + os.write(buffer, 0, i); | |
163 | + i = bis.read(buffer); | |
164 | + } | |
165 | + } catch (Exception e) { | |
166 | + e.printStackTrace(); | |
167 | + } | |
168 | + } | |
169 | + | |
170 | + return resultObj; | |
171 | + } | |
172 | + | |
132 | 173 | } | ... | ... |
src/main/java/com/objecteye/service/impl/UserServiceImpl.java
0 → 100644
1 | +package com.objecteye.service.impl; | |
2 | + | |
3 | +import com.alibaba.fastjson.JSONObject; | |
4 | +import com.objecteye.common.PageResult; | |
5 | +import com.objecteye.entity.SyUser; | |
6 | +import com.objecteye.entity.SyUserExample; | |
7 | +import com.objecteye.mapper.SyUserMapper; | |
8 | +import com.objecteye.service.IUserService; | |
9 | +import org.springframework.beans.factory.annotation.Autowired; | |
10 | +import org.springframework.stereotype.Component; | |
11 | + | |
12 | +import java.util.List; | |
13 | + | |
14 | +@Component | |
15 | +public class UserServiceImpl implements IUserService { | |
16 | + | |
17 | + @Autowired | |
18 | + private SyUserMapper syUserMapper; | |
19 | + | |
20 | + /** | |
21 | + * 登录 | |
22 | + * | |
23 | + * @param username 用户名 | |
24 | + * @param password 密码 | |
25 | + * @return | |
26 | + */ | |
27 | + @Override | |
28 | + public JSONObject login(String username, String password) { | |
29 | + List<SyUser> syUsers = syUserMapper.selectByExample(SyUserExample.newAndCreateCriteria().andUsernameEqualTo(username) | |
30 | + .andPasswordEqualTo(password).example()); | |
31 | + JSONObject resultObj = new JSONObject(); | |
32 | + if (syUsers.size() == 0) { | |
33 | + resultObj.put("error", "用户名或密码错误"); | |
34 | + } | |
35 | + return resultObj; | |
36 | + } | |
37 | + | |
38 | + /** | |
39 | + * 创建用户 | |
40 | + * | |
41 | + * @param username 用户名 | |
42 | + * @param password 密码 | |
43 | + * @return 操作主键 | |
44 | + */ | |
45 | + @Override | |
46 | + public JSONObject addUser(String username, String password) { | |
47 | + SyUser syUser = SyUser.builder().username(username).password(password).build(); | |
48 | + syUserMapper.insertSelective(syUser); | |
49 | + JSONObject resultObj = new JSONObject(); | |
50 | + resultObj.put("id", syUser.getId()); | |
51 | + return resultObj; | |
52 | + } | |
53 | + | |
54 | + /** | |
55 | + * 更新用户 | |
56 | + * | |
57 | + * @param username 用户名 | |
58 | + * @param password 密码 | |
59 | + * @return 操作状态 | |
60 | + */ | |
61 | + @Override | |
62 | + public JSONObject updateUser(String username, String password) { | |
63 | + syUserMapper.updateByExampleSelective(SyUser.builder().password(password).build(), | |
64 | + SyUserExample.newAndCreateCriteria().andUsernameEqualTo(username).example()); | |
65 | + return new JSONObject(); | |
66 | + } | |
67 | + | |
68 | + /** | |
69 | + * 查询用户信息 | |
70 | + * | |
71 | + * @param username 用户名 | |
72 | + * @param currentPage 页码 | |
73 | + * @param pageVolume 页面容量 | |
74 | + * @return 用户信息 | |
75 | + */ | |
76 | + @Override | |
77 | + public PageResult<SyUser> searchUsers(String username, Integer currentPage, Integer pageVolume) { | |
78 | + SyUserExample baseExample = SyUserExample.newAndCreateCriteria().andUsernameEqualTo(username).example(); | |
79 | + List<SyUser> syUsers = syUserMapper.selectByExample(baseExample.page(currentPage, currentPage)); | |
80 | + long total = syUserMapper.countByExample(baseExample); | |
81 | + return new PageResult<>((long) Math.ceil((double) total / pageVolume), syUsers); | |
82 | + } | |
83 | + | |
84 | + /** | |
85 | + * 校验用户是否存在 | |
86 | + * | |
87 | + * @param username 用户名 | |
88 | + * @return 结果集 | |
89 | + */ | |
90 | + @Override | |
91 | + public JSONObject checkUser(String username) { | |
92 | + long count = syUserMapper.countByExample(SyUserExample.newAndCreateCriteria().andUsernameEqualTo(username).example()); | |
93 | + JSONObject resultObj = new JSONObject(); | |
94 | + resultObj.put("count", count); | |
95 | + return resultObj; | |
96 | + } | |
97 | +} | ... | ... |
src/main/java/com/objecteye/vo/VSyServiceMainTable.java
0 → 100644
1 | +package com.objecteye.vo; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Data; | |
5 | +import lombok.NoArgsConstructor; | |
6 | + | |
7 | +import java.io.Serializable; | |
8 | + | |
9 | +@AllArgsConstructor | |
10 | +@NoArgsConstructor | |
11 | +@Data | |
12 | +public class VSyServiceMainTable implements Serializable { | |
13 | + | |
14 | + private static final long serialVersionUID = -7792368195135334610L; | |
15 | + /** | |
16 | + * 显卡编号 | |
17 | + */ | |
18 | + private String gpuId; | |
19 | + /** | |
20 | + * 端口号 | |
21 | + */ | |
22 | + private String port; | |
23 | + /** | |
24 | + * 配置项 | |
25 | + */ | |
26 | + private String items; | |
27 | + /** | |
28 | + * 运行状态 | |
29 | + */ | |
30 | + private String status; | |
31 | + /** | |
32 | + * 最后更新 | |
33 | + */ | |
34 | + private String updateTime; | |
35 | +} | ... | ... |
src/main/resources/application-test.yml
1 | 1 | spring: |
2 | 2 | datasource: |
3 | - url: jdbc:mysql://192.168.10.117:3306/sy_vehicle?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai | |
3 | + url: jdbc:mysql://192.168.10.117:3306/sy_sdk?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai | |
4 | 4 | username: root |
5 | 5 | password: 123456 |
6 | 6 | data: | ... | ... |
src/main/resources/com.objecteye.mapper/SyServiceConfigItemMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.objecteye.mapper.SyServiceConfigItemMapper"> | |
4 | + <resultMap id="BaseResultMap" type="com.objecteye.entity.SyServiceConfigItem"> | |
5 | + <id column="id" jdbcType="INTEGER" property="id"/> | |
6 | + <result column="config_id" jdbcType="INTEGER" property="configId"/> | |
7 | + <result column="item_name" jdbcType="VARCHAR" property="itemName"/> | |
8 | + <result column="item_value" jdbcType="VARCHAR" property="itemValue"/> | |
9 | + <result column="sort" jdbcType="INTEGER" property="sort"/> | |
10 | + </resultMap> | |
11 | + <sql id="Example_Where_Clause"> | |
12 | + <where> | |
13 | + <foreach collection="oredCriteria" item="criteria" separator="or"> | |
14 | + <if test="criteria.valid"> | |
15 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | |
16 | + <foreach collection="criteria.criteria" item="criterion"> | |
17 | + <choose> | |
18 | + <when test="criterion.noValue"> | |
19 | + and ${criterion.condition} | |
20 | + </when> | |
21 | + <when test="criterion.singleValue"> | |
22 | + and ${criterion.condition} #{criterion.value} | |
23 | + </when> | |
24 | + <when test="criterion.betweenValue"> | |
25 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | |
26 | + </when> | |
27 | + <when test="criterion.listValue"> | |
28 | + and ${criterion.condition} | |
29 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" | |
30 | + separator=","> | |
31 | + #{listItem} | |
32 | + </foreach> | |
33 | + </when> | |
34 | + </choose> | |
35 | + </foreach> | |
36 | + </trim> | |
37 | + </if> | |
38 | + </foreach> | |
39 | + </where> | |
40 | + </sql> | |
41 | + <sql id="Update_By_Example_Where_Clause"> | |
42 | + <where> | |
43 | + <foreach collection="example.oredCriteria" item="criteria" separator="or"> | |
44 | + <if test="criteria.valid"> | |
45 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | |
46 | + <foreach collection="criteria.criteria" item="criterion"> | |
47 | + <choose> | |
48 | + <when test="criterion.noValue"> | |
49 | + and ${criterion.condition} | |
50 | + </when> | |
51 | + <when test="criterion.singleValue"> | |
52 | + and ${criterion.condition} #{criterion.value} | |
53 | + </when> | |
54 | + <when test="criterion.betweenValue"> | |
55 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | |
56 | + </when> | |
57 | + <when test="criterion.listValue"> | |
58 | + and ${criterion.condition} | |
59 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" | |
60 | + separator=","> | |
61 | + #{listItem} | |
62 | + </foreach> | |
63 | + </when> | |
64 | + </choose> | |
65 | + </foreach> | |
66 | + </trim> | |
67 | + </if> | |
68 | + </foreach> | |
69 | + </where> | |
70 | + </sql> | |
71 | + <sql id="Base_Column_List"> | |
72 | + id, config_id, item_name, item_value, sort | |
73 | + </sql> | |
74 | + <select id="selectByExample" parameterType="com.objecteye.entity.SyServiceConfigItemExample" | |
75 | + resultMap="BaseResultMap"> | |
76 | + select | |
77 | + <if test="distinct"> | |
78 | + distinct | |
79 | + </if> | |
80 | + <include refid="Base_Column_List"/> | |
81 | + from sy_service_config_item | |
82 | + <if test="_parameter != null"> | |
83 | + <include refid="Example_Where_Clause"/> | |
84 | + </if> | |
85 | + <if test="orderByClause != null"> | |
86 | + order by ${orderByClause} | |
87 | + </if> | |
88 | + <if test="rows != null"> | |
89 | + <if test="offset != null"> | |
90 | + limit ${offset}, ${rows} | |
91 | + </if> | |
92 | + <if test="offset == null"> | |
93 | + limit ${rows} | |
94 | + </if> | |
95 | + </if> | |
96 | + </select> | |
97 | + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
98 | + select | |
99 | + <include refid="Base_Column_List"/> | |
100 | + from sy_service_config_item | |
101 | + where id = #{id,jdbcType=INTEGER} | |
102 | + </select> | |
103 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |
104 | + delete | |
105 | + from sy_service_config_item | |
106 | + where id = #{id,jdbcType=INTEGER} | |
107 | + </delete> | |
108 | + <delete id="deleteByExample" parameterType="com.objecteye.entity.SyServiceConfigItemExample"> | |
109 | + delete from sy_service_config_item | |
110 | + <if test="_parameter != null"> | |
111 | + <include refid="Example_Where_Clause"/> | |
112 | + </if> | |
113 | + </delete> | |
114 | + <insert id="insert" parameterType="com.objecteye.entity.SyServiceConfigItem"> | |
115 | + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> | |
116 | + SELECT LAST_INSERT_ID() | |
117 | + </selectKey> | |
118 | + insert into sy_service_config_item (id, config_id, item_name, | |
119 | + item_value, sort) | |
120 | + values (#{id,jdbcType=INTEGER}, #{configId,jdbcType=INTEGER}, #{itemName,jdbcType=VARCHAR}, | |
121 | + #{itemValue,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}) | |
122 | + </insert> | |
123 | + <insert id="insertSelective" parameterType="com.objecteye.entity.SyServiceConfigItem"> | |
124 | + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> | |
125 | + SELECT LAST_INSERT_ID() | |
126 | + </selectKey> | |
127 | + insert into sy_service_config_item | |
128 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
129 | + id, | |
130 | + <if test="configId != null"> | |
131 | + config_id, | |
132 | + </if> | |
133 | + <if test="itemName != null"> | |
134 | + item_name, | |
135 | + </if> | |
136 | + <if test="itemValue != null"> | |
137 | + item_value, | |
138 | + </if> | |
139 | + <if test="sort != null"> | |
140 | + sort, | |
141 | + </if> | |
142 | + </trim> | |
143 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
144 | + #{id,jdbcType=INTEGER}, | |
145 | + <if test="configId != null"> | |
146 | + #{configId,jdbcType=INTEGER}, | |
147 | + </if> | |
148 | + <if test="itemName != null"> | |
149 | + #{itemName,jdbcType=VARCHAR}, | |
150 | + </if> | |
151 | + <if test="itemValue != null"> | |
152 | + #{itemValue,jdbcType=VARCHAR}, | |
153 | + </if> | |
154 | + <if test="sort != null"> | |
155 | + #{sort,jdbcType=INTEGER}, | |
156 | + </if> | |
157 | + </trim> | |
158 | + </insert> | |
159 | + <select id="countByExample" parameterType="com.objecteye.entity.SyServiceConfigItemExample" | |
160 | + resultType="java.lang.Long"> | |
161 | + select count(*) from sy_service_config_item | |
162 | + <if test="_parameter != null"> | |
163 | + <include refid="Example_Where_Clause"/> | |
164 | + </if> | |
165 | + </select> | |
166 | + <update id="updateByExampleSelective" parameterType="map"> | |
167 | + update sy_service_config_item | |
168 | + <set> | |
169 | + <if test="record.id != null"> | |
170 | + id = #{record.id,jdbcType=INTEGER}, | |
171 | + </if> | |
172 | + <if test="record.configId != null"> | |
173 | + config_id = #{record.configId,jdbcType=INTEGER}, | |
174 | + </if> | |
175 | + <if test="record.itemName != null"> | |
176 | + item_name = #{record.itemName,jdbcType=VARCHAR}, | |
177 | + </if> | |
178 | + <if test="record.itemValue != null"> | |
179 | + item_value = #{record.itemValue,jdbcType=VARCHAR}, | |
180 | + </if> | |
181 | + <if test="record.sort != null"> | |
182 | + sort = #{record.sort,jdbcType=INTEGER}, | |
183 | + </if> | |
184 | + </set> | |
185 | + <if test="_parameter != null"> | |
186 | + <include refid="Update_By_Example_Where_Clause"/> | |
187 | + </if> | |
188 | + </update> | |
189 | + <update id="updateByExample" parameterType="map"> | |
190 | + update sy_service_config_item | |
191 | + set id = #{record.id,jdbcType=INTEGER}, | |
192 | + config_id = #{record.configId,jdbcType=INTEGER}, | |
193 | + item_name = #{record.itemName,jdbcType=VARCHAR}, | |
194 | + item_value = #{record.itemValue,jdbcType=VARCHAR}, | |
195 | + sort = #{record.sort,jdbcType=INTEGER} | |
196 | + <if test="_parameter != null"> | |
197 | + <include refid="Update_By_Example_Where_Clause"/> | |
198 | + </if> | |
199 | + </update> | |
200 | + <update id="updateByPrimaryKeySelective" parameterType="com.objecteye.entity.SyServiceConfigItem"> | |
201 | + update sy_service_config_item | |
202 | + <set> | |
203 | + <if test="configId != null"> | |
204 | + config_id = #{configId,jdbcType=INTEGER}, | |
205 | + </if> | |
206 | + <if test="itemName != null"> | |
207 | + item_name = #{itemName,jdbcType=VARCHAR}, | |
208 | + </if> | |
209 | + <if test="itemValue != null"> | |
210 | + item_value = #{itemValue,jdbcType=VARCHAR}, | |
211 | + </if> | |
212 | + <if test="sort != null"> | |
213 | + sort = #{sort,jdbcType=INTEGER}, | |
214 | + </if> | |
215 | + </set> | |
216 | + where id = #{id,jdbcType=INTEGER} | |
217 | + </update> | |
218 | + <update id="updateByPrimaryKey" parameterType="com.objecteye.entity.SyServiceConfigItem"> | |
219 | + update sy_service_config_item | |
220 | + set config_id = #{configId,jdbcType=INTEGER}, | |
221 | + item_name = #{itemName,jdbcType=VARCHAR}, | |
222 | + item_value = #{itemValue,jdbcType=VARCHAR}, | |
223 | + sort = #{sort,jdbcType=INTEGER} | |
224 | + where id = #{id,jdbcType=INTEGER} | |
225 | + </update> | |
226 | + <select id="selectOneByExample" parameterType="com.objecteye.entity.SyServiceConfigItemExample" | |
227 | + resultMap="BaseResultMap"> | |
228 | + select | |
229 | + <include refid="Base_Column_List"/> | |
230 | + from sy_service_config_item | |
231 | + <if test="_parameter != null"> | |
232 | + <include refid="Example_Where_Clause"/> | |
233 | + </if> | |
234 | + <if test="orderByClause != null"> | |
235 | + order by ${orderByClause} | |
236 | + </if> | |
237 | + limit 1 | |
238 | + </select> | |
239 | +</mapper> | |
0 | 240 | \ No newline at end of file | ... | ... |
src/main/resources/com.objecteye.mapper/SyServiceConfigMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.objecteye.mapper.SyServiceConfigMapper"> | |
4 | + <resultMap id="BaseResultMap" type="com.objecteye.entity.SyServiceConfig"> | |
5 | + <id column="id" jdbcType="INTEGER" property="id"/> | |
6 | + <result column="service_name" jdbcType="VARCHAR" property="serviceName"/> | |
7 | + <result column="status" jdbcType="INTEGER" property="status"/> | |
8 | + <result column="create_time" jdbcType="BIGINT" property="createTime"/> | |
9 | + <result column="update_time" jdbcType="BIGINT" property="updateTime"/> | |
10 | + </resultMap> | |
11 | + <sql id="Example_Where_Clause"> | |
12 | + <where> | |
13 | + <foreach collection="oredCriteria" item="criteria" separator="or"> | |
14 | + <if test="criteria.valid"> | |
15 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | |
16 | + <foreach collection="criteria.criteria" item="criterion"> | |
17 | + <choose> | |
18 | + <when test="criterion.noValue"> | |
19 | + and ${criterion.condition} | |
20 | + </when> | |
21 | + <when test="criterion.singleValue"> | |
22 | + and ${criterion.condition} #{criterion.value} | |
23 | + </when> | |
24 | + <when test="criterion.betweenValue"> | |
25 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | |
26 | + </when> | |
27 | + <when test="criterion.listValue"> | |
28 | + and ${criterion.condition} | |
29 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" | |
30 | + separator=","> | |
31 | + #{listItem} | |
32 | + </foreach> | |
33 | + </when> | |
34 | + </choose> | |
35 | + </foreach> | |
36 | + </trim> | |
37 | + </if> | |
38 | + </foreach> | |
39 | + </where> | |
40 | + </sql> | |
41 | + <sql id="Update_By_Example_Where_Clause"> | |
42 | + <where> | |
43 | + <foreach collection="example.oredCriteria" item="criteria" separator="or"> | |
44 | + <if test="criteria.valid"> | |
45 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | |
46 | + <foreach collection="criteria.criteria" item="criterion"> | |
47 | + <choose> | |
48 | + <when test="criterion.noValue"> | |
49 | + and ${criterion.condition} | |
50 | + </when> | |
51 | + <when test="criterion.singleValue"> | |
52 | + and ${criterion.condition} #{criterion.value} | |
53 | + </when> | |
54 | + <when test="criterion.betweenValue"> | |
55 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | |
56 | + </when> | |
57 | + <when test="criterion.listValue"> | |
58 | + and ${criterion.condition} | |
59 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" | |
60 | + separator=","> | |
61 | + #{listItem} | |
62 | + </foreach> | |
63 | + </when> | |
64 | + </choose> | |
65 | + </foreach> | |
66 | + </trim> | |
67 | + </if> | |
68 | + </foreach> | |
69 | + </where> | |
70 | + </sql> | |
71 | + <sql id="Base_Column_List"> | |
72 | + id, service_name, status, create_time, update_time | |
73 | + </sql> | |
74 | + <select id="selectByExample" parameterType="com.objecteye.entity.SyServiceConfigExample" resultMap="BaseResultMap"> | |
75 | + select | |
76 | + <if test="distinct"> | |
77 | + distinct | |
78 | + </if> | |
79 | + <include refid="Base_Column_List"/> | |
80 | + from sy_service_config | |
81 | + <if test="_parameter != null"> | |
82 | + <include refid="Example_Where_Clause"/> | |
83 | + </if> | |
84 | + <if test="orderByClause != null"> | |
85 | + order by ${orderByClause} | |
86 | + </if> | |
87 | + <if test="rows != null"> | |
88 | + <if test="offset != null"> | |
89 | + limit ${offset}, ${rows} | |
90 | + </if> | |
91 | + <if test="offset == null"> | |
92 | + limit ${rows} | |
93 | + </if> | |
94 | + </if> | |
95 | + </select> | |
96 | + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
97 | + select | |
98 | + <include refid="Base_Column_List"/> | |
99 | + from sy_service_config | |
100 | + where id = #{id,jdbcType=INTEGER} | |
101 | + </select> | |
102 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |
103 | + delete | |
104 | + from sy_service_config | |
105 | + where id = #{id,jdbcType=INTEGER} | |
106 | + </delete> | |
107 | + <delete id="deleteByExample" parameterType="com.objecteye.entity.SyServiceConfigExample"> | |
108 | + delete from sy_service_config | |
109 | + <if test="_parameter != null"> | |
110 | + <include refid="Example_Where_Clause"/> | |
111 | + </if> | |
112 | + </delete> | |
113 | + <insert id="insert" parameterType="com.objecteye.entity.SyServiceConfig"> | |
114 | + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> | |
115 | + SELECT LAST_INSERT_ID() | |
116 | + </selectKey> | |
117 | + insert into sy_service_config (id, service_name, status, | |
118 | + create_time, update_time) | |
119 | + values (#{id,jdbcType=INTEGER}, #{serviceName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, | |
120 | + #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}) | |
121 | + </insert> | |
122 | + <insert id="insertSelective" parameterType="com.objecteye.entity.SyServiceConfig"> | |
123 | + <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> | |
124 | + SELECT LAST_INSERT_ID() | |
125 | + </selectKey> | |
126 | + insert into sy_service_config | |
127 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
128 | + id, | |
129 | + <if test="serviceName != null"> | |
130 | + service_name, | |
131 | + </if> | |
132 | + <if test="status != null"> | |
133 | + status, | |
134 | + </if> | |
135 | + <if test="createTime != null"> | |
136 | + create_time, | |
137 | + </if> | |
138 | + <if test="updateTime != null"> | |
139 | + update_time, | |
140 | + </if> | |
141 | + </trim> | |
142 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
143 | + #{id,jdbcType=INTEGER}, | |
144 | + <if test="serviceName != null"> | |
145 | + #{serviceName,jdbcType=VARCHAR}, | |
146 | + </if> | |
147 | + <if test="status != null"> | |
148 | + #{status,jdbcType=INTEGER}, | |
149 | + </if> | |
150 | + <if test="createTime != null"> | |
151 | + #{createTime,jdbcType=BIGINT}, | |
152 | + </if> | |
153 | + <if test="updateTime != null"> | |
154 | + #{updateTime,jdbcType=BIGINT}, | |
155 | + </if> | |
156 | + </trim> | |
157 | + </insert> | |
158 | + <select id="countByExample" parameterType="com.objecteye.entity.SyServiceConfigExample" resultType="java.lang.Long"> | |
159 | + select count(*) from sy_service_config | |
160 | + <if test="_parameter != null"> | |
161 | + <include refid="Example_Where_Clause"/> | |
162 | + </if> | |
163 | + </select> | |
164 | + <update id="updateByExampleSelective" parameterType="map"> | |
165 | + update sy_service_config | |
166 | + <set> | |
167 | + <if test="record.id != null"> | |
168 | + id = #{record.id,jdbcType=INTEGER}, | |
169 | + </if> | |
170 | + <if test="record.serviceName != null"> | |
171 | + service_name = #{record.serviceName,jdbcType=VARCHAR}, | |
172 | + </if> | |
173 | + <if test="record.status != null"> | |
174 | + status = #{record.status,jdbcType=INTEGER}, | |
175 | + </if> | |
176 | + <if test="record.createTime != null"> | |
177 | + create_time = #{record.createTime,jdbcType=BIGINT}, | |
178 | + </if> | |
179 | + <if test="record.updateTime != null"> | |
180 | + update_time = #{record.updateTime,jdbcType=BIGINT}, | |
181 | + </if> | |
182 | + </set> | |
183 | + <if test="_parameter != null"> | |
184 | + <include refid="Update_By_Example_Where_Clause"/> | |
185 | + </if> | |
186 | + </update> | |
187 | + <update id="updateByExample" parameterType="map"> | |
188 | + update sy_service_config | |
189 | + set id = #{record.id,jdbcType=INTEGER}, | |
190 | + service_name = #{record.serviceName,jdbcType=VARCHAR}, | |
191 | + status = #{record.status,jdbcType=INTEGER}, | |
192 | + create_time = #{record.createTime,jdbcType=BIGINT}, | |
193 | + update_time = #{record.updateTime,jdbcType=BIGINT} | |
194 | + <if test="_parameter != null"> | |
195 | + <include refid="Update_By_Example_Where_Clause"/> | |
196 | + </if> | |
197 | + </update> | |
198 | + <update id="updateByPrimaryKeySelective" parameterType="com.objecteye.entity.SyServiceConfig"> | |
199 | + update sy_service_config | |
200 | + <set> | |
201 | + <if test="serviceName != null"> | |
202 | + service_name = #{serviceName,jdbcType=VARCHAR}, | |
203 | + </if> | |
204 | + <if test="status != null"> | |
205 | + status = #{status,jdbcType=INTEGER}, | |
206 | + </if> | |
207 | + <if test="createTime != null"> | |
208 | + create_time = #{createTime,jdbcType=BIGINT}, | |
209 | + </if> | |
210 | + <if test="updateTime != null"> | |
211 | + update_time = #{updateTime,jdbcType=BIGINT}, | |
212 | + </if> | |
213 | + </set> | |
214 | + where id = #{id,jdbcType=INTEGER} | |
215 | + </update> | |
216 | + <update id="updateByPrimaryKey" parameterType="com.objecteye.entity.SyServiceConfig"> | |
217 | + update sy_service_config | |
218 | + set service_name = #{serviceName,jdbcType=VARCHAR}, | |
219 | + status = #{status,jdbcType=INTEGER}, | |
220 | + create_time = #{createTime,jdbcType=BIGINT}, | |
221 | + update_time = #{updateTime,jdbcType=BIGINT} | |
222 | + where id = #{id,jdbcType=INTEGER} | |
223 | + </update> | |
224 | + <select id="selectOneByExample" parameterType="com.objecteye.entity.SyServiceConfigExample" | |
225 | + resultMap="BaseResultMap"> | |
226 | + select | |
227 | + <include refid="Base_Column_List"/> | |
228 | + from sy_service_config | |
229 | + <if test="_parameter != null"> | |
230 | + <include refid="Example_Where_Clause"/> | |
231 | + </if> | |
232 | + <if test="orderByClause != null"> | |
233 | + order by ${orderByClause} | |
234 | + </if> | |
235 | + limit 1 | |
236 | + </select> | |
237 | +</mapper> | |
0 | 238 | \ No newline at end of file | ... | ... |
src/main/resources/com.objecteye.mapper/SyUserMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.objecteye.mapper.SyUserMapper"> | |
4 | + <resultMap id="BaseResultMap" type="com.objecteye.entity.SyUser"> | |
5 | + <id column="id" jdbcType="INTEGER" property="id"/> | |
6 | + <result column="username" jdbcType="VARCHAR" property="username"/> | |
7 | + <result column="password" jdbcType="VARCHAR" property="password"/> | |
8 | + </resultMap> | |
9 | + <sql id="Example_Where_Clause"> | |
10 | + <where> | |
11 | + <foreach collection="oredCriteria" item="criteria" separator="or"> | |
12 | + <if test="criteria.valid"> | |
13 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | |
14 | + <foreach collection="criteria.criteria" item="criterion"> | |
15 | + <choose> | |
16 | + <when test="criterion.noValue"> | |
17 | + and ${criterion.condition} | |
18 | + </when> | |
19 | + <when test="criterion.singleValue"> | |
20 | + and ${criterion.condition} #{criterion.value} | |
21 | + </when> | |
22 | + <when test="criterion.betweenValue"> | |
23 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | |
24 | + </when> | |
25 | + <when test="criterion.listValue"> | |
26 | + and ${criterion.condition} | |
27 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" | |
28 | + separator=","> | |
29 | + #{listItem} | |
30 | + </foreach> | |
31 | + </when> | |
32 | + </choose> | |
33 | + </foreach> | |
34 | + </trim> | |
35 | + </if> | |
36 | + </foreach> | |
37 | + </where> | |
38 | + </sql> | |
39 | + <sql id="Update_By_Example_Where_Clause"> | |
40 | + <where> | |
41 | + <foreach collection="example.oredCriteria" item="criteria" separator="or"> | |
42 | + <if test="criteria.valid"> | |
43 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | |
44 | + <foreach collection="criteria.criteria" item="criterion"> | |
45 | + <choose> | |
46 | + <when test="criterion.noValue"> | |
47 | + and ${criterion.condition} | |
48 | + </when> | |
49 | + <when test="criterion.singleValue"> | |
50 | + and ${criterion.condition} #{criterion.value} | |
51 | + </when> | |
52 | + <when test="criterion.betweenValue"> | |
53 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | |
54 | + </when> | |
55 | + <when test="criterion.listValue"> | |
56 | + and ${criterion.condition} | |
57 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" | |
58 | + separator=","> | |
59 | + #{listItem} | |
60 | + </foreach> | |
61 | + </when> | |
62 | + </choose> | |
63 | + </foreach> | |
64 | + </trim> | |
65 | + </if> | |
66 | + </foreach> | |
67 | + </where> | |
68 | + </sql> | |
69 | + <sql id="Base_Column_List"> | |
70 | + id, username, password | |
71 | + </sql> | |
72 | + <select id="selectByExample" parameterType="com.objecteye.entity.SyUserExample" resultMap="BaseResultMap"> | |
73 | + select | |
74 | + <if test="distinct"> | |
75 | + distinct | |
76 | + </if> | |
77 | + <include refid="Base_Column_List"/> | |
78 | + from sy_user | |
79 | + <if test="_parameter != null"> | |
80 | + <include refid="Example_Where_Clause"/> | |
81 | + </if> | |
82 | + <if test="orderByClause != null"> | |
83 | + order by ${orderByClause} | |
84 | + </if> | |
85 | + <if test="rows != null"> | |
86 | + <if test="offset != null"> | |
87 | + limit ${offset}, ${rows} | |
88 | + </if> | |
89 | + <if test="offset == null"> | |
90 | + limit ${rows} | |
91 | + </if> | |
92 | + </if> | |
93 | + </select> | |
94 | + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> | |
95 | + select | |
96 | + <include refid="Base_Column_List"/> | |
97 | + from sy_user | |
98 | + where id = #{id,jdbcType=INTEGER} | |
99 | + </select> | |
100 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> | |
101 | + delete | |
102 | + from sy_user | |
103 | + where id = #{id,jdbcType=INTEGER} | |
104 | + </delete> | |
105 | + <delete id="deleteByExample" parameterType="com.objecteye.entity.SyUserExample"> | |
106 | + delete from sy_user | |
107 | + <if test="_parameter != null"> | |
108 | + <include refid="Example_Where_Clause"/> | |
109 | + </if> | |
110 | + </delete> | |
111 | + <insert id="insert" parameterType="com.objecteye.entity.SyUser"> | |
112 | + <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Integer"> | |
113 | + SELECT LAST_INSERT_ID() | |
114 | + </selectKey> | |
115 | + insert into sy_user (id, username, password | |
116 | + ) | |
117 | + values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR} | |
118 | + ) | |
119 | + </insert> | |
120 | + <insert id="insertSelective" parameterType="com.objecteye.entity.SyUser"> | |
121 | + <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Integer"> | |
122 | + SELECT LAST_INSERT_ID() | |
123 | + </selectKey> | |
124 | + insert into sy_user | |
125 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
126 | + id, | |
127 | + <if test="username != null"> | |
128 | + username, | |
129 | + </if> | |
130 | + <if test="password != null"> | |
131 | + password, | |
132 | + </if> | |
133 | + </trim> | |
134 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
135 | + #{id,jdbcType=INTEGER}, | |
136 | + <if test="username != null"> | |
137 | + #{username,jdbcType=VARCHAR}, | |
138 | + </if> | |
139 | + <if test="password != null"> | |
140 | + #{password,jdbcType=VARCHAR}, | |
141 | + </if> | |
142 | + </trim> | |
143 | + </insert> | |
144 | + <select id="countByExample" parameterType="com.objecteye.entity.SyUserExample" resultType="java.lang.Long"> | |
145 | + select count(*) from sy_user | |
146 | + <if test="_parameter != null"> | |
147 | + <include refid="Example_Where_Clause"/> | |
148 | + </if> | |
149 | + </select> | |
150 | + <update id="updateByExampleSelective" parameterType="map"> | |
151 | + update sy_user | |
152 | + <set> | |
153 | + <if test="record.id != null"> | |
154 | + id = #{record.id,jdbcType=INTEGER}, | |
155 | + </if> | |
156 | + <if test="record.username != null"> | |
157 | + username = #{record.username,jdbcType=VARCHAR}, | |
158 | + </if> | |
159 | + <if test="record.password != null"> | |
160 | + password = #{record.password,jdbcType=VARCHAR}, | |
161 | + </if> | |
162 | + </set> | |
163 | + <if test="_parameter != null"> | |
164 | + <include refid="Update_By_Example_Where_Clause"/> | |
165 | + </if> | |
166 | + </update> | |
167 | + <update id="updateByExample" parameterType="map"> | |
168 | + update sy_user | |
169 | + set id = #{record.id,jdbcType=INTEGER}, | |
170 | + username = #{record.username,jdbcType=VARCHAR}, | |
171 | + password = #{record.password,jdbcType=VARCHAR} | |
172 | + <if test="_parameter != null"> | |
173 | + <include refid="Update_By_Example_Where_Clause"/> | |
174 | + </if> | |
175 | + </update> | |
176 | + <update id="updateByPrimaryKeySelective" parameterType="com.objecteye.entity.SyUser"> | |
177 | + update sy_user | |
178 | + <set> | |
179 | + <if test="username != null"> | |
180 | + username = #{username,jdbcType=VARCHAR}, | |
181 | + </if> | |
182 | + <if test="password != null"> | |
183 | + password = #{password,jdbcType=VARCHAR}, | |
184 | + </if> | |
185 | + </set> | |
186 | + where id = #{id,jdbcType=INTEGER} | |
187 | + </update> | |
188 | + <update id="updateByPrimaryKey" parameterType="com.objecteye.entity.SyUser"> | |
189 | + update sy_user | |
190 | + set username = #{username,jdbcType=VARCHAR}, | |
191 | + password = #{password,jdbcType=VARCHAR} | |
192 | + where id = #{id,jdbcType=INTEGER} | |
193 | + </update> | |
194 | + <select id="selectOneByExample" parameterType="com.objecteye.entity.SyUserExample" resultMap="BaseResultMap"> | |
195 | + select | |
196 | + <include refid="Base_Column_List"/> | |
197 | + from sy_user | |
198 | + <if test="_parameter != null"> | |
199 | + <include refid="Example_Where_Clause"/> | |
200 | + </if> | |
201 | + <if test="orderByClause != null"> | |
202 | + order by ${orderByClause} | |
203 | + </if> | |
204 | + limit 1 | |
205 | + </select> | |
206 | +</mapper> | |
0 | 207 | \ No newline at end of file | ... | ... |