Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
mh | ddf0a00090 | 2 months ago |
mh | 95987cdc6d | 3 months ago |
mh | 1a3cf1569e | 4 months ago |
mh | c27e778d60 | 4 months ago |
mh | 3b87a5b40d | 4 months ago |
mh | 1fc44b3555 | 4 months ago |
192 changed files with 5304 additions and 5746 deletions
@ -0,0 +1,217 @@ |
|||||||
|
-- 2024-07-31 (未执行) |
||||||
|
alter table project_info add longitude numeric(10,2) null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'经度', N'schema', N'dbo', N'table', N'project_info', N'column', N'longitude'; |
||||||
|
|
||||||
|
alter table project_info add latitude numeric(10,2) null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'纬度', N'schema', N'dbo', N'table', N'project_info', N'column', N'latitude'; |
||||||
|
|
||||||
|
alter table project_info add create_time datetime null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'创建时间', N'schema', N'dbo', N'table', N'project_info', N'column', N'create_time'; |
||||||
|
|
||||||
|
alter table project_info add pic_content text null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'图片内容', N'schema', N'dbo', N'table', N'project_info', N'column', N'pic_content'; |
||||||
|
|
||||||
|
-- 2024-08-13 创建字典表数据 |
||||||
|
CREATE TABLE sys_dict ( |
||||||
|
id bigint NOT NULL, |
||||||
|
value nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
label nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
[type] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
description nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
sort decimal(10,0) NOT NULL, |
||||||
|
create_by nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
create_time datetime2 NULL, |
||||||
|
last_update_by nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
last_update_time datetime2 NULL, |
||||||
|
remarks nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
del_flag tinyint NULL, |
||||||
|
status bit null, |
||||||
|
parent_id bigint null |
||||||
|
CONSTRAINT PK__sys_dict__3213E83F527BBC48 PRIMARY KEY (id) |
||||||
|
); |
||||||
|
|
||||||
|
-- Extended properties |
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典表', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据值', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'value'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标签名', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'label'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'description'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序(升序)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'sort'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'create_by'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新人', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'last_update_by'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'last_update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注信息', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'remarks'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否删除 -1:已删除 0:正常', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'del_flag'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态(0正常 1停用)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'status'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父id:0最高级', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'parent_id'; |
||||||
|
|
||||||
|
-- 2024-08-22 |
||||||
|
-- 资产设备管理 |
||||||
|
create table devices_manage |
||||||
|
( |
||||||
|
id bigint identity primary key not null, -- id |
||||||
|
device_name nvarchar(100) null, -- 设备名称 |
||||||
|
device_brand nvarchar(100) null, -- 设备品牌 |
||||||
|
em_brand nvarchar(100) null, -- 机电品牌 |
||||||
|
rated_input_power numeric(24, 2) null, -- 额定输入功率 |
||||||
|
rated_refrigeration_capacity numeric(24, 2) null, -- 额定制冷量 |
||||||
|
rated_cop numeric(24, 2) null, -- 额定COP |
||||||
|
rated_flow numeric(24, 2) null, -- 额定流量 |
||||||
|
production_time datetime null, -- 生产日期 |
||||||
|
create_time datetime null, -- 创建时间 |
||||||
|
update_time datetime null, -- 更新时间 |
||||||
|
create_by nvarchar(50) null, -- 创建人 |
||||||
|
is_frequency bit null, -- 是否变频 |
||||||
|
device_type bigint null, -- 设备类型id(字典配置) |
||||||
|
system_id bigint null, -- 项目类型id |
||||||
|
remark nvarchar(255) null, -- 备注 |
||||||
|
grade int null -- 保留 |
||||||
|
) |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资产设备管理', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备品牌', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_brand'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'机电品牌', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'em_brand'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定输入功率', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_input_power'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定制冷量', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_refrigeration_capacity'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定COP', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_cop'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定流量', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_flow'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生产日期', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'production_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'create_by'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否变频', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'is_frequency'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备类型id(字典配置)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'system_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据标识', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'grade'; |
||||||
|
|
||||||
|
-- 仪表管理 |
||||||
|
create table meter_manage ( |
||||||
|
id bigint identity primary key not null, -- 编号 |
||||||
|
mt_type bigint null, -- 仪表类型(从字典值获取) |
||||||
|
mt_name nvarchar(100) null, -- 仪表名称 |
||||||
|
other_name nvarchar(100) null, -- 仪表别名 |
||||||
|
mt_brand nvarchar(100) null, -- 仪表品牌 |
||||||
|
mt_num nvarchar(20) null, -- 仪表表面号 |
||||||
|
mt_code nvarchar(20) null, -- 仪表采集码 |
||||||
|
register_addr nvarchar(20), -- 寄存器地址 |
||||||
|
func_code nvarchar(20) null, -- 功能码 |
||||||
|
identify_code nvarchar(20) null, -- 仪表识别码 |
||||||
|
mt_caliber_pulse nvarchar(20) null, -- 仪表口径或者脉冲常数 |
||||||
|
mt_range numeric(24,3) null, -- 仪表范围 |
||||||
|
mt_ratio int null, -- 仪表倍率 |
||||||
|
mt_init_value numeric(24,3) null, -- 初始值 |
||||||
|
digits int null, -- 小数位数 |
||||||
|
data_type int null, -- 数据类型16位、32位、64位 |
||||||
|
cur_value numeric(24,3) null, -- 当前值 |
||||||
|
cur_time datetime null, -- 当前值时间 |
||||||
|
mt_is_sum bit null, -- 是否总表 |
||||||
|
create_time datetime null, -- 创建时间 |
||||||
|
update_time datetime null, -- 更新时间 |
||||||
|
unit nvarchar(20) null, -- 单位 |
||||||
|
sort bigint null, -- 排序 |
||||||
|
data_com nvarchar(100) null, -- 通信端口 |
||||||
|
device_id bigint null, -- 对应device_manage的id |
||||||
|
gateway_id bigint null, -- 对应网关管理表gateway_manage的id |
||||||
|
param_id bigint null, -- 对应参数id |
||||||
|
protocol_type bigint null, -- 协议类型(字典表) |
||||||
|
communication_type int NULL, -- 通讯方式 |
||||||
|
remark nvarchar(255) null, -- 备注 |
||||||
|
system_id bigint null, -- 项目类型id |
||||||
|
grade int null -- 保留 |
||||||
|
) |
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表管理', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表类型(从字典值获取)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_type_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表别名', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'other_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表品牌', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_brand'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表表面号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_num'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表采集码', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_code'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'寄存器地址', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'register_addr'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能码', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'func_code'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表识别码', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'identify_code'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表口径或者脉冲常数', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_caliber_pulse'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表范围', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_range'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表倍率', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_ratio'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'初始值', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_init_value'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'小数位数', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'digits'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据类型16位、32位、64位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'data_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前值', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'cur_value'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前值时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'cur_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否总表', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'mt_is_sum'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'unit'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'sort'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应device_manage的id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应网关管理表gateway_manage的id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'gateway_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应参数id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'param_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'协议类型(字典表)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'protocol_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通讯方式', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'communication_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型ID', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'system_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'保留', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'grade'; |
||||||
|
|
||||||
|
|
||||||
|
-- 网关管理表 |
||||||
|
CREATE TABLE gateway_manage ( |
||||||
|
id bigint identity(1,1) NOT NULL, |
||||||
|
gw_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
gw_ip varchar(20) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
gw_addr varchar(100) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
port int NULL, |
||||||
|
collection_loop int NULL, |
||||||
|
create_time datetime NULL, |
||||||
|
update_time datetime NULL, |
||||||
|
connect_time datetime NULL, |
||||||
|
internet_card varchar(50) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
operator_type int NULL, |
||||||
|
remark varchar(100) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
communication_type int NULL, |
||||||
|
grade int NULL, |
||||||
|
system_id bigint null, -- 项目类型id |
||||||
|
CONSTRAINT pk_gateway_manage PRIMARY KEY (id) |
||||||
|
); |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关管理', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'gw_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关IP地址', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'gw_ip'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关对应的编号地址', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'gw_addr'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关端口', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'port'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集周期', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'collection_loop'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'连接时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'connect_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'卡号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'internet_card'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'运营商类型 0:中国移动 1:中国联通 2:中国电信', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'operator_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通信类型(字典表)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'communication_type_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'预留字段', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'grade'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'system_id'; |
||||||
|
|
||||||
|
-- 设备采集参数表 |
||||||
|
create table device_params( |
||||||
|
id bigint primary key identity(1,1) not null, -- 编号 |
||||||
|
mt_type int not null, -- 仪表类型(从字典表中拿) |
||||||
|
baud_rate int not null, -- 波特率 |
||||||
|
data_bit int not null, -- 数据位 |
||||||
|
stop_bit int not null, -- 停止位 |
||||||
|
parity nvarchar(10) not null, -- 校验位 |
||||||
|
remark varchar(100) null -- 备注 |
||||||
|
) |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备采集参数表', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表类型(从字典中获取)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'mt_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'波特率', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'baud_rate'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'data_bit'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'停止位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'stop_bit'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'校验位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'parity'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
|
||||||
|
-- 2024-08-22 |
@ -1,117 +1,117 @@ |
|||||||
package com.mh.user.config; |
//package com.mh.user.config;
|
||||||
|
//
|
||||||
import java.sql.SQLException; |
//import java.sql.SQLException;
|
||||||
import java.util.ArrayList; |
//import java.util.ArrayList;
|
||||||
import java.util.List; |
//import java.util.List;
|
||||||
|
//
|
||||||
import javax.servlet.Filter; |
//import javax.servlet.Filter;
|
||||||
import javax.servlet.Servlet; |
//import javax.servlet.Servlet;
|
||||||
import javax.sql.DataSource; |
//import javax.sql.DataSource;
|
||||||
|
//
|
||||||
import com.alibaba.druid.wall.WallConfig; |
//import com.alibaba.druid.wall.WallConfig;
|
||||||
import com.alibaba.druid.wall.WallFilter; |
//import com.alibaba.druid.wall.WallFilter;
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean; |
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.boot.web.servlet.ServletRegistrationBean; |
//import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration; |
//import org.springframework.context.annotation.Configuration;
|
||||||
|
//
|
||||||
import com.alibaba.druid.pool.DruidDataSource; |
//import com.alibaba.druid.pool.DruidDataSource;
|
||||||
import com.alibaba.druid.support.http.StatViewServlet; |
//import com.alibaba.druid.support.http.StatViewServlet;
|
||||||
import com.alibaba.druid.support.http.WebStatFilter; |
//import com.alibaba.druid.support.http.WebStatFilter;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* @author ljf |
// * @author ljf
|
||||||
* @title : |
// * @title :
|
||||||
* @description : |
// * @description :
|
||||||
* @updateTime 2020-03-13 |
// * @updateTime 2020-03-13
|
||||||
* @throws : |
// * @throws :
|
||||||
*/ |
// */
|
||||||
@Configuration |
//@Configuration
|
||||||
@EnableConfigurationProperties({DruidDataSourceProperties.class}) |
//@EnableConfigurationProperties({DruidDataSourceProperties.class})
|
||||||
public class DruidConfig { |
//public class DruidConfig {
|
||||||
@Autowired |
// @Autowired
|
||||||
private DruidDataSourceProperties properties; |
// private DruidDataSourceProperties properties;
|
||||||
|
//
|
||||||
@Bean |
// @Bean
|
||||||
@ConditionalOnMissingBean |
// @ConditionalOnMissingBean
|
||||||
public DataSource druidDataSource() { |
// public DataSource druidDataSource() {
|
||||||
DruidDataSource druidDataSource = new DruidDataSource(); |
// DruidDataSource druidDataSource = new DruidDataSource();
|
||||||
druidDataSource.setDriverClassName(properties.getDriverClassName()); |
// druidDataSource.setDriverClassName(properties.getDriverClassName());
|
||||||
druidDataSource.setUrl(properties.getUrl()); |
// druidDataSource.setUrl(properties.getUrl());
|
||||||
druidDataSource.setUsername(properties.getUsername()); |
// druidDataSource.setUsername(properties.getUsername());
|
||||||
druidDataSource.setPassword(properties.getPassword()); |
// druidDataSource.setPassword(properties.getPassword());
|
||||||
druidDataSource.setInitialSize(properties.getInitialSize()); |
// druidDataSource.setInitialSize(properties.getInitialSize());
|
||||||
druidDataSource.setMinIdle(properties.getMinIdle()); |
// druidDataSource.setMinIdle(properties.getMinIdle());
|
||||||
druidDataSource.setMaxActive(properties.getMaxActive()); |
// druidDataSource.setMaxActive(properties.getMaxActive());
|
||||||
druidDataSource.setMaxWait(properties.getMaxWait()); |
// druidDataSource.setMaxWait(properties.getMaxWait());
|
||||||
druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis()); |
// druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
|
||||||
druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis()); |
// druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
|
||||||
druidDataSource.setValidationQuery(properties.getValidationQuery()); |
// druidDataSource.setValidationQuery(properties.getValidationQuery());
|
||||||
druidDataSource.setTestWhileIdle(properties.isTestWhileIdle()); |
// druidDataSource.setTestWhileIdle(properties.isTestWhileIdle());
|
||||||
druidDataSource.setTestOnBorrow(properties.isTestOnBorrow()); |
// druidDataSource.setTestOnBorrow(properties.isTestOnBorrow());
|
||||||
druidDataSource.setTestOnReturn(properties.isTestOnReturn()); |
// druidDataSource.setTestOnReturn(properties.isTestOnReturn());
|
||||||
druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements()); |
// druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements());
|
||||||
druidDataSource.setMaxPoolPreparedStatementPerConnectionSize(properties.getMaxPoolPreparedStatementPerConnectionSize()); |
// druidDataSource.setMaxPoolPreparedStatementPerConnectionSize(properties.getMaxPoolPreparedStatementPerConnectionSize());
|
||||||
|
//
|
||||||
List list=new ArrayList<>(); |
// List list=new ArrayList<>();
|
||||||
WallFilter wallFilter=new WallFilter(); |
// WallFilter wallFilter=new WallFilter();
|
||||||
WallConfig config = new WallConfig(); |
// WallConfig config = new WallConfig();
|
||||||
//允许一次执行多条语句
|
// //允许一次执行多条语句
|
||||||
config.setMultiStatementAllow(true); |
// config.setMultiStatementAllow(true);
|
||||||
//允许非基本语句的其他语句
|
// //允许非基本语句的其他语句
|
||||||
//config.setNoneBaseStatementAllow(true);
|
// //config.setNoneBaseStatementAllow(true);
|
||||||
wallFilter.setConfig(config); |
// wallFilter.setConfig(config);
|
||||||
list.add(wallFilter); |
// list.add(wallFilter);
|
||||||
druidDataSource.setProxyFilters(list); |
// druidDataSource.setProxyFilters(list);
|
||||||
|
//
|
||||||
try { |
// try {
|
||||||
druidDataSource.setFilters(properties.getFilters()); |
// druidDataSource.setFilters(properties.getFilters());
|
||||||
druidDataSource.init(); |
// druidDataSource.init();
|
||||||
} catch (SQLException e) { |
// } catch (SQLException e) {
|
||||||
e.printStackTrace(); |
// e.printStackTrace();
|
||||||
} |
// }
|
||||||
|
//
|
||||||
return druidDataSource; |
// return druidDataSource;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
/** |
// /**
|
||||||
* 注册Servlet信息, 配置监控视图 |
// * 注册Servlet信息, 配置监控视图
|
||||||
* |
// *
|
||||||
* @return |
// * @return
|
||||||
*/ |
// */
|
||||||
@Bean |
// @Bean
|
||||||
@ConditionalOnMissingBean |
// @ConditionalOnMissingBean
|
||||||
public ServletRegistrationBean<Servlet> druidServlet() { |
// public ServletRegistrationBean<Servlet> druidServlet() {
|
||||||
ServletRegistrationBean<Servlet> servletRegistrationBean = new ServletRegistrationBean<Servlet>(new StatViewServlet(), "/druid/*"); |
// ServletRegistrationBean<Servlet> servletRegistrationBean = new ServletRegistrationBean<Servlet>(new StatViewServlet(), "/druid/*");
|
||||||
|
//
|
||||||
//白名单:
|
// //白名单:
|
||||||
// servletRegistrationBean.addInitParameter("allow","127.0.0.1,139.196.87.48");
|
//// servletRegistrationBean.addInitParameter("allow","127.0.0.1,139.196.87.48");
|
||||||
//IP黑名单 (存在共同时,deny优先于allow) : 如果满足deny的话提示:Sorry, you are not permitted to view this page.
|
// //IP黑名单 (存在共同时,deny优先于allow) : 如果满足deny的话提示:Sorry, you are not permitted to view this page.
|
||||||
servletRegistrationBean.addInitParameter("deny","192.168.1.222"); |
// servletRegistrationBean.addInitParameter("deny","192.168.1.222");
|
||||||
//登录查看信息的账号密码, 用于登录Druid监控后台
|
// //登录查看信息的账号密码, 用于登录Druid监控后台
|
||||||
servletRegistrationBean.addInitParameter("loginUsername", "admin"); |
// servletRegistrationBean.addInitParameter("loginUsername", "admin");
|
||||||
servletRegistrationBean.addInitParameter("loginPassword", "admin"); |
// servletRegistrationBean.addInitParameter("loginPassword", "admin");
|
||||||
//是否能够重置数据.
|
// //是否能够重置数据.
|
||||||
servletRegistrationBean.addInitParameter("resetEnable", "true"); |
// servletRegistrationBean.addInitParameter("resetEnable", "true");
|
||||||
return servletRegistrationBean; |
// return servletRegistrationBean;
|
||||||
|
//
|
||||||
} |
// }
|
||||||
|
//
|
||||||
/** |
// /**
|
||||||
* 注册Filter信息, 监控拦截器 |
// * 注册Filter信息, 监控拦截器
|
||||||
* |
// *
|
||||||
* @return |
// * @return
|
||||||
*/ |
// */
|
||||||
@Bean |
// @Bean
|
||||||
@ConditionalOnMissingBean |
// @ConditionalOnMissingBean
|
||||||
public FilterRegistrationBean<Filter> filterRegistrationBean() { |
// public FilterRegistrationBean<Filter> filterRegistrationBean() {
|
||||||
FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<Filter>(); |
// FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<Filter>();
|
||||||
filterRegistrationBean.setFilter(new WebStatFilter()); |
// filterRegistrationBean.setFilter(new WebStatFilter());
|
||||||
filterRegistrationBean.addUrlPatterns("/*"); |
// filterRegistrationBean.addUrlPatterns("/*");
|
||||||
filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); |
// filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
|
||||||
return filterRegistrationBean; |
// return filterRegistrationBean;
|
||||||
} |
// }
|
||||||
} |
//}
|
||||||
|
@ -1,172 +1,172 @@ |
|||||||
package com.mh.user.config; |
//package com.mh.user.config;
|
||||||
|
//
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties; |
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* @author ljf |
// * @author ljf
|
||||||
* @title : |
// * @title :
|
||||||
* @description : |
// * @description :
|
||||||
* @updateTime 2020-03-13 |
// * @updateTime 2020-03-13
|
||||||
* @throws : |
// * @throws :
|
||||||
*/ |
// */
|
||||||
@ConfigurationProperties(prefix = "spring.datasource.druid") |
//@ConfigurationProperties(prefix = "spring.datasource.druid")
|
||||||
public class DruidDataSourceProperties { |
//public class DruidDataSourceProperties {
|
||||||
|
//
|
||||||
// jdbc
|
// // jdbc
|
||||||
private String driverClassName; |
// private String driverClassName;
|
||||||
private String url; |
// private String url;
|
||||||
private String username; |
// private String username;
|
||||||
private String password; |
// private String password;
|
||||||
// jdbc connection pool
|
// // jdbc connection pool
|
||||||
private int initialSize; |
// private int initialSize;
|
||||||
private int minIdle; |
// private int minIdle;
|
||||||
private int maxActive = 100; |
// private int maxActive = 100;
|
||||||
private long maxWait; |
// private long maxWait;
|
||||||
private long timeBetweenEvictionRunsMillis; |
// private long timeBetweenEvictionRunsMillis;
|
||||||
private long minEvictableIdleTimeMillis; |
// private long minEvictableIdleTimeMillis;
|
||||||
private String validationQuery; |
// private String validationQuery;
|
||||||
private boolean testWhileIdle; |
// private boolean testWhileIdle;
|
||||||
private boolean testOnBorrow; |
// private boolean testOnBorrow;
|
||||||
private boolean testOnReturn; |
// private boolean testOnReturn;
|
||||||
private boolean poolPreparedStatements; |
// private boolean poolPreparedStatements;
|
||||||
private int maxPoolPreparedStatementPerConnectionSize; |
// private int maxPoolPreparedStatementPerConnectionSize;
|
||||||
// filter
|
// // filter
|
||||||
private String filters; |
// private String filters;
|
||||||
|
//
|
||||||
public int getInitialSize() { |
// public int getInitialSize() {
|
||||||
return initialSize; |
// return initialSize;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setInitialSize(int initialSize) { |
// public void setInitialSize(int initialSize) {
|
||||||
this.initialSize = initialSize; |
// this.initialSize = initialSize;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public int getMinIdle() { |
// public int getMinIdle() {
|
||||||
return minIdle; |
// return minIdle;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setMinIdle(int minIdle) { |
// public void setMinIdle(int minIdle) {
|
||||||
this.minIdle = minIdle; |
// this.minIdle = minIdle;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public int getMaxActive() { |
// public int getMaxActive() {
|
||||||
return maxActive; |
// return maxActive;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setMaxActive(int maxActive) { |
// public void setMaxActive(int maxActive) {
|
||||||
this.maxActive = maxActive; |
// this.maxActive = maxActive;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public long getMaxWait() { |
// public long getMaxWait() {
|
||||||
return maxWait; |
// return maxWait;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setMaxWait(long maxWait) { |
// public void setMaxWait(long maxWait) {
|
||||||
this.maxWait = maxWait; |
// this.maxWait = maxWait;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public long getTimeBetweenEvictionRunsMillis() { |
// public long getTimeBetweenEvictionRunsMillis() {
|
||||||
return timeBetweenEvictionRunsMillis; |
// return timeBetweenEvictionRunsMillis;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { |
// public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
|
||||||
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; |
// this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public long getMinEvictableIdleTimeMillis() { |
// public long getMinEvictableIdleTimeMillis() {
|
||||||
return minEvictableIdleTimeMillis; |
// return minEvictableIdleTimeMillis;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) { |
// public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
|
||||||
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; |
// this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public String getValidationQuery() { |
// public String getValidationQuery() {
|
||||||
return validationQuery; |
// return validationQuery;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setValidationQuery(String validationQuery) { |
// public void setValidationQuery(String validationQuery) {
|
||||||
this.validationQuery = validationQuery; |
// this.validationQuery = validationQuery;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public boolean isTestWhileIdle() { |
// public boolean isTestWhileIdle() {
|
||||||
return testWhileIdle; |
// return testWhileIdle;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setTestWhileIdle(boolean testWhileIdle) { |
// public void setTestWhileIdle(boolean testWhileIdle) {
|
||||||
this.testWhileIdle = testWhileIdle; |
// this.testWhileIdle = testWhileIdle;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public boolean isTestOnBorrow() { |
// public boolean isTestOnBorrow() {
|
||||||
return testOnBorrow; |
// return testOnBorrow;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setTestOnBorrow(boolean testOnBorrow) { |
// public void setTestOnBorrow(boolean testOnBorrow) {
|
||||||
this.testOnBorrow = testOnBorrow; |
// this.testOnBorrow = testOnBorrow;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public boolean isTestOnReturn() { |
// public boolean isTestOnReturn() {
|
||||||
return testOnReturn; |
// return testOnReturn;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setTestOnReturn(boolean testOnReturn) { |
// public void setTestOnReturn(boolean testOnReturn) {
|
||||||
this.testOnReturn = testOnReturn; |
// this.testOnReturn = testOnReturn;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public boolean isPoolPreparedStatements() { |
// public boolean isPoolPreparedStatements() {
|
||||||
return poolPreparedStatements; |
// return poolPreparedStatements;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setPoolPreparedStatements(boolean poolPreparedStatements) { |
// public void setPoolPreparedStatements(boolean poolPreparedStatements) {
|
||||||
this.poolPreparedStatements = poolPreparedStatements; |
// this.poolPreparedStatements = poolPreparedStatements;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public int getMaxPoolPreparedStatementPerConnectionSize() { |
// public int getMaxPoolPreparedStatementPerConnectionSize() {
|
||||||
return maxPoolPreparedStatementPerConnectionSize; |
// return maxPoolPreparedStatementPerConnectionSize;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) { |
// public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) {
|
||||||
this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize; |
// this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public String getFilters() { |
// public String getFilters() {
|
||||||
return filters; |
// return filters;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setFilters(String filters) { |
// public void setFilters(String filters) {
|
||||||
this.filters = filters; |
// this.filters = filters;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public String getDriverClassName() { |
// public String getDriverClassName() {
|
||||||
return driverClassName; |
// return driverClassName;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setDriverClassName(String driverClassName) { |
// public void setDriverClassName(String driverClassName) {
|
||||||
this.driverClassName = driverClassName; |
// this.driverClassName = driverClassName;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public String getUrl() { |
// public String getUrl() {
|
||||||
return url; |
// return url;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setUrl(String url) { |
// public void setUrl(String url) {
|
||||||
this.url = url; |
// this.url = url;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public String getUsername() { |
// public String getUsername() {
|
||||||
return username; |
// return username;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setUsername(String username) { |
// public void setUsername(String username) {
|
||||||
this.username = username; |
// this.username = username;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public String getPassword() { |
// public String getPassword() {
|
||||||
return password; |
// return password;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
public void setPassword(String password) { |
// public void setPassword(String password) {
|
||||||
this.password = password; |
// this.password = password;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
} |
//}
|
||||||
|
@ -1,17 +1,17 @@ |
|||||||
package com.mh.user.config; |
//package com.mh.user.config;
|
||||||
|
//
|
||||||
import com.alibaba.druid.support.http.StatViewServlet; |
//import com.alibaba.druid.support.http.StatViewServlet;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* druid监控视图配置 |
// * druid监控视图配置
|
||||||
*/ |
// */
|
||||||
//@WebServlet(urlPatterns = "/druid/*", initParams={
|
////@WebServlet(urlPatterns = "/druid/*", initParams={
|
||||||
// @WebInitParam(name="allow",value="192.168.6.195"), // IP白名单 (没有配置或者为空,则允许所有访问)
|
//// @WebInitParam(name="allow",value="192.168.6.195"), // IP白名单 (没有配置或者为空,则允许所有访问)
|
||||||
// @WebInitParam(name="deny",value="192.168.6.73"), // IP黑名单 (存在共同时,deny优先于allow)
|
//// @WebInitParam(name="deny",value="192.168.6.73"), // IP黑名单 (存在共同时,deny优先于allow)
|
||||||
// @WebInitParam(name="loginUsername",value="admin"), // 用户名
|
//// @WebInitParam(name="loginUsername",value="admin"), // 用户名
|
||||||
// @WebInitParam(name="loginPassword",value="admin"), // 密码
|
//// @WebInitParam(name="loginPassword",value="admin"), // 密码
|
||||||
// @WebInitParam(name="resetEnable",value="true") // 禁用HTML页面上的“Reset All”功能
|
//// @WebInitParam(name="resetEnable",value="true") // 禁用HTML页面上的“Reset All”功能
|
||||||
//})
|
////})
|
||||||
public class DruidStatViewServlet extends StatViewServlet { |
//public class DruidStatViewServlet extends StatViewServlet {
|
||||||
private static final long serialVersionUID = 7359758657306626394L; |
// private static final long serialVersionUID = 7359758657306626394L;
|
||||||
} |
//}
|
@ -1,54 +1,53 @@ |
|||||||
package com.mh.user.config; |
//package com.mh.user.config;
|
||||||
|
//
|
||||||
import com.mh.user.job.JobFactory; |
//import lombok.extern.slf4j.Slf4j;
|
||||||
import lombok.extern.slf4j.Slf4j; |
//import org.quartz.Scheduler;
|
||||||
import org.quartz.Scheduler; |
//import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Configuration; |
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean; |
//
|
||||||
|
///**
|
||||||
/** |
// * @author ljf
|
||||||
* @author ljf |
// * @title : Quartz配置
|
||||||
* @title : Quartz配置 |
// * @description :
|
||||||
* @description : |
// * @updateTime 2020-04-03
|
||||||
* @updateTime 2020-04-03 |
// * @throws :
|
||||||
* @throws : |
// */
|
||||||
*/ |
//@Slf4j
|
||||||
@Slf4j |
//@Configuration
|
||||||
@Configuration |
//public class QuartzConfig {
|
||||||
public class QuartzConfig { |
//
|
||||||
|
// private JobFactory jobFactory;
|
||||||
private JobFactory jobFactory; |
//
|
||||||
|
// /**
|
||||||
/** |
// * @author jinhaoxun
|
||||||
* @author jinhaoxun |
// * @description 构造器
|
||||||
* @description 构造器 |
// * @param jobFactory
|
||||||
* @param jobFactory |
// */
|
||||||
*/ |
// public QuartzConfig(JobFactory jobFactory){
|
||||||
public QuartzConfig(JobFactory jobFactory){ |
// this.jobFactory = jobFactory;
|
||||||
this.jobFactory = jobFactory; |
// }
|
||||||
} |
//
|
||||||
|
// /**
|
||||||
/** |
// * @author jinhaoxun
|
||||||
* @author jinhaoxun |
// * @description 配置SchedulerFactoryBean,将一个方法产生为Bean并交给Spring容器管理
|
||||||
* @description 配置SchedulerFactoryBean,将一个方法产生为Bean并交给Spring容器管理 |
// * @return SchedulerFactoryBean
|
||||||
* @return SchedulerFactoryBean |
// */
|
||||||
*/ |
// @Bean
|
||||||
@Bean |
// public SchedulerFactoryBean schedulerFactoryBean() {
|
||||||
public SchedulerFactoryBean schedulerFactoryBean() { |
//// log.info("开始注入定时任务调度器工厂...");
|
||||||
// log.info("开始注入定时任务调度器工厂...");
|
// System.out.println("开始注入定时任务调度器工厂...");
|
||||||
System.out.println("开始注入定时任务调度器工厂..."); |
// SchedulerFactoryBean factory = new SchedulerFactoryBean();// Spring提供SchedulerFactoryBean为Scheduler提供配置信息,并被Spring容器管理其生命周期
|
||||||
SchedulerFactoryBean factory = new SchedulerFactoryBean();// Spring提供SchedulerFactoryBean为Scheduler提供配置信息,并被Spring容器管理其生命周期
|
// factory.setJobFactory(jobFactory);// 设置自定义Job Factory,用于Spring管理Job bean
|
||||||
factory.setJobFactory(jobFactory);// 设置自定义Job Factory,用于Spring管理Job bean
|
// factory.setOverwriteExistingJobs(true);// 覆盖存在的定时任务
|
||||||
factory.setOverwriteExistingJobs(true);// 覆盖存在的定时任务
|
// factory.setStartupDelay(30); //延时30秒启动定时任务,避免系统未完全启动却开始执行定时任务的情况
|
||||||
factory.setStartupDelay(30); //延时30秒启动定时任务,避免系统未完全启动却开始执行定时任务的情况
|
//// log.info("注入定时任务调度器工厂成功!");
|
||||||
// log.info("注入定时任务调度器工厂成功!");
|
// System.out.println("注入定时任务调度器工厂成功!");
|
||||||
System.out.println("注入定时任务调度器工厂成功!"); |
// return factory;
|
||||||
return factory; |
// }
|
||||||
} |
//
|
||||||
|
// @Bean(name = "scheduler")
|
||||||
@Bean(name = "scheduler") |
// public Scheduler scheduler() {
|
||||||
public Scheduler scheduler() { |
// return schedulerFactoryBean().getScheduler();
|
||||||
return schedulerFactoryBean().getScheduler(); |
// }
|
||||||
} |
//}
|
||||||
} |
|
||||||
|
@ -1,299 +0,0 @@ |
|||||||
package com.mh.user.controller; |
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject; |
|
||||||
import com.mh.common.http.HttpResult; |
|
||||||
import com.mh.user.annotation.SysLogger; |
|
||||||
import com.mh.user.dto.DeviceMessageDTO; |
|
||||||
import com.mh.user.entity.*; |
|
||||||
import com.mh.user.manage.QuartzManager; |
|
||||||
import com.mh.user.netty.NettyChillerControlClient; |
|
||||||
import com.mh.user.service.chillers.DeviceDisplayService; |
|
||||||
import com.mh.user.constants.Constant; |
|
||||||
import com.mh.user.service.chillers.DeviceManageService; |
|
||||||
import com.mh.user.service.chillers.DeviceParamService; |
|
||||||
import com.mh.user.service.chillers.GatewayManageService; |
|
||||||
import com.mh.user.utils.GetReadOrder485; |
|
||||||
import com.mh.user.utils.QuerySendThread; |
|
||||||
import com.mh.user.constants.SocketMessage; |
|
||||||
import com.mh.user.utils.TimeDifferenceUtil; |
|
||||||
import org.quartz.SchedulerException; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
|
|
||||||
import javax.annotation.Resource; |
|
||||||
import java.text.ParseException; |
|
||||||
import java.util.HashMap; |
|
||||||
import java.util.List; |
|
||||||
import java.util.Map; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ljf |
|
||||||
* @title : |
|
||||||
* @description : 设备管理接口 |
|
||||||
* @updateTime 2020-05-29 |
|
||||||
* @updateTime 2020-07-17 |
|
||||||
* @throws : |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
public class DeviceManageController { |
|
||||||
|
|
||||||
private final DeviceDisplayService deviceDisplayService; |
|
||||||
private final GatewayManageService gatewayManageService; |
|
||||||
private final DeviceManageService deviceManageService; |
|
||||||
private final DeviceParamService deviceParamService; |
|
||||||
|
|
||||||
public DeviceManageController(DeviceDisplayService deviceDisplayService, GatewayManageService gatewayManageService, DeviceManageService deviceManageService, DeviceParamService deviceParamService) { |
|
||||||
this.deviceDisplayService = deviceDisplayService; |
|
||||||
this.gatewayManageService = gatewayManageService; |
|
||||||
this.deviceManageService = deviceManageService; |
|
||||||
this.deviceParamService = deviceParamService; |
|
||||||
} |
|
||||||
|
|
||||||
@Resource |
|
||||||
QuartzManager quartzManager; |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private SocketMessage socketMessage; |
|
||||||
|
|
||||||
// 查询设备信息状态
|
|
||||||
@GetMapping("/operation/getColdStation") |
|
||||||
public HttpResult getColdStation(@RequestParam(value = "deviceType", required = true) String deviceType) { |
|
||||||
List<DeviceMessageDTO> deviceMessageList = deviceDisplayService.queryDeviceStatus(deviceType); |
|
||||||
Map<String, Object> formValues = new HashMap<>(); |
|
||||||
formValues.put("formValues",deviceMessageList); |
|
||||||
return HttpResult.ok("success", formValues); |
|
||||||
} |
|
||||||
|
|
||||||
// 对设备进行操作处理
|
|
||||||
@PostMapping("/operation/operationDevice") |
|
||||||
public HttpResult operationDevice(@RequestBody List<OrderEntity> changeValues) { |
|
||||||
String result; |
|
||||||
try { |
|
||||||
List<OrderMessageEntity> orderMessageEntityList; |
|
||||||
// type值 0:修改频率, 1:修改开关状态, 2: 关闭冷却泵之前,查询最近关闭的冷却塔时间,3: 群控手自动切换类型,4: 修改温度, 5: 修改压力
|
|
||||||
// // 添加网页发送指令状态 update by ljf on 2020-08-07
|
|
||||||
Constant.CONTROL_WEB_FLAG = true; |
|
||||||
// 暂停采集
|
|
||||||
// quartzManager.pauseJob("DDC","JobDDCGroup");
|
|
||||||
// Thread.sleep(2000);
|
|
||||||
// 修改成不用暂停采集处理
|
|
||||||
GetReadOrder485 getReadOrder485 = new GetReadOrder485(); |
|
||||||
// 判断是否是去关闭冷却泵,如果是,需要检查最近冷却塔有没有关闭并且关闭时间大于8分钟
|
|
||||||
// 判断changeValues大小
|
|
||||||
int size = changeValues.size(); |
|
||||||
int type = changeValues.get(0).getType(); |
|
||||||
if (type == 3 && size == 1) { |
|
||||||
// 生成指令
|
|
||||||
orderMessageEntityList = getReadOrder485.createOrder(changeValues); |
|
||||||
if (orderMessageEntityList.size() != 0) { |
|
||||||
// 开启发送指令
|
|
||||||
NettyChillerControlClient nettyChillerControlClient = new NettyChillerControlClient(); |
|
||||||
// nettyChillerControlClient.connect(8081, "192.168.1.131", orderMessageEntityList);
|
|
||||||
nettyChillerControlClient.connect(socketMessage.getPort(), socketMessage.getIP(), orderMessageEntityList); |
|
||||||
// 开启线程监测标志
|
|
||||||
QuerySendThread querySendThread = new QuerySendThread(); |
|
||||||
querySendThread.start(); |
|
||||||
if (Constant.SEND_STATUS) { |
|
||||||
result = "success"; |
|
||||||
} else { |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
} else { |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
} else if (type == 2 && size == 1) { |
|
||||||
TimeDifferenceUtil timeDifferenceUtil = new TimeDifferenceUtil(); |
|
||||||
Boolean a = timeDifferenceUtil.timeDifference(socketMessage.getOverTime()); |
|
||||||
if (a) { |
|
||||||
// 生成指令
|
|
||||||
orderMessageEntityList = getReadOrder485.createOrder(changeValues); |
|
||||||
if (orderMessageEntityList.size() != 0) { |
|
||||||
// 开启发送指令
|
|
||||||
NettyChillerControlClient nettyChillerControlClient = new NettyChillerControlClient(); |
|
||||||
// nettyChillerControlClient.connect(8081, "192.168.1.131", orderMessageEntityList);
|
|
||||||
nettyChillerControlClient.connect(socketMessage.getPort(), socketMessage.getIP(), orderMessageEntityList); |
|
||||||
// 开启线程监测标志
|
|
||||||
QuerySendThread querySendThread = new QuerySendThread(); |
|
||||||
querySendThread.start(); |
|
||||||
if (Constant.SEND_STATUS) { |
|
||||||
result = "success"; |
|
||||||
} else { |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
} else { |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
} else { |
|
||||||
result = "冷却塔关机还没有超过8分钟"; |
|
||||||
} |
|
||||||
} else { |
|
||||||
// 生成指令
|
|
||||||
orderMessageEntityList = getReadOrder485.createOrder(changeValues); |
|
||||||
if (orderMessageEntityList.size() != 0) { |
|
||||||
// 开启发送指令
|
|
||||||
NettyChillerControlClient nettyChillerControlClient = new NettyChillerControlClient(); |
|
||||||
// nettyChillerControlClient.connect(8081, "192.168.1.131", orderMessageEntityList);
|
|
||||||
nettyChillerControlClient.connect(socketMessage.getPort(), socketMessage.getIP(), orderMessageEntityList); |
|
||||||
// 开启线程监测标志
|
|
||||||
QuerySendThread querySendThread = new QuerySendThread(); |
|
||||||
querySendThread.start(); |
|
||||||
if (Constant.SEND_STATUS) { |
|
||||||
result = "success"; |
|
||||||
} else { |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
} else { |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
} |
|
||||||
Constant.CONTROL_WEB_FLAG = false; |
|
||||||
// 不需要停止采集
|
|
||||||
// Constant.WEB_FLAG = false;
|
|
||||||
// // 延迟5秒处理,等待线程处理数据
|
|
||||||
Thread.sleep(500); |
|
||||||
// // 重新开启定时采集
|
|
||||||
// quartzManager.resumeAllJob();
|
|
||||||
// quartzManager.resumeJob("DDC","JobDDCGroup");
|
|
||||||
} catch (InterruptedException | ParseException e) { |
|
||||||
e.printStackTrace(); |
|
||||||
result = "fail"; |
|
||||||
} |
|
||||||
// 异常情况处理
|
|
||||||
return HttpResult.ok(result); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询网关信息 |
|
||||||
* @param requestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/gateWay/getGateWayList") |
|
||||||
public HttpResult gateWayList(@RequestBody String requestJson){ |
|
||||||
JSONObject jsonObject =JSONObject.parseObject(requestJson); |
|
||||||
Integer operator = null; |
|
||||||
Integer grade = null; |
|
||||||
if(jsonObject.get("operator") != null){ |
|
||||||
if(jsonObject.get("operator").equals("中国移动")){ |
|
||||||
operator = 0; |
|
||||||
}else if(jsonObject.get("operator").equals("中国联通")){ |
|
||||||
operator = 1; |
|
||||||
}else if(jsonObject.get("operator").equals("中国电信")){ |
|
||||||
operator = 2; |
|
||||||
} |
|
||||||
} |
|
||||||
if(jsonObject.get("grade") != null){ |
|
||||||
if(jsonObject.get("grade").equals("正常")){ |
|
||||||
grade = 0; |
|
||||||
}else if(jsonObject.get("grade").equals("不在线")){ |
|
||||||
grade = 1; |
|
||||||
}else if(jsonObject.get("grade").equals("异常")){ |
|
||||||
grade = 2; |
|
||||||
} |
|
||||||
} |
|
||||||
List<GatewayManageEntity> gateWayList = gatewayManageService.queryByOther(grade,operator); |
|
||||||
JSONObject tableData = new JSONObject(); |
|
||||||
tableData.put("tableData",gateWayList); |
|
||||||
return HttpResult.ok(tableData); |
|
||||||
// System.out.println(requestJson);
|
|
||||||
// return null;
|
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增或更新网关信息 |
|
||||||
* @param reqestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/gateWay/addOrUpdateGateWayInfo") |
|
||||||
public HttpResult addOrUpdateGateWayInfo(@RequestBody GatewayManageEntity reqestJson){ |
|
||||||
try { |
|
||||||
System.out.println(reqestJson.toString()); |
|
||||||
gatewayManageService.addOrUpdateGateWayInfo(reqestJson); |
|
||||||
return HttpResult.ok(); |
|
||||||
} catch (Exception e) { |
|
||||||
e.printStackTrace(); |
|
||||||
return HttpResult.error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 删除网关/基表/基表参数信息 |
|
||||||
* @param requestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/device/deleteDeviceInfo") |
|
||||||
public HttpResult deleteDeviceInfo(@RequestBody String requestJson){ |
|
||||||
JSONObject jsonObject =JSONObject.parseObject(requestJson); |
|
||||||
System.out.println(jsonObject.get("deviceId")); |
|
||||||
try { |
|
||||||
deviceManageService.deleteDeviceInfo((Integer)jsonObject.get("deviceId"),jsonObject.get("deviceType").toString()); |
|
||||||
return HttpResult.ok(); |
|
||||||
} catch (Exception e) { |
|
||||||
e.printStackTrace(); |
|
||||||
return HttpResult.error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询基表管理中的基表数据 |
|
||||||
* @param requestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/baseMeter/getBaseMeterList") |
|
||||||
public HttpResult getBaseMeterList(@RequestBody String requestJson){ |
|
||||||
JSONObject jsonObject =JSONObject.parseObject(requestJson); |
|
||||||
List<DeviceManageEntity> list = deviceManageService.getDeviceByOther(jsonObject.get("deviceNum").toString()); |
|
||||||
JSONObject tableData = new JSONObject(); |
|
||||||
tableData.put("tableData",list); |
|
||||||
return HttpResult.ok(tableData); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 增加或更新基表信息数据 |
|
||||||
* @param requestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/baseMeter/addOrUpdateBaseMeter") |
|
||||||
public HttpResult addOrUpdateBaseMeter(@RequestBody DeviceManageEntity requestJson){ |
|
||||||
try { |
|
||||||
deviceManageService.addOrUpdateBaseMeter(requestJson); |
|
||||||
return HttpResult.ok(); |
|
||||||
} catch (Exception e) { |
|
||||||
e.printStackTrace(); |
|
||||||
return HttpResult.error("检查输入的设备码是否有误!"); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询基表参数管理中的基表参数数据 |
|
||||||
* @param requestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/baseMeterParam/getBaseMeterParamList") |
|
||||||
public HttpResult getBaseMeterParamList(@RequestBody String requestJson){ |
|
||||||
JSONObject jsonObject =JSONObject.parseObject(requestJson); |
|
||||||
System.out.println(jsonObject.get("baseMeterType")); |
|
||||||
String baseMeterType = (String) jsonObject.get("baseMeterType"); |
|
||||||
List<DeviceParameterEntity> list = deviceParamService.getBaseMeterParamList(baseMeterType); |
|
||||||
JSONObject tableData = new JSONObject(); |
|
||||||
tableData.put("tableData",list); |
|
||||||
return HttpResult.ok(tableData); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 添加或更新基表参数信息 |
|
||||||
* @param requestJson |
|
||||||
* @return |
|
||||||
*/ |
|
||||||
@PostMapping("/baseMeterParam/addOrUpdateBaseMeterParam") |
|
||||||
public HttpResult addOrUpdateBaseMeterParam(@RequestBody DeviceParameterEntity requestJson){ |
|
||||||
try { |
|
||||||
deviceParamService.addOrUpdateBaseMeterParam(requestJson); |
|
||||||
return HttpResult.ok(); |
|
||||||
} catch (Exception e) { |
|
||||||
e.printStackTrace(); |
|
||||||
return HttpResult.error(e.getMessage()); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.DevicesManageEntity; |
||||||
|
import com.mh.user.service.DevicesManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理控制层 |
||||||
|
* @date 2024-08-23 08:53:03 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/devicesManage") |
||||||
|
public class DevicesManageController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private DevicesManageService devicesManageService; |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "查询资产管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return devicesManageService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "编辑资产管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(DevicesManageEntity entity) { |
||||||
|
devicesManageService.update(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
DevicesManageEntity entity = devicesManageService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "添加资产管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(DevicesManageEntity entity) { |
||||||
|
devicesManageService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "删除资产管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
devicesManageService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.DeviceParamsEntity; |
||||||
|
import com.mh.user.service.DeviceParamsService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备参数管理控制层 |
||||||
|
* @date 2024-08-23 08:53:03 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/deviceParams") |
||||||
|
public class DevicesParamsController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private DeviceParamsService deviceParamsService; |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "查询资产管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return deviceParamsService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "编辑资产管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(DeviceParamsEntity entity) { |
||||||
|
deviceParamsService.update(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
DeviceParamsEntity entity = deviceParamsService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "添加资产管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(DeviceParamsEntity entity) { |
||||||
|
deviceParamsService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "删除资产管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
deviceParamsService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,61 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.GatewayManageEntity; |
||||||
|
import com.mh.user.service.GatewayManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 网关管理接口控制类 |
||||||
|
* @date 2024-08-22 17:19:21 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/gw") |
||||||
|
public class GatewayManageController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private GatewayManageService gatewayManageService; |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "查询网关管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return gatewayManageService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "编辑网关管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(GatewayManageEntity gatewayManageEntity) { |
||||||
|
gatewayManageService.update(gatewayManageEntity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
GatewayManageEntity gatewayManageEntity = gatewayManageService.findById(id); |
||||||
|
return HttpResult.ok(gatewayManageEntity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "添加网关管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(GatewayManageEntity gatewayManageEntity) { |
||||||
|
gatewayManageService.save(gatewayManageEntity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "删除网关管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
gatewayManageService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
import com.mh.user.service.MeterManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理控制层 |
||||||
|
* @date 2024-08-23 08:53:03 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/mtManage") |
||||||
|
public class MeterManageController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private MeterManageService meterManageService; |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "查询仪表管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return meterManageService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "编辑仪表管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(MeterManageEntity entity) { |
||||||
|
meterManageService.update(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
MeterManageEntity entity = meterManageService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "添加仪表管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(MeterManageEntity entity) { |
||||||
|
meterManageService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "删除仪表管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
meterManageService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.model.SysDict; |
||||||
|
import com.mh.user.service.SysDictService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 系统字典管理 |
||||||
|
* @date 2024-08-23 10:59:09 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/dict") |
||||||
|
public class SysDictController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private SysDictService sysDictService; |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "查询系统字典管理") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return sysDictService.findPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "编辑系统字典管理") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult update(SysDict entity) { |
||||||
|
sysDictService.updateByPrimaryKey(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Long id) { |
||||||
|
SysDict entity = sysDictService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "添加系统字典管理") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult save(SysDict entity) { |
||||||
|
sysDictService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "删除系统字典管理") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult delete(@RequestParam Long id) { |
||||||
|
sysDictService.deleteByPrimaryKey(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,77 +1,77 @@ |
|||||||
package com.mh.user.dynamic.config; |
//package com.mh.user.dynamic.config;
|
||||||
|
//
|
||||||
import com.alibaba.druid.pool.DruidDataSource; |
//import com.alibaba.druid.pool.DruidDataSource;
|
||||||
import com.mh.user.dynamic.datasource.DynamicDataSource; |
//import com.mh.user.dynamic.datasource.DynamicDataSource;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory; |
//import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
import org.mybatis.spring.SqlSessionFactoryBean; |
//import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
import org.mybatis.spring.SqlSessionTemplate; |
//import org.mybatis.spring.SqlSessionTemplate;
|
||||||
import org.mybatis.spring.annotation.MapperScan; |
//import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier; |
//import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.beans.factory.annotation.Value; |
//import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration; |
//import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
|
//
|
||||||
import javax.sql.DataSource; |
//import javax.sql.DataSource;
|
||||||
import java.util.HashMap; |
//import java.util.HashMap;
|
||||||
import java.util.Map; |
//import java.util.Map;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* @author chison |
// * @author chison
|
||||||
* @date 2020-04-02 09:39 |
// * @date 2020-04-02 09:39
|
||||||
* @Description |
// * @Description
|
||||||
*/ |
// */
|
||||||
@Configuration |
//@Configuration
|
||||||
@MapperScan("com.mh.*.mapper") // 扫描DAO
|
//@MapperScan("com.mh.*.mapper") // 扫描DAO
|
||||||
public class DataSourceConfig { |
//public class DataSourceConfig {
|
||||||
|
//
|
||||||
@Value("${spring.datasource.druid.url}") |
// @Value("${spring.datasource.druid.url}")
|
||||||
private String defaultDBUrl; |
// private String defaultDBUrl;
|
||||||
@Value("${spring.datasource.druid.username}") |
// @Value("${spring.datasource.druid.username}")
|
||||||
private String defaultDBUser; |
// private String defaultDBUser;
|
||||||
@Value("${spring.datasource.druid.password}") |
// @Value("${spring.datasource.druid.password}")
|
||||||
private String defaultDBPassword; |
// private String defaultDBPassword;
|
||||||
@Value("${spring.datasource.druid.driver-class-name}") |
// @Value("${spring.datasource.druid.driver-class-name}")
|
||||||
private String defaultDBDreiverName; |
// private String defaultDBDreiverName;
|
||||||
|
//
|
||||||
|
//
|
||||||
@Bean |
// @Bean
|
||||||
public DynamicDataSource dynamicDataSource() { |
// public DynamicDataSource dynamicDataSource() {
|
||||||
DynamicDataSource dynamicDataSource = DynamicDataSource.getInstance(); |
// DynamicDataSource dynamicDataSource = DynamicDataSource.getInstance();
|
||||||
|
//
|
||||||
DruidDataSource defaultDataSource = new DruidDataSource(); |
// DruidDataSource defaultDataSource = new DruidDataSource();
|
||||||
defaultDataSource.setUrl(defaultDBUrl); |
// defaultDataSource.setUrl(defaultDBUrl);
|
||||||
defaultDataSource.setUsername(defaultDBUser); |
// defaultDataSource.setUsername(defaultDBUser);
|
||||||
defaultDataSource.setPassword(defaultDBPassword); |
// defaultDataSource.setPassword(defaultDBPassword);
|
||||||
defaultDataSource.setDriverClassName(defaultDBDreiverName); |
// defaultDataSource.setDriverClassName(defaultDBDreiverName);
|
||||||
|
//
|
||||||
Map<Object,Object> map = new HashMap<>(); |
// Map<Object,Object> map = new HashMap<>();
|
||||||
map.put("default", defaultDataSource); |
// map.put("default", defaultDataSource);
|
||||||
dynamicDataSource.setTargetDataSources(map); |
// dynamicDataSource.setTargetDataSources(map);
|
||||||
dynamicDataSource.setDefaultTargetDataSource(defaultDataSource); |
// dynamicDataSource.setDefaultTargetDataSource(defaultDataSource);
|
||||||
|
//
|
||||||
return dynamicDataSource; |
// return dynamicDataSource;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
@Bean |
// @Bean
|
||||||
public SqlSessionFactory sqlSessionFactory( |
// public SqlSessionFactory sqlSessionFactory(
|
||||||
@Qualifier("dynamicDataSource") DataSource dynamicDataSource) |
// @Qualifier("dynamicDataSource") DataSource dynamicDataSource)
|
||||||
throws Exception { |
// throws Exception {
|
||||||
SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); |
// SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||||
bean.setDataSource(dynamicDataSource); |
// bean.setDataSource(dynamicDataSource);
|
||||||
bean.setTypeAliasesPackage("com.mh.*.model"); // 扫描Model
|
// bean.setTypeAliasesPackage("com.mh.*.model"); // 扫描Model
|
||||||
|
//
|
||||||
bean.setMapperLocations(new PathMatchingResourcePatternResolver() |
// bean.setMapperLocations(new PathMatchingResourcePatternResolver()
|
||||||
.getResources("classpath*:**/sqlmapper/*.xml")); |
// .getResources("classpath*:**/sqlmapper/*.xml"));
|
||||||
return bean.getObject(); |
// return bean.getObject();
|
||||||
|
//
|
||||||
} |
// }
|
||||||
|
//
|
||||||
@Bean(name = "sqlSessionTemplate") |
// @Bean(name = "sqlSessionTemplate")
|
||||||
public SqlSessionTemplate sqlSessionTemplate( |
// public SqlSessionTemplate sqlSessionTemplate(
|
||||||
@Qualifier("sqlSessionFactory") SqlSessionFactory sqlSessionFactory) |
// @Qualifier("sqlSessionFactory") SqlSessionFactory sqlSessionFactory)
|
||||||
throws Exception { |
// throws Exception {
|
||||||
return new SqlSessionTemplate(sqlSessionFactory); |
// return new SqlSessionTemplate(sqlSessionFactory);
|
||||||
} |
// }
|
||||||
|
//
|
||||||
} |
//}
|
||||||
|
@ -1,28 +1,28 @@ |
|||||||
package com.mh.user.dynamic.config; |
//package com.mh.user.dynamic.config;
|
||||||
|
//
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Bean;
|
||||||
import tk.mybatis.spring.mapper.MapperScannerConfigurer; |
//import tk.mybatis.spring.mapper.MapperScannerConfigurer;
|
||||||
|
//
|
||||||
import java.util.Properties; |
//import java.util.Properties;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* @author chison |
// * @author chison
|
||||||
* @date 2020-04-02 09:40 |
// * @date 2020-04-02 09:40
|
||||||
* @Description |
// * @Description
|
||||||
*/ |
// */
|
||||||
@EnableAutoConfiguration |
//@EnableAutoConfiguration
|
||||||
public class MyBatisMapperScannerConfig { |
//public class MyBatisMapperScannerConfig {
|
||||||
@Bean |
// @Bean
|
||||||
public MapperScannerConfigurer mapperScannerConfigurer() { |
// public MapperScannerConfigurer mapperScannerConfigurer() {
|
||||||
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer(); |
// MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
|
||||||
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory"); |
// mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
|
||||||
mapperScannerConfigurer.setBasePackage("com.mh.user.mapper"); |
// mapperScannerConfigurer.setBasePackage("com.mh.user.mapper");
|
||||||
Properties properties = new Properties(); |
// Properties properties = new Properties();
|
||||||
properties.setProperty("notEmpty", "false"); |
// properties.setProperty("notEmpty", "false");
|
||||||
properties.setProperty("IDENTITY", "MYSQL"); |
// properties.setProperty("IDENTITY", "MYSQL");
|
||||||
mapperScannerConfigurer.setProperties(properties); |
// mapperScannerConfigurer.setProperties(properties);
|
||||||
return mapperScannerConfigurer; |
// return mapperScannerConfigurer;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
} |
//}
|
||||||
|
@ -1,71 +1,71 @@ |
|||||||
package com.mh.user.dynamic.datasource; |
//package com.mh.user.dynamic.datasource;
|
||||||
|
//
|
||||||
import com.alibaba.druid.pool.DruidDataSource; |
//import com.alibaba.druid.pool.DruidDataSource;
|
||||||
import com.mh.user.entity.DBEntity; |
//import com.mh.user.entity.DBEntity;
|
||||||
|
//
|
||||||
import java.util.HashMap; |
//import java.util.HashMap;
|
||||||
import java.util.Map; |
//import java.util.Map;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* @author chison |
// * @author chison
|
||||||
* @date 2020-04-02 09:40 |
// * @date 2020-04-02 09:40
|
||||||
* @Description |
// * @Description
|
||||||
*/ |
// */
|
||||||
public class DataSourceObject { |
//public class DataSourceObject {
|
||||||
|
//
|
||||||
private Long MaxWait=6000L; |
// private Long MaxWait=6000L;
|
||||||
private Integer maxActive=10; |
// private Integer maxActive=10;
|
||||||
private Long timeBetweenEvictionRunsMillis=6000L; |
// private Long timeBetweenEvictionRunsMillis=6000L;
|
||||||
|
//
|
||||||
/** |
// /**
|
||||||
* 切换sqlserver数据库,并动态赋值 |
// * 切换sqlserver数据库,并动态赋值
|
||||||
* @param dbInfo |
// * @param dbInfo
|
||||||
* @param SourceName |
// * @param SourceName
|
||||||
*/ |
// */
|
||||||
public void SwitchMySQLDataSource(DBEntity dbInfo, String SourceName) { |
// public void SwitchMySQLDataSource(DBEntity dbInfo, String SourceName) {
|
||||||
System.out.println("mysql进入数据源切换"); |
// System.out.println("mysql进入数据源切换");
|
||||||
System.out.println("MaxWait:"+MaxWait); |
// System.out.println("MaxWait:"+MaxWait);
|
||||||
DruidDataSource dynamicDataSource = new DruidDataSource(); |
// DruidDataSource dynamicDataSource = new DruidDataSource();
|
||||||
dynamicDataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); |
// dynamicDataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
|
||||||
dynamicDataSource.setUrl("jdbc:mysql://"+dbInfo.getDB_IP()+":"+dbInfo.getDB_Port()+"/"+dbInfo.getDB_Names()+"?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&autoReconnect=true"); |
// dynamicDataSource.setUrl("jdbc:mysql://"+dbInfo.getDB_IP()+":"+dbInfo.getDB_Port()+"/"+dbInfo.getDB_Names()+"?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&autoReconnect=true");
|
||||||
dynamicDataSource.setUsername(dbInfo.getDB_UserName()); |
// dynamicDataSource.setUsername(dbInfo.getDB_UserName());
|
||||||
dynamicDataSource.setPassword(dbInfo.getDB_Pwd()); |
// dynamicDataSource.setPassword(dbInfo.getDB_Pwd());
|
||||||
dynamicDataSource.setMaxWait(MaxWait); |
// dynamicDataSource.setMaxWait(MaxWait);
|
||||||
dynamicDataSource.setMaxActive(maxActive); |
// dynamicDataSource.setMaxActive(maxActive);
|
||||||
dynamicDataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); |
// dynamicDataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
||||||
|
//
|
||||||
DynamicDataSource dataSource = DynamicDataSource.getInstance(); |
// DynamicDataSource dataSource = DynamicDataSource.getInstance();
|
||||||
Map<Object, Object> map=new HashMap<Object, Object>(); |
// Map<Object, Object> map=new HashMap<Object, Object>();
|
||||||
map.put(SourceName, dynamicDataSource); |
// map.put(SourceName, dynamicDataSource);
|
||||||
dataSource.setTargetDataSources(map); |
// dataSource.setTargetDataSources(map);
|
||||||
System.out.println(dynamicDataSource.getUrl()); |
// System.out.println(dynamicDataSource.getUrl());
|
||||||
System.out.println(SourceName); |
// System.out.println(SourceName);
|
||||||
} |
// }
|
||||||
/** |
// /**
|
||||||
* 第二个sqlserver数据库 |
// * 第二个sqlserver数据库
|
||||||
* @param dbInfo |
// * @param dbInfo
|
||||||
* @param SourceName |
// * @param SourceName
|
||||||
*/ |
// */
|
||||||
public void SwitchSQLServerDataSource(DBEntity dbInfo,String SourceName) { |
// public void SwitchSQLServerDataSource(DBEntity dbInfo,String SourceName) {
|
||||||
System.out.println("进入数据源切换"); |
// System.out.println("进入数据源切换");
|
||||||
System.out.println("MaxWait:"+MaxWait); |
// System.out.println("MaxWait:"+MaxWait);
|
||||||
DruidDataSource dynamicDataSource = new DruidDataSource(); |
// DruidDataSource dynamicDataSource = new DruidDataSource();
|
||||||
dynamicDataSource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); |
// dynamicDataSource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
||||||
dynamicDataSource.setUrl("jdbc:sqlserver://"+dbInfo.getDB_IP()+":"+dbInfo.getDB_Port()+";Databasename="+dbInfo.getDB_Names()); |
// dynamicDataSource.setUrl("jdbc:sqlserver://"+dbInfo.getDB_IP()+":"+dbInfo.getDB_Port()+";Databasename="+dbInfo.getDB_Names());
|
||||||
dynamicDataSource.setUsername(dbInfo.getDB_UserName()); |
// dynamicDataSource.setUsername(dbInfo.getDB_UserName());
|
||||||
dynamicDataSource.setPassword(dbInfo.getDB_Pwd()); |
// dynamicDataSource.setPassword(dbInfo.getDB_Pwd());
|
||||||
System.out.println(dbInfo.getDB_UserName()); |
// System.out.println(dbInfo.getDB_UserName());
|
||||||
System.out.println(dbInfo.getDB_Pwd()); |
// System.out.println(dbInfo.getDB_Pwd());
|
||||||
dynamicDataSource.setMaxWait(MaxWait); |
// dynamicDataSource.setMaxWait(MaxWait);
|
||||||
dynamicDataSource.setMaxActive(maxActive); |
// dynamicDataSource.setMaxActive(maxActive);
|
||||||
dynamicDataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); |
// dynamicDataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
|
||||||
|
//
|
||||||
DynamicDataSource dataSource = DynamicDataSource.getInstance(); |
// DynamicDataSource dataSource = DynamicDataSource.getInstance();
|
||||||
Map<Object, Object> map=new HashMap<Object, Object>(); |
// Map<Object, Object> map=new HashMap<Object, Object>();
|
||||||
map.put(SourceName, dynamicDataSource); |
// map.put(SourceName, dynamicDataSource);
|
||||||
dataSource.setTargetDataSources(map); |
// dataSource.setTargetDataSources(map);
|
||||||
|
//
|
||||||
System.out.println(dynamicDataSource.getUrl()); |
// System.out.println(dynamicDataSource.getUrl());
|
||||||
System.out.println(SourceName); |
// System.out.println(SourceName);
|
||||||
} |
// }
|
||||||
} |
//}
|
||||||
|
@ -0,0 +1,34 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 数据结果集基本类 |
||||||
|
* @date 2024-07-10 16:49:24 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class BaseResultEntity { |
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
private String deviceAddr; |
||||||
|
private String deviceType; |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
||||||
|
private Date curDate; |
||||||
|
private String curValue; |
||||||
|
private String funCode; |
||||||
|
private String registerAddr; |
||||||
|
private String registerName; |
||||||
|
private int grade; |
||||||
|
private String projectId; |
||||||
|
private String projectName; |
||||||
|
|
||||||
|
} |
@ -1,24 +1,7 @@ |
|||||||
package com.mh.user.entity; |
package com.mh.user.entity; |
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat; |
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
import lombok.Data; |
|
||||||
|
|
||||||
import java.util.Date; |
@TableName("data_result_ch") |
||||||
|
public class DataResultChEntity extends BaseResultEntity { |
||||||
@Data |
|
||||||
public class DataResultChEntity { |
|
||||||
|
|
||||||
private Long id; |
|
||||||
private String deviceAddr; |
|
||||||
private String deviceType; |
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
|
||||||
private Date curDate; |
|
||||||
// private String curDate;
|
|
||||||
private String curValue; |
|
||||||
private String funCode; |
|
||||||
private String registerAddr; |
|
||||||
private String registerName; |
|
||||||
private int grade; |
|
||||||
private String projectID; |
|
||||||
private String projectName; |
|
||||||
} |
} |
||||||
|
@ -0,0 +1,7 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
@TableName("data_result_ch") |
||||||
|
public class DataResultChillerEntity extends BaseResultEntity { |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@Data |
||||||
|
@TableName("data_result_cl") |
||||||
|
public class DataResultClBakEntity { |
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
private String deviceAddr; |
||||||
|
private String deviceType; |
||||||
|
private Date curDate; |
||||||
|
private BigDecimal curValue; |
||||||
|
private BigDecimal lastValue; |
||||||
|
private Date lastDate; |
||||||
|
private BigDecimal ratio; |
||||||
|
private BigDecimal calcValue; |
||||||
|
private int grade; |
||||||
|
private String havedUpdate; |
||||||
|
private String registerAddr; |
||||||
|
private String registerName; |
||||||
|
private String projectName; |
||||||
|
private String projectId; |
||||||
|
|
||||||
|
} |
@ -1,23 +1,32 @@ |
|||||||
package com.mh.user.entity; |
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
import lombok.Data; |
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
|
|
||||||
@Data |
@Data |
||||||
|
@TableName("data_result_cl") |
||||||
public class DataResultClEntity { |
public class DataResultClEntity { |
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
private Long id; |
private Long id; |
||||||
private String deviceAddr; |
private String deviceAddr; |
||||||
private String deviceType; |
private String deviceType; |
||||||
private double lastValue; |
|
||||||
private Date lastDate; |
|
||||||
private double curValue; |
|
||||||
private Date curDate; |
private Date curDate; |
||||||
private double ratio; |
private BigDecimal curValue; |
||||||
private double calcValue; |
private BigDecimal lastValue; |
||||||
|
private Date lastDate; |
||||||
|
private BigDecimal ratio; |
||||||
|
private BigDecimal calcValue; |
||||||
private int grade; |
private int grade; |
||||||
|
private String havedUpdate; |
||||||
private String registerAddr; |
private String registerAddr; |
||||||
private String registerName; |
private String registerName; |
||||||
private String projectName; |
private String projectName; |
||||||
private String projectID; |
private String projectId; |
||||||
|
|
||||||
} |
} |
||||||
|
@ -1,22 +1,32 @@ |
|||||||
package com.mh.user.entity; |
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
import lombok.Data; |
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
|
|
||||||
|
@TableName("data_result") |
||||||
@Data |
@Data |
||||||
public class DataResultEntity { |
public class DataResultEntity { |
||||||
|
|
||||||
|
/** |
||||||
|
* 主键 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
private Long id; |
private Long id; |
||||||
private String deviceAddr; |
private String deviceAddr; |
||||||
private String deviceType; |
private String deviceType; |
||||||
private double lastValue; |
private BigDecimal lastValue; |
||||||
private Date lastDate; |
private Date lastDate; |
||||||
private double curValue; |
private BigDecimal curValue; |
||||||
private Date curDate; |
private Date curDate; |
||||||
private double ratio; |
private BigDecimal ratio; |
||||||
private double calcValue; |
private BigDecimal calcValue; |
||||||
private int grade; |
private int grade; |
||||||
|
private String havedUpdate; |
||||||
private String projectName; |
private String projectName; |
||||||
private String projectID; |
private String projectId; |
||||||
} |
} |
||||||
|
@ -0,0 +1,7 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
@TableName("data_result_fifteen_mi") |
||||||
|
public class DataResultFifteenMiEntity extends BaseResultEntity { |
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
@TableName("data_result_five_mi") |
||||||
|
public class DataResultFiveMiEntity extends BaseResultEntity { |
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
@TableName("data_result_now") |
||||||
|
public class DataResultNowEntity extends BaseResultEntity { |
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
@TableName("data_result_one_mi") |
||||||
|
public class DataResultOneMiEntity extends BaseResultEntity { |
||||||
|
} |
@ -0,0 +1,130 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备基表安装信息 |
||||||
|
* @date 2024-07-11 13:57:36 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("device_code") |
||||||
|
public class DeviceCodeEntity { |
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 通讯编号 |
||||||
|
*/ |
||||||
|
private String deviceAddr; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备类型 |
||||||
|
*/ |
||||||
|
private String deviceType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 串口 |
||||||
|
*/ |
||||||
|
private String dataCom; |
||||||
|
|
||||||
|
/** |
||||||
|
* 端口 |
||||||
|
*/ |
||||||
|
private String dataPort; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备规格 |
||||||
|
*/ |
||||||
|
private String standard; |
||||||
|
|
||||||
|
/** |
||||||
|
* 安装位置 |
||||||
|
*/ |
||||||
|
private String installPosition; |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始值 |
||||||
|
*/ |
||||||
|
private BigDecimal initValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 倍率 |
||||||
|
*/ |
||||||
|
private BigDecimal ratio; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否时总表 |
||||||
|
*/ |
||||||
|
private String isTotal; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否停用 |
||||||
|
*/ |
||||||
|
private String isForbid; |
||||||
|
|
||||||
|
/** |
||||||
|
* 停用时间 |
||||||
|
*/ |
||||||
|
private Date forbidDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 上次抄表读数 |
||||||
|
*/ |
||||||
|
private BigDecimal lastValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 上次抄表时间 |
||||||
|
*/ |
||||||
|
private Date lastDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 级别 |
||||||
|
*/ |
||||||
|
private int grade; |
||||||
|
|
||||||
|
/** |
||||||
|
* 波特率 |
||||||
|
*/ |
||||||
|
private int baudRate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目ID |
||||||
|
*/ |
||||||
|
private String projectId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备名称 |
||||||
|
*/ |
||||||
|
private String deviceName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 品牌 |
||||||
|
*/ |
||||||
|
private String brand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 安装时间 |
||||||
|
*/ |
||||||
|
private Date installDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 奇偶校验 |
||||||
|
*/ |
||||||
|
private String parity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remarks; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,69 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备采集参数实体类 |
||||||
|
* @date 2024-08-22 17:04:12 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@TableName("device_params") |
||||||
|
public class DeviceParamsEntity { |
||||||
|
|
||||||
|
/** |
||||||
|
* 主键 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表类型(从字典表中拿) |
||||||
|
*/ |
||||||
|
private int mtType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 波特率 |
||||||
|
*/ |
||||||
|
private int baudRate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据位 |
||||||
|
*/ |
||||||
|
private int dataBit; |
||||||
|
|
||||||
|
/** |
||||||
|
* 停止位 |
||||||
|
*/ |
||||||
|
private int stopBit; |
||||||
|
|
||||||
|
/** |
||||||
|
* 校验位 |
||||||
|
*/ |
||||||
|
private String parity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "DeviceParamsEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", mtType=" + mtType + |
||||||
|
", baudRate=" + baudRate + |
||||||
|
", dataBit=" + dataBit + |
||||||
|
", stopBit=" + stopBit + |
||||||
|
", parity=" + parity + |
||||||
|
", remark='" + remark + '\'' + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,142 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 资产设备管理 |
||||||
|
* @date 2024-08-22 16:11:30 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@TableName("devices_manage") |
||||||
|
public class DevicesManageEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 编号 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备名称 |
||||||
|
*/ |
||||||
|
private String deviceName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备品牌 |
||||||
|
*/ |
||||||
|
private String deviceBrand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 机电品牌 |
||||||
|
*/ |
||||||
|
private String emBrand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定输入功率 |
||||||
|
*/ |
||||||
|
private BigDecimal ratedInputPower; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定制冷量 |
||||||
|
*/ |
||||||
|
private BigDecimal ratedRefrigerationCapacity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定COP |
||||||
|
*/ |
||||||
|
private BigDecimal ratedCop; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定流量 |
||||||
|
*/ |
||||||
|
private BigDecimal ratedFlow; |
||||||
|
|
||||||
|
/** |
||||||
|
* 生产日期 |
||||||
|
*/ |
||||||
|
private String productionTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间 |
||||||
|
*/ |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新时间 |
||||||
|
*/ |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
private Date updateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建人 |
||||||
|
*/ |
||||||
|
private String createBy; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否变频 |
||||||
|
*/ |
||||||
|
private byte isFrequency; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备类型 |
||||||
|
*/ |
||||||
|
private long deviceType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
|
||||||
|
/** |
||||||
|
* 等级 |
||||||
|
*/ |
||||||
|
private int grade; |
||||||
|
|
||||||
|
/** |
||||||
|
* 系统类型id |
||||||
|
*/ |
||||||
|
private Long systemId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目id |
||||||
|
*/ |
||||||
|
private Long projectId; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "DevicesManageEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", deviceName='" + deviceName + '\'' + |
||||||
|
", deviceBrand='" + deviceBrand + '\'' + |
||||||
|
", emBrand='" + emBrand + '\'' + |
||||||
|
", ratedInputPower=" + ratedInputPower + |
||||||
|
", ratedRefrigerationCapacity=" + ratedRefrigerationCapacity + |
||||||
|
", ratedCop=" + ratedCop + |
||||||
|
", ratedFlow=" + ratedFlow + |
||||||
|
", productionTime=" + productionTime + |
||||||
|
", createTime=" + createTime + |
||||||
|
", updateTime=" + updateTime + |
||||||
|
", createBy='" + createBy + '\'' + |
||||||
|
", isFrequency=" + isFrequency + |
||||||
|
", deviceType=" + deviceType + |
||||||
|
", remark='" + remark + '\'' + |
||||||
|
", grade=" + grade + |
||||||
|
", systemId=" + systemId + |
||||||
|
", projectId=" + projectId + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,228 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理 |
||||||
|
* @date 2024-08-22 16:35:19 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@TableName("meter_manage") |
||||||
|
public class MeterManageEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 编号 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表类型 |
||||||
|
*/ |
||||||
|
private Long mtType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表名称 |
||||||
|
*/ |
||||||
|
private String mtName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 其他名称 |
||||||
|
*/ |
||||||
|
private String otherName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表品牌 |
||||||
|
*/ |
||||||
|
private String mtBrand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表编号 |
||||||
|
*/ |
||||||
|
private String mtNum; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表地址 |
||||||
|
*/ |
||||||
|
private String mtCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 寄存器地址 |
||||||
|
*/ |
||||||
|
private String registerAddr; |
||||||
|
|
||||||
|
/** |
||||||
|
* 功能码 |
||||||
|
*/ |
||||||
|
private String funcCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据标识码 |
||||||
|
*/ |
||||||
|
private String identifyCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 口径以及脉冲常数 |
||||||
|
*/ |
||||||
|
private String mtCaliberPulse; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表范围 |
||||||
|
*/ |
||||||
|
private BigDecimal mtRange; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表比例 |
||||||
|
*/ |
||||||
|
private int mtRatio; |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始值 |
||||||
|
*/ |
||||||
|
private BigDecimal mtInitValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保留位数 |
||||||
|
*/ |
||||||
|
private int digits; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据类型 |
||||||
|
*/ |
||||||
|
private int dataType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 当前值 |
||||||
|
*/ |
||||||
|
private BigDecimal curValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 当前时间 |
||||||
|
*/ |
||||||
|
private Date curTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否是总表 |
||||||
|
*/ |
||||||
|
private byte mtIsSum; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间 |
||||||
|
*/ |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新时间 |
||||||
|
*/ |
||||||
|
private Date updateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单位 |
||||||
|
*/ |
||||||
|
private String unit; |
||||||
|
|
||||||
|
/** |
||||||
|
* 排序 |
||||||
|
*/ |
||||||
|
private Long sort; |
||||||
|
|
||||||
|
/** |
||||||
|
* 通讯串口 |
||||||
|
*/ |
||||||
|
private String dataCom; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备id |
||||||
|
*/ |
||||||
|
private Long deviceId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 网关id |
||||||
|
*/ |
||||||
|
private Long gatewayId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 参数id |
||||||
|
*/ |
||||||
|
private Long paramId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 协议类型 |
||||||
|
*/ |
||||||
|
private Long protocolType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保留位 |
||||||
|
*/ |
||||||
|
private int grade; |
||||||
|
|
||||||
|
/** |
||||||
|
* 系统类型id |
||||||
|
*/ |
||||||
|
private Long systemId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目id |
||||||
|
*/ |
||||||
|
private Long projectId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 通讯类型 |
||||||
|
*/ |
||||||
|
private Long communicationType; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "MeterManageEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", mtType=" + mtType + |
||||||
|
", mtName='" + mtName + '\'' + |
||||||
|
", otherName='" + otherName + '\'' + |
||||||
|
", mtBrand='" + mtBrand + '\'' + |
||||||
|
", mtNum='" + mtNum + '\'' + |
||||||
|
", mtCode='" + mtCode + '\'' + |
||||||
|
", registerAddr='" + registerAddr + '\'' + |
||||||
|
", funcCode='" + funcCode + '\'' + |
||||||
|
", identifyCode='" + identifyCode + '\'' + |
||||||
|
", mtCaliberPulse='" + mtCaliberPulse + '\'' + |
||||||
|
", mtRange=" + mtRange + |
||||||
|
", mtRatio=" + mtRatio + |
||||||
|
", mtInitValue=" + mtInitValue + |
||||||
|
", digits=" + digits + |
||||||
|
", dataType=" + dataType + |
||||||
|
", curValue=" + curValue + |
||||||
|
", curTime=" + curTime + |
||||||
|
", mtIsSum=" + mtIsSum + |
||||||
|
", createTime=" + createTime + |
||||||
|
", updateTime=" + updateTime + |
||||||
|
", unit='" + unit + '\'' + |
||||||
|
", sort=" + sort + |
||||||
|
", dataCom='" + dataCom + '\'' + |
||||||
|
", deviceId=" + deviceId + |
||||||
|
", gatewayId=" + gatewayId + |
||||||
|
", paramId=" + paramId + |
||||||
|
", protocolType=" + protocolType + |
||||||
|
", remark='" + remark + '\'' + |
||||||
|
", grade=" + grade + |
||||||
|
", systemId=" + systemId + |
||||||
|
", projectId=" + projectId + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
} |
@ -1,18 +1,192 @@ |
|||||||
package com.mh.user.entity; |
package com.mh.user.entity; |
||||||
|
|
||||||
import lombok.Data; |
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
@Data |
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@TableName("project_info") |
||||||
public class ProjectInfoEntity { |
public class ProjectInfoEntity { |
||||||
|
|
||||||
private String id; |
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@TableField("project_name") |
||||||
private String projectName; //项目名称
|
private String projectName; //项目名称
|
||||||
|
|
||||||
|
@TableField("p_address") |
||||||
private String pAddress; //地址
|
private String pAddress; //地址
|
||||||
|
|
||||||
|
@TableField("p_scale") |
||||||
private int pScale; |
private int pScale; |
||||||
private String pic; //图片
|
|
||||||
|
@TableField("pic") |
||||||
|
private String pic; //图片地址
|
||||||
|
|
||||||
|
@TableField("pic_content") |
||||||
|
private String picContent; // 图片内容
|
||||||
|
|
||||||
|
@TableField("tel") |
||||||
private String tel; //电话
|
private String tel; //电话
|
||||||
private String systemID; //系统编号
|
|
||||||
|
@TableField("system_id") |
||||||
|
private String systemId; //系统编号
|
||||||
|
|
||||||
|
@TableField("remarks") |
||||||
private String remarks; |
private String remarks; |
||||||
|
|
||||||
|
/** |
||||||
|
* 经度 |
||||||
|
*/ |
||||||
|
@TableField("longitude") |
||||||
|
private BigDecimal longitude; |
||||||
|
|
||||||
|
/** |
||||||
|
* 纬度 |
||||||
|
*/ |
||||||
|
@TableField("latitude") |
||||||
|
private BigDecimal latitude; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间 |
||||||
|
*/ |
||||||
|
@TableField("create_time") |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文件流 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
@JsonIgnore |
||||||
|
private MultipartFile file; |
||||||
|
|
||||||
|
public Long getId() { |
||||||
|
return id; |
||||||
|
} |
||||||
|
|
||||||
|
public void setId(Long id) { |
||||||
|
this.id = id; |
||||||
|
} |
||||||
|
|
||||||
|
public String getProjectName() { |
||||||
|
return projectName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setProjectName(String projectName) { |
||||||
|
this.projectName = projectName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getpAddress() { |
||||||
|
return pAddress; |
||||||
|
} |
||||||
|
|
||||||
|
public void setpAddress(String pAddress) { |
||||||
|
this.pAddress = pAddress; |
||||||
|
} |
||||||
|
|
||||||
|
public int getpScale() { |
||||||
|
return pScale; |
||||||
|
} |
||||||
|
|
||||||
|
public void setpScale(int pScale) { |
||||||
|
this.pScale = pScale; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPic() { |
||||||
|
return pic; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPic(String pic) { |
||||||
|
this.pic = pic; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPicContent() { |
||||||
|
return picContent; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPicContent(String picContent) { |
||||||
|
this.picContent = picContent; |
||||||
|
} |
||||||
|
|
||||||
|
public String getTel() { |
||||||
|
return tel; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTel(String tel) { |
||||||
|
this.tel = tel; |
||||||
|
} |
||||||
|
|
||||||
|
public String getSystemId() { |
||||||
|
return systemId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setSystemId(String systemId) { |
||||||
|
this.systemId = systemId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getRemarks() { |
||||||
|
return remarks; |
||||||
|
} |
||||||
|
|
||||||
|
public void setRemarks(String remarks) { |
||||||
|
this.remarks = remarks; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getLongitude() { |
||||||
|
return longitude; |
||||||
|
} |
||||||
|
|
||||||
|
public void setLongitude(BigDecimal longitude) { |
||||||
|
this.longitude = longitude; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getLatitude() { |
||||||
|
return latitude; |
||||||
|
} |
||||||
|
|
||||||
|
public void setLatitude(BigDecimal latitude) { |
||||||
|
this.latitude = latitude; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getCreateTime() { |
||||||
|
return createTime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) { |
||||||
|
this.createTime = createTime; |
||||||
|
} |
||||||
|
|
||||||
|
public MultipartFile getFile() { |
||||||
|
return file; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFile(MultipartFile file) { |
||||||
|
this.file = file; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "ProjectInfoEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", projectName='" + projectName + '\'' + |
||||||
|
", pAddress='" + pAddress + '\'' + |
||||||
|
", pScale=" + pScale + |
||||||
|
", pic='" + pic + '\'' + |
||||||
|
", picContent='" + picContent + '\'' + |
||||||
|
", tel='" + tel + '\'' + |
||||||
|
", systemId='" + systemId + '\'' + |
||||||
|
", remarks='" + remarks + '\'' + |
||||||
|
", longitude=" + longitude + |
||||||
|
", latitude=" + latitude + |
||||||
|
", createTime=" + createTime + |
||||||
|
", file=" + file + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
|
@ -1,14 +1,77 @@ |
|||||||
package com.mh.user.entity; |
package com.mh.user.entity; |
||||||
|
|
||||||
import lombok.Data; |
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
@Data |
@TableName("strategy_info") |
||||||
public class StrategyInfoEntity { |
public class StrategyInfoEntity { |
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
private Long id; |
private Long id; |
||||||
private String dataAnalysis; |
private String dataAnalysis; |
||||||
private String operationOpt; |
private String operationOpt; |
||||||
private String controlOpt; |
private String controlOpt; |
||||||
private String projectID; |
private String projectId; |
||||||
private String systemID; |
private String systemId; |
||||||
|
|
||||||
|
public Long getId() { |
||||||
|
return id; |
||||||
|
} |
||||||
|
|
||||||
|
public void setId(Long id) { |
||||||
|
this.id = id; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataAnalysis() { |
||||||
|
return dataAnalysis; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataAnalysis(String dataAnalysis) { |
||||||
|
this.dataAnalysis = dataAnalysis; |
||||||
|
} |
||||||
|
|
||||||
|
public String getOperationOpt() { |
||||||
|
return operationOpt; |
||||||
|
} |
||||||
|
|
||||||
|
public void setOperationOpt(String operationOpt) { |
||||||
|
this.operationOpt = operationOpt; |
||||||
|
} |
||||||
|
|
||||||
|
public String getControlOpt() { |
||||||
|
return controlOpt; |
||||||
|
} |
||||||
|
|
||||||
|
public void setControlOpt(String controlOpt) { |
||||||
|
this.controlOpt = controlOpt; |
||||||
|
} |
||||||
|
|
||||||
|
public String getProjectId() { |
||||||
|
return projectId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setProjectId(String projectId) { |
||||||
|
this.projectId = projectId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getSystemId() { |
||||||
|
return systemId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setSystemId(String systemId) { |
||||||
|
this.systemId = systemId; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "StrategyInfoEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", dataAnalysis='" + dataAnalysis + '\'' + |
||||||
|
", operationOpt='" + operationOpt + '\'' + |
||||||
|
", controlOpt='" + controlOpt + '\'' + |
||||||
|
", projectId='" + projectId + '\'' + |
||||||
|
", systemId='" + systemId + '\'' + |
||||||
|
'}'; |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,39 +0,0 @@ |
|||||||
package com.mh.user.job; |
|
||||||
|
|
||||||
import com.mh.user.constants.SocketMessage; |
|
||||||
import lombok.SneakyThrows; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.quartz.DisallowConcurrentExecution; |
|
||||||
import org.quartz.Job; |
|
||||||
import org.quartz.JobExecutionContext; |
|
||||||
import org.quartz.JobExecutionException; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ljf |
|
||||||
* @title : |
|
||||||
* @description :定时采集冷水机组参数 |
|
||||||
* @updateTime 2020-06-24 |
|
||||||
* @throws : |
|
||||||
*/ |
|
||||||
/** |
|
||||||
* :@DisallowConcurrentExecution : 此标记用在实现Job的类上面,意思是不允许并发执行. |
|
||||||
* :注意org.quartz.threadPool.threadCount线程池中线程的数量至少要多个,否则@DisallowConcurrentExecution不生效 |
|
||||||
* :假如Job的设置时间间隔为3秒,但Job执行时间是5秒,设置@DisallowConcurrentExecution以后程序会等任务执行完毕以后再去执行, |
|
||||||
* 否则会在3秒时再启用新的线程执行 |
|
||||||
*/ |
|
||||||
@DisallowConcurrentExecution |
|
||||||
@Slf4j |
|
||||||
public class JobChillers implements Job { |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private SocketMessage socketMessage; |
|
||||||
|
|
||||||
@SneakyThrows |
|
||||||
@Override |
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
|
||||||
log.info("定时采集冷水机组"); |
|
||||||
// NettyChillerClient nettyChillerClient = new NettyChillerClient();
|
|
||||||
|
|
||||||
} |
|
||||||
} |
|
@ -1,41 +0,0 @@ |
|||||||
package com.mh.user.job; |
|
||||||
|
|
||||||
import com.mh.user.netty.NettyClient; |
|
||||||
import com.mh.user.constants.SocketMessage; |
|
||||||
import lombok.SneakyThrows; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.quartz.DisallowConcurrentExecution; |
|
||||||
import org.quartz.Job; |
|
||||||
import org.quartz.JobExecutionContext; |
|
||||||
import org.quartz.JobExecutionException; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ljf |
|
||||||
* @title : |
|
||||||
* @description : 定时采集冷量计任务 |
|
||||||
* @updateTime 2020-05-18 |
|
||||||
* @throws : |
|
||||||
*/ |
|
||||||
/** |
|
||||||
* :@DisallowConcurrentExecution : 此标记用在实现Job的类上面,意思是不允许并发执行. |
|
||||||
* :注意org.quartz.threadPool.threadCount线程池中线程的数量至少要多个,否则@DisallowConcurrentExecution不生效 |
|
||||||
* :假如Job的设置时间间隔为3秒,但Job执行时间是5秒,设置@DisallowConcurrentExecution以后程序会等任务执行完毕以后再去执行, |
|
||||||
* 否则会在3秒时再启用新的线程执行 |
|
||||||
*/ |
|
||||||
@DisallowConcurrentExecution |
|
||||||
@Slf4j |
|
||||||
public class JobCloud implements Job { |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private SocketMessage socketMessage; |
|
||||||
|
|
||||||
@SneakyThrows |
|
||||||
@Override |
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
|
||||||
// 定时采集冷量计
|
|
||||||
log.info("定时采集冷量计"); |
|
||||||
NettyClient nettyClient = new NettyClient(); |
|
||||||
nettyClient.connect(socketMessage.getPort(),socketMessage.getIP()); |
|
||||||
} |
|
||||||
} |
|
@ -1,39 +0,0 @@ |
|||||||
package com.mh.user.job; |
|
||||||
|
|
||||||
import com.mh.user.constants.SocketMessage; |
|
||||||
import com.mh.user.netty.NettyChillerDDCClient; |
|
||||||
import lombok.SneakyThrows; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.quartz.DisallowConcurrentExecution; |
|
||||||
import org.quartz.Job; |
|
||||||
import org.quartz.JobExecutionContext; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ljf |
|
||||||
* @title : 定时采集DDC设备 |
|
||||||
* @description : |
|
||||||
* @updateTime 2020-06-09 |
|
||||||
* @throws : |
|
||||||
*/ |
|
||||||
/** |
|
||||||
* :@DisallowConcurrentExecution : 此标记用在实现Job的类上面,意思是不允许并发执行. |
|
||||||
* :注意org.quartz.threadPool.threadCount线程池中线程的数量至少要多个,否则@DisallowConcurrentExecution不生效 |
|
||||||
* :假如Job的设置时间间隔为3秒,但Job执行时间是5秒,设置@DisallowConcurrentExecution以后程序会等任务执行完毕以后再去执行, |
|
||||||
* 否则会在3秒时再启用新的线程执行 |
|
||||||
*/ |
|
||||||
@DisallowConcurrentExecution |
|
||||||
@Slf4j |
|
||||||
public class JobDDC implements Job { |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private SocketMessage socketMessage; |
|
||||||
|
|
||||||
@SneakyThrows |
|
||||||
@Override |
|
||||||
public void execute(JobExecutionContext jobExecutionContext) { |
|
||||||
log.info("定时采集DDC设备"); |
|
||||||
// NettyChillerDDCClient nettyChillerDDCClient = new NettyChillerDDCClient();
|
|
||||||
NettyChillerDDCClient.connect(socketMessage.getPort(), socketMessage.getIP()); |
|
||||||
} |
|
||||||
} |
|
@ -1,45 +0,0 @@ |
|||||||
package com.mh.user.job; |
|
||||||
|
|
||||||
import org.quartz.spi.TriggerFiredBundle; |
|
||||||
import org.springframework.beans.factory.config.AutowireCapableBeanFactory; |
|
||||||
import org.springframework.scheduling.quartz.AdaptableJobFactory; |
|
||||||
import org.springframework.stereotype.Component; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ljf |
|
||||||
* @title :创建JobFactory实例 |
|
||||||
* @description : |
|
||||||
* @updateTime 2020-04-03 |
|
||||||
* @throws : |
|
||||||
*/ |
|
||||||
@Component |
|
||||||
public class JobFactory extends AdaptableJobFactory { |
|
||||||
|
|
||||||
/** |
|
||||||
* AutowireCapableBeanFactory接口是BeanFactory的子类 |
|
||||||
* 可以连接和填充那些生命周期不被Spring管理的已存在的bean实例 |
|
||||||
*/ |
|
||||||
private AutowireCapableBeanFactory factory; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author jinhaoxun |
|
||||||
* @description 构造器 |
|
||||||
* @param factory |
|
||||||
*/ |
|
||||||
public JobFactory(AutowireCapableBeanFactory factory) { |
|
||||||
this.factory = factory; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* @author jinhaoxun |
|
||||||
* @description 创建Job实例 |
|
||||||
* @param bundle |
|
||||||
* @return Object |
|
||||||
*/ |
|
||||||
@Override |
|
||||||
protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { |
|
||||||
Object job = super.createJobInstance(bundle);// 实例化对象
|
|
||||||
factory.autowireBean(job);// 进行注入(Spring管理该Bean)
|
|
||||||
return job;//返回对象
|
|
||||||
} |
|
||||||
} |
|
@ -1,39 +0,0 @@ |
|||||||
package com.mh.user.job; |
|
||||||
|
|
||||||
import com.mh.user.netty.NettyMeterClient; |
|
||||||
import com.mh.user.constants.SocketMessage; |
|
||||||
import lombok.SneakyThrows; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.quartz.DisallowConcurrentExecution; |
|
||||||
import org.quartz.Job; |
|
||||||
import org.quartz.JobExecutionContext; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author ljf |
|
||||||
* @title : |
|
||||||
* @description : 定时采集电表数据任务 |
|
||||||
* @updateTime 2020-05-18 |
|
||||||
* @throws : |
|
||||||
*/ |
|
||||||
/** |
|
||||||
* :@DisallowConcurrentExecution : 此标记用在实现Job的类上面,意思是不允许并发执行. |
|
||||||
* :注意org.quartz.threadPool.threadCount线程池中线程的数量至少要多个,否则@DisallowConcurrentExecution不生效 |
|
||||||
* :假如Job的设置时间间隔为3秒,但Job执行时间是5秒,设置@DisallowConcurrentExecution以后程序会等任务执行完毕以后再去执行, |
|
||||||
* 否则会在3秒时再启用新的线程执行 |
|
||||||
*/ |
|
||||||
@DisallowConcurrentExecution |
|
||||||
@Slf4j |
|
||||||
public class JobMeter implements Job { |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private SocketMessage socketMessage; |
|
||||||
|
|
||||||
@SneakyThrows |
|
||||||
@Override |
|
||||||
public void execute(JobExecutionContext jobExecutionContext) { |
|
||||||
log.info("定时采集电表数据任务开始"); |
|
||||||
NettyMeterClient nettyMeterClient = new NettyMeterClient(); |
|
||||||
nettyMeterClient.connect(socketMessage.getPort(), socketMessage.getIP()); |
|
||||||
} |
|
||||||
} |
|
@ -1,32 +0,0 @@ |
|||||||
package com.mh.user.job; |
|
||||||
|
|
||||||
import com.mh.user.constants.Constant; |
|
||||||
import lombok.SneakyThrows; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.quartz.DisallowConcurrentExecution; |
|
||||||
import org.quartz.Job; |
|
||||||
import org.quartz.JobExecutionContext; |
|
||||||
import org.quartz.JobExecutionException; |
|
||||||
|
|
||||||
/** |
|
||||||
* :@DisallowConcurrentExecution : 此标记用在实现Job的类上面,意思是不允许并发执行. |
|
||||||
* :注意org.quartz.threadPool.threadCount线程池中线程的数量至少要多个,否则@DisallowConcurrentExecution不生效 |
|
||||||
* :假如Job的设置时间间隔为3秒,但Job执行时间是5秒,设置@DisallowConcurrentExecution以后程序会等任务执行完毕以后再去执行, |
|
||||||
* 否则会在3秒时再启用新的线程执行 |
|
||||||
*/ |
|
||||||
@DisallowConcurrentExecution |
|
||||||
@Slf4j |
|
||||||
public class JobTest implements Job { |
|
||||||
@SneakyThrows |
|
||||||
@Override |
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
|
||||||
for (int i = 0; i < 30; i++) { |
|
||||||
if (Constant.FLAG) { |
|
||||||
break; |
|
||||||
} |
|
||||||
Thread.sleep(1000); |
|
||||||
log.info("第" + i + "个," +jobExecutionContext.getJobDetail()+"---------------------定时任务测试----------------------"); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,73 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultClEntity; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 数据冷量计 |
||||||
|
* @date 2024-07-10 15:20:55 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultChMapper extends BaseMapper<DataResultChEntity> { |
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
//保存冷量计数据
|
||||||
|
@Insert("insert into data_result_ch(device_addr,device_type,fun_code,register_addr,register_name,cur_value,cur_date,project_id,grade) values (" + |
||||||
|
" #{deviceAddr},#{deviceType},#{funCode},#{registerAddr},#{registerName},#{curValue},#{curDate},#{projectId},#{grade})") |
||||||
|
void saveDataResultCh(DataResultChEntity dataResultChEntity); |
||||||
|
|
||||||
|
@Update("<script>" + |
||||||
|
" update data_result_ch set " + |
||||||
|
" <if test='deviceAddr!=null'> device_addr = #{deviceAddr} </if>" + |
||||||
|
" <if test='deviceType!=null'> , device_type = #{deviceType} </if>" + |
||||||
|
" <if test='funCode!=null'> , fun_code = #{funCode} </if>" + |
||||||
|
" <if test='registerAddr!=null'> , register_addr = #{registerAddr} </if>" + |
||||||
|
" <if test='registerName!=null'> , register_name = #{registerName} </if>" + |
||||||
|
" <if test='curValue!=null'> , cur_value = #{curValue} </if>" + |
||||||
|
" <if test='projectId!=null'> , project_id = #{projectId} </if>" + |
||||||
|
" <if test='grade!=null'> , grade = #{grade} </if>" + |
||||||
|
" where cur_date=#{curDate} and device_addr=#{deviceAddr} and device_type=#{deviceType}" + |
||||||
|
"</script>") |
||||||
|
void updateDataResultCh(DataResultChEntity dataResultChEntity); |
||||||
|
|
||||||
|
@Select("select count(*) from data_result_ch " + |
||||||
|
" where cur_date=#{curDate} " + |
||||||
|
" and device_addr=#{deviceAddr} " + |
||||||
|
" and register_addr=#{registerAddr} " + |
||||||
|
" and project_id=#{projectId} " + |
||||||
|
" and grade = #{grade} ") |
||||||
|
int selectDataResultChCount(@Param("curDate") String curDate, |
||||||
|
@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("registerAddr") String registerAddr, |
||||||
|
@Param("projectId") String projectId, |
||||||
|
@Param("grade") int grade); |
||||||
|
|
||||||
|
@Select("select " + |
||||||
|
" t1.project_id, " + |
||||||
|
" sum(cast (t1.curValue AS decimal(18, 2)))as cur_value, " + |
||||||
|
" t1.cur_date, " + |
||||||
|
" t2.project_name " + |
||||||
|
"from " + |
||||||
|
" data_result_ch t1 " + |
||||||
|
"join project_info t2 on " + |
||||||
|
" t1.project_id = t2.id " + |
||||||
|
"where " + |
||||||
|
" t1.project_id = #{projectId} " + |
||||||
|
" and t1.cur_date >= #{startDate} " + |
||||||
|
" and t1.cur_date <= #{curDate} " + |
||||||
|
"group by " + |
||||||
|
" t1.cur_date, " + |
||||||
|
" t1.project_id, " + |
||||||
|
" t2.project_name " + |
||||||
|
"order by " + |
||||||
|
" t1.cur_date ") |
||||||
|
List<DataResultChEntity> queryDataResultCh(@Param("projectId") String projectId, @Param("startDate") String startDate, @Param("curDate") String curDate); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,105 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultChillerEntity; |
||||||
|
import com.mh.user.mapper.provider.DataResultProvider; |
||||||
|
import com.mh.user.model.ChillerModel; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 主机参数保存 |
||||||
|
* @date 2024-07-10 15:41:15 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultChillerMapper extends BaseMapper<DataResultChillerEntity> { |
||||||
|
|
||||||
|
//保存冷水机数据
|
||||||
|
@Insert("insert into data_result_chiller(device_addr,device_type,fun_code,register_addr,register_name,cur_value,cur_date,project_id,grade) values (" + |
||||||
|
" #{deviceAddr},#{deviceType},#{funCode},#{registerAddr},#{registerName},#{curValue},#{curDate},#{projectId},#{grade})") |
||||||
|
void saveDataResultChiller(DataResultChEntity dataResultChEntity); |
||||||
|
|
||||||
|
@Update("<script>" + |
||||||
|
" update data_result_chiller set " + |
||||||
|
" <if test='deviceAddr!=null'> device_addr = #{deviceAddr} </if>" + |
||||||
|
" <if test='deviceType!=null'> , device_type = #{deviceType} </if>" + |
||||||
|
" <if test='funCode!=null'> , fun_code = #{funCode} </if>" + |
||||||
|
" <if test='registerAddr!=null'> , register_addr = #{registerAddr} </if>" + |
||||||
|
" <if test='registerName!=null'> , register_name = #{registerName} </if>" + |
||||||
|
" <if test='curValue!=null'> , cur_value = #{curValue} </if>" + |
||||||
|
" <if test='projectId!=null'> , project_id = #{projectId} </if>" + |
||||||
|
" <if test='grade!=null'> , grade = #{grade} </if>" + |
||||||
|
" where cur_date=#{curDate} and device_addr=#{deviceAddr} and register_addr=#{registerAddr} and project_id=#{projectId} " + |
||||||
|
"</script>") |
||||||
|
void updateDataResultChiller(DataResultChEntity dataResultChEntity); |
||||||
|
|
||||||
|
@Select("select count(*) from data_result_chiller where cur_date=#{curDate} " + |
||||||
|
" and device_addr=#{deviceAddr} " + |
||||||
|
" and register_addr=#{registerAddr} " + |
||||||
|
" and project_id=#{projectId} " + |
||||||
|
" and fun_code = #{funCode} ") |
||||||
|
int selectDataResultChillerCount(@Param("curDate") String curDate, |
||||||
|
@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("registerAddr") String registerAddr, |
||||||
|
@Param("projectId") String projectId, |
||||||
|
@Param("funCode") String funCode); |
||||||
|
|
||||||
|
@Results({ |
||||||
|
@Result(property="deviceAddr",column="device_addr"), |
||||||
|
@Result(property="deviceType",column="device_type"), |
||||||
|
@Result(property="curDate",column="cur_date"), |
||||||
|
@Result(property ="curValue",column ="cur_value"), |
||||||
|
@Result(property="funCode",column="fun_code"), |
||||||
|
@Result(property="registerAddr",column="register_addr"), |
||||||
|
@Result(property="registerName",column="register_name"), |
||||||
|
@Result(property="grade",column="grade"), |
||||||
|
@Result(property="projectId",column="project_id"), |
||||||
|
@Result(property="projectName",column="project_name") |
||||||
|
}) |
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "queryDataResultChiller") |
||||||
|
List<DataResultChEntity> queryDataResultChiller(@Param("projectId") String projectId, |
||||||
|
@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("registerName") String registerName, |
||||||
|
@Param("startDate") String startDate, |
||||||
|
@Param("curDate") String curDate, |
||||||
|
@Param("page") int page, |
||||||
|
@Param("limit") int limit); |
||||||
|
|
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "dataResultChillerCount") |
||||||
|
int dataResultChillerCount(@Param("projectId") String projectId, |
||||||
|
@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("registerName") String registerName, |
||||||
|
@Param("startDate") String startDate, |
||||||
|
@Param("curDate") String curDate); |
||||||
|
|
||||||
|
|
||||||
|
//保存冷水机参数数据
|
||||||
|
@Insert("insert into data_chiller" + |
||||||
|
"(device_addr," + |
||||||
|
"device_name," + |
||||||
|
"run_state," + |
||||||
|
"set_soint," + |
||||||
|
"enter_chw," + |
||||||
|
"leave_chw," + |
||||||
|
"enter_cow," + |
||||||
|
"leave_cow," + |
||||||
|
"power," + |
||||||
|
"rated_power," + |
||||||
|
"chiller_amps," + |
||||||
|
"refrigeration," + |
||||||
|
"rated_ref," + |
||||||
|
"chw_flow," + |
||||||
|
"approach_cow," + |
||||||
|
"approach_chw," + |
||||||
|
"cop," + |
||||||
|
"rated_cop," + |
||||||
|
"copy_date) values (" + |
||||||
|
" #{deviceAddr},#{deviceName},#{projectId},#{lastValue},#{lastDate},#{curValue},#{curDate},#{ratio},#{calcValue},#{grade})") |
||||||
|
void saveDataChiller(ChillerModel chillerModel); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultClBakEntity; |
||||||
|
import com.mh.user.entity.DataResultClEntity; |
||||||
|
import org.apache.ibatis.annotations.Insert; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
import org.apache.ibatis.annotations.Select; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 数据冷量计 |
||||||
|
* @date 2024-07-10 15:20:55 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultClBakMapper extends BaseMapper<DataResultClBakEntity> { |
||||||
|
|
||||||
|
@Insert("insert into data_result_cl_bak(device_addr,device_type,project_id,last_value,last_date,cur_value,cur_date,ratio,calc_value,grade,register_addr,register_name) values (" + |
||||||
|
" #{deviceAddr},#{deviceType},#{projectId},#{lastValue},#{lastDate},#{curValue},#{curDate},#{ratio},#{calcValue},#{grade},#{registerAddr},#{registerName})") |
||||||
|
void saveDataResultCl_bak(DataResultClEntity dataResultClEntity); |
||||||
|
|
||||||
|
@Select("select count(1) from data_result_cl_bak " + |
||||||
|
" where cur_date = #{curDate} " + |
||||||
|
" and device_addr = #{deviceAddr} " + |
||||||
|
" and register_addr = #{registerAddr} " + |
||||||
|
" and project_id = #{projectId} ") |
||||||
|
int selectDataResultChBakCount(@Param("curDate") String curDate, |
||||||
|
@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("registerAddr") String registerAddr, |
||||||
|
@Param("projectId") String projectId); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultClEntity; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 数据冷量计 |
||||||
|
* @date 2024-07-10 15:20:55 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultClMapper extends BaseMapper<DataResultClEntity> { |
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
//保存冷量计数据
|
||||||
|
@Insert("insert into data_result_cl(device_addr,device_type,project_id,last_value,last_date,cur_value,cur_date,ratio,calc_value,grade,register_addr,register_name) values (" + |
||||||
|
" #{deviceAddr},#{deviceType},#{projectId},#{lastValue},#{lastDate},#{curValue},#{curDate},#{ratio},#{calcValue},#{grade},#{registerAddr},#{registerName})") |
||||||
|
void saveDataResultCl(DataResultClEntity dataResultClEntity); |
||||||
|
|
||||||
|
@Update("<script>" + |
||||||
|
" update data_result_cl set " + |
||||||
|
" <if test='deviceAddr!=null'> device_addr = #{deviceAddr} </if>" + |
||||||
|
" <if test='deviceType!=null'> , device_type = #{deviceType} </if>" + |
||||||
|
" <if test='projectId!=null'> , project_id = #{projectId} </if>" + |
||||||
|
" <if test='lastValue!=null'> , last_value = #{lastValue} </if>" + |
||||||
|
" <if test='lastDate!=null'> , last_date = #{lastDate} </if>" + |
||||||
|
" <if test='curValue!=null'> , cur_value = #{curValue} </if>" + |
||||||
|
" <if test='ratio!=null'> , ratio = #{ratio} </if>" + |
||||||
|
" <if test='calcValue!=null'> , calc_value = #{calcValue} </if>" + |
||||||
|
" <if test='grade!=null'> , grade = #{grade} </if>" + |
||||||
|
" <if test='registerAddr!=null'> , register_addr = #{registerAddr} </if>" + |
||||||
|
" <if test='registerName!=null'> , register_name = #{registerName} </if>" + |
||||||
|
" where cur_date=#{curDate} and device_addr=#{deviceAddr} and device_type=#{deviceType}" + |
||||||
|
"</script>") |
||||||
|
void updateDataResultCl(DataResultClEntity dataResultClEntity); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultFifteenMiEntity; |
||||||
|
import com.mh.user.entity.DataResultFiveMiEntity; |
||||||
|
import com.mh.user.mapper.provider.DataResultProvider; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
import org.apache.ibatis.annotations.ResultMap; |
||||||
|
import org.apache.ibatis.annotations.SelectProvider; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 每分钟保存数据 |
||||||
|
* @date 2024-07-10 17:34:30 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultFifteenMiMapper extends BaseMapper<DataResultFifteenMiEntity> { |
||||||
|
|
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "queryDataResultFifteenMi") |
||||||
|
List<DataResultChEntity> queryDataResultFifteenMi(@Param("projectId") String projectId, |
||||||
|
@Param("startDate") String startDate, |
||||||
|
@Param("curDate") String curDate, |
||||||
|
@Param("page") int page, |
||||||
|
@Param("limit") int limit); |
||||||
|
|
||||||
|
//@Select("select count(*) from data_result_fifteen_mi where projectId=#{projectId} and curDate>=#{startDate} and curDate<=#{curDate} ")
|
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "dataResultFifteenMiCount") |
||||||
|
int dataResultFifteenMiCount(@Param("projectId") String projectId,@Param("startDate") String startDate,@Param("curDate") String curDate); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultFiveMiEntity; |
||||||
|
import com.mh.user.entity.DataResultOneMiEntity; |
||||||
|
import com.mh.user.mapper.provider.DataResultProvider; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 每分钟保存数据 |
||||||
|
* @date 2024-07-10 17:34:30 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultFiveMiMapper extends BaseMapper<DataResultFiveMiEntity> { |
||||||
|
|
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "queryDataResultFiveMi") |
||||||
|
List<DataResultChEntity> queryDataResultFiveMi(@Param("projectId") String projectId, |
||||||
|
@Param("startDate") String startDate, |
||||||
|
@Param("curDate") String curDate, |
||||||
|
@Param("page") int page, |
||||||
|
@Param("limit") int limit); |
||||||
|
|
||||||
|
|
||||||
|
// @Select("select count(*) from data_result_five_mi where projectId=#{projectId} and curDate>=#{startDate} and curDate<=#{curDate} ")
|
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "dataResultFiveMiCount") |
||||||
|
int dataResultFiveMiCount(@Param("projectId") String projectId,@Param("startDate") String startDate,@Param("curDate") String curDate); |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultNowEntity; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 当前记录 |
||||||
|
* @date 2024-07-11 13:41:04 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultNowMapper extends BaseMapper<DataResultNowEntity> { |
||||||
|
|
||||||
|
@Insert("insert into data_result_now(device_addr,device_type,fun_code,register_addr,register_name,cur_value,cur_date,project_id,grade) values (" + |
||||||
|
" #{deviceAddr},#{deviceType},#{funCode},#{registerAddr},#{registerName},#{curValue},#{curDate},#{projectId},#{grade})") |
||||||
|
void saveDataResultNow(DataResultChEntity dataResultChEntity); |
||||||
|
|
||||||
|
@Delete("delete from data_result_now where device_addr=#{deviceAddr} and device_type = #{deviceType} and register_addr=#{registerAddr} and project_id=#{projectId}") |
||||||
|
void deleteDataResultNow(@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("deviceType") String deviceType, |
||||||
|
@Param("registerAddr") String registerAddr, |
||||||
|
@Param("projectId") String projectId); |
||||||
|
|
||||||
|
//实时参数读取
|
||||||
|
@Select("select * from data_result_now where device_addr=#{deviceAddr} and device_type=#{deviceType} and project_id=#{projectId} ") |
||||||
|
List<DataResultChEntity> selectDataResultNow(@Param("deviceAddr") String deviceAddr, |
||||||
|
@Param("deviceType") String deviceType, |
||||||
|
@Param("projectId") String projectId); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DataResultChEntity; |
||||||
|
import com.mh.user.entity.DataResultOneMiEntity; |
||||||
|
import com.mh.user.mapper.provider.DataResultProvider; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 每分钟保存数据 |
||||||
|
* @date 2024-07-10 17:34:30 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DataResultOneMiMapper extends BaseMapper<DataResultOneMiEntity> { |
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
@Results(id="rsc", value = { |
||||||
|
@Result(property="deviceAddr",column="device_addr"), |
||||||
|
@Result(property="deviceType",column="device_type"), |
||||||
|
@Result(property="curDate",column="cur_date"), |
||||||
|
@Result(property ="curValue",column ="cur_value"), |
||||||
|
@Result(property="funCode",column="fun_code"), |
||||||
|
@Result(property="registerAddr",column="register_addr"), |
||||||
|
@Result(property="registerName",column="register_name"), |
||||||
|
@Result(property="grade",column="grade"), |
||||||
|
@Result(property="projectId",column="project_id"), |
||||||
|
@Result(property="projectName",column="project_name") |
||||||
|
}) |
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "queryDataResultOneMi") |
||||||
|
List<DataResultChEntity> queryDataResultOneMi(@Param("projectId") String projectId, |
||||||
|
@Param("startDate") String startDate, |
||||||
|
@Param("curDate") String curDate, |
||||||
|
@Param("page") int page, |
||||||
|
@Param("limit") int limit); |
||||||
|
|
||||||
|
//查询记录数
|
||||||
|
// @Select("select count(*) from data_result_one_mi where projectId=#{projectId} and curDate>=#{startDate} and curDate<=#{curDate} ")
|
||||||
|
@SelectProvider(type = DataResultProvider.class,method = "dataResultOneMiCount") |
||||||
|
int dataResultOneMiCount(@Param("projectId") String projectId,@Param("startDate") String startDate,@Param("curDate") String curDate); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,55 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DeviceCodeEntity; |
||||||
|
import com.mh.user.model.ChillerModel; |
||||||
|
import com.mh.user.model.DeviceModel; |
||||||
|
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备参数mapper |
||||||
|
* @date 2024-07-11 15:37:48 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DeviceCodeMapper extends BaseMapper<DeviceCodeEntity> { |
||||||
|
|
||||||
|
//查询冷水机设备列表
|
||||||
|
@Results({ |
||||||
|
@Result(column = "device_addr",property = "deviceAddr" ), |
||||||
|
@Result(column = "device_name", property = "deviceName") |
||||||
|
}) |
||||||
|
@Select("select * from device_code where project_id=#{projectId} and device_type='冷水机'") |
||||||
|
List<DeviceModel> selectDevices(@Param("projectId") String projectId); |
||||||
|
|
||||||
|
|
||||||
|
//查询多个冷水机相关信息
|
||||||
|
@Results({ |
||||||
|
@Result(column = "device_addr",property = "deviceAddr" ), |
||||||
|
@Result(column = "device_name", property = "deviceName"), |
||||||
|
@Result(column = "run_State", property = "runState"), |
||||||
|
@Result(column = "set_Point", property = "setPoint"), |
||||||
|
@Result(column = "enter_chw", property = "enterChw"), |
||||||
|
@Result(column = "leave_chw", property = "leaveChw"), |
||||||
|
@Result(column = "enter_cow", property = "enterCow"), |
||||||
|
@Result(column = "leave_cow", property = "leaveCow"), |
||||||
|
@Result(column = "power", property = "power"), |
||||||
|
@Result(column = "rated_power", property = "ratedPower"), |
||||||
|
@Result(column = "chiller_amps", property = "chillerAmps"), |
||||||
|
@Result(column = "refrigeration", property = "refrigeration"), |
||||||
|
@Result(column = "rated_ref", property = "ratedRef"), |
||||||
|
@Result(column = "chw_flow", property = "chwFlow"), |
||||||
|
@Result(column = "approach_cow", property = "ApproachCow"), |
||||||
|
@Result(column = "approach_chw", property = "ApproachChw"), |
||||||
|
@Result(column = "cop", property = "cop"), |
||||||
|
@Result(column = "rated_cop", property = "ratedCop"), |
||||||
|
@Result(column = "copy_date", property = "copyDate") |
||||||
|
}) |
||||||
|
@Select("select * from device_code where project_id=#{projectId} and device_addr=#{deviceAddr} ") |
||||||
|
List<ChillerModel> queryChiller(@Param("projectId") String projectId, @Param("device_addr") String deviceAddr); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DeviceParamsEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备采集参数 |
||||||
|
* @date 2024-08-23 09:28:57 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DeviceParamsMapper extends BaseMapper<DeviceParamsEntity> { |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DevicesManageEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 资产设备管理 |
||||||
|
* @date 2024-08-23 10:22:16 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DevicesManageMapper extends BaseMapper<DevicesManageEntity> { |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理对接数据库 |
||||||
|
* @date 2024-08-23 09:03:13 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface MeterManageMapper extends BaseMapper<MeterManageEntity> { |
||||||
|
} |
@ -1,24 +1,24 @@ |
|||||||
package com.mh.user.mapper; |
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
import com.mh.user.entity.StrategyInfoEntity; |
import com.mh.user.entity.StrategyInfoEntity; |
||||||
import com.mh.user.mapper.provider.DeviceInfoProvider; |
|
||||||
import com.mh.user.mapper.provider.StrategyInfoProvider; |
|
||||||
import org.apache.ibatis.annotations.*; |
import org.apache.ibatis.annotations.*; |
||||||
|
|
||||||
import java.util.List; |
import java.util.List; |
||||||
|
|
||||||
@Mapper |
@Mapper |
||||||
public interface StrategyInfoMapper { |
public interface StrategyInfoMapper extends BaseMapper<StrategyInfoEntity> { |
||||||
|
|
||||||
//查询仪表信息
|
//查询仪表信息
|
||||||
@SelectProvider(type = StrategyInfoProvider.class,method = "queryStrategyInfo") |
@Select("<script>" + |
||||||
@Results(value = { |
"select * from strategy_info where 1=1 " + |
||||||
@Result(property="id",column="id"), |
"<if test='systemID != null and systemID != \"\"'>" + |
||||||
@Result(property="dataAnalysis",column="dataAnalysis"), |
" and system_id = #{systemID} " + |
||||||
@Result(property="operationOpt",column="operation_opt"), |
"</if>" + |
||||||
@Result(property="controlOpt",column="control_opt"), |
"<if test='projectId != null and projectId != \"\"'>" + |
||||||
@Result(property="projectID",column="project_id"), |
" and project_id = #{projectId} " + |
||||||
@Result(property="systemID",column="system_id") |
"</if>" + |
||||||
}) |
" order by id " + |
||||||
List<StrategyInfoEntity> queryStrategyInfo(@Param("systemID") String systemID,@Param("projectID") String projectID); |
"</script>") |
||||||
|
List<StrategyInfoEntity> queryStrategyInfo(@Param("systemID") String systemID,@Param("projectId") String projectId); |
||||||
} |
} |
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue