Преглед изворни кода

双胞胎图表接口平替

songxiaohang пре 1 година
родитељ
комит
ea7338c90a

+ 1 - 1
app/cmd/dtgateway/etc/dtgateway.yaml

@@ -1,7 +1,7 @@
 Name: dtgateway-api
 Host: 0.0.0.0
 Port: 1009
-Mode: dev
+Mode: pro
 Timeout: 0
 #100MB
 MaxBytes: 104857600

+ 2 - 1
app/cmd/dtgateway/internal/logic/dtgateway/itemHistoryDataListLogic.go

@@ -25,13 +25,14 @@ func NewItemHistoryDataListLogic(ctx context.Context, svcCtx *svc.ServiceContext
 }
 
 func (l *ItemHistoryDataListLogic) ItemHistoryDataList(req *types.ItemHistoryDataListReq) (resp *types.CommonResponse, err error) {
-	dataList, err := l.svcCtx.OrganizationRpc.ItemHistoryDataList(l.ctx, &pb.ItemHistoryDataListReq{
+	dataList, err := l.svcCtx.OrganizationRpc.ItemHistoryDataForChart(l.ctx, &pb.ItemHistoryDataForChartReq{
 		ProjectId:  req.ProjectId,
 		ItemName:   req.ItemName,
 		Interval:   req.Interval,
 		Aggregator: req.Aggregator,
 		Stime:      req.STime,
 		Etime:      req.ETime,
+		Size:       req.Size,
 	})
 	if err != nil {
 		return nil, err

+ 34 - 0
app/cmd/organization/internal/logic/itemHistoryDataForChartLogic.go

@@ -0,0 +1,34 @@
+package logic
+
+import (
+	"GtDataStore/common/xerr"
+	"context"
+	"github.com/pkg/errors"
+
+	"GtDataStore/app/cmd/organization/internal/svc"
+	"GtDataStore/app/cmd/organization/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type ItemHistoryDataForChartLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewItemHistoryDataForChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ItemHistoryDataForChartLogic {
+	return &ItemHistoryDataForChartLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *ItemHistoryDataForChartLogic) ItemHistoryDataForChart(in *pb.ItemHistoryDataForChartReq) (*pb.ItemHistoryDataForChartResp, error) {
+	modeList, err := l.svcCtx.ItemHistoryData.QueryHistoryDataForChart(l.ctx, in)
+	if err != nil {
+		return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "model QueryHistoryDataForChart get data err:%v", err)
+	}
+	return &pb.ItemHistoryDataForChartResp{List: modeList}, nil
+}

+ 5 - 0
app/cmd/organization/internal/server/organizationServer.go

@@ -76,3 +76,8 @@ func (s *OrganizationServer) ChangeTypeItemHistoryData(ctx context.Context, in *
 	l := logic.NewChangeTypeItemHistoryDataLogic(ctx, s.svcCtx)
 	return l.ChangeTypeItemHistoryData(in)
 }
+
+func (s *OrganizationServer) ItemHistoryDataForChart(ctx context.Context, in *pb.ItemHistoryDataForChartReq) (*pb.ItemHistoryDataForChartResp, error) {
+	l := logic.NewItemHistoryDataForChartLogic(ctx, s.svcCtx)
+	return l.ItemHistoryDataForChart(in)
+}

+ 32 - 0
app/cmd/organization/organization.proto

@@ -480,6 +480,37 @@ message ItemHistoryDataList {
   string    h_time = 3;
 }
 
+message ItemHistoryDataForChart {
+  // @gotags: json:"name"
+  string    name = 1;
+  // @gotags: json:"val"
+  double    val = 2;
+  // @gotags: json:"htime_at"
+  string    htime_at = 3;
+}
+
+message ItemHistoryDataForChartReq {
+  // @gotags: json:"project_id"
+  int64     project_id = 1;
+  // @gotags: json:"item_name"
+  string    item_name = 2;
+  // @gotags: json:"stime"
+  string    stime = 3;
+  // @gotags: json:"etime"
+  string     etime = 4;
+  // @gotags: json:"interval"
+  string    interval = 5;
+  // @gotags: json:"size"
+  int64     size = 6;
+  // @gotags: json:"aggregator"
+  string    aggregator = 7;
+}
+
+message ItemHistoryDataForChartResp {
+  // @gotags: json:"list"
+  repeated ItemHistoryDataForChart list = 1;
+}
+
 message ItemHistoryDataListResp {
   // @gotags: json:"list"
   repeated ItemHistoryDataList list = 1;
@@ -532,4 +563,5 @@ service Organization {
   rpc ItemHistoryDataMaxMinByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataMaxMinResp);
   rpc ItemHistoryDataFirstLastByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataFirstLastResp);
   rpc ChangeTypeItemHistoryData(ItemHistoryDataByTimeReq) returns(ChangeTypeItemHistoryDataResp);
+  rpc ItemHistoryDataForChart(ItemHistoryDataForChartReq) returns(ItemHistoryDataForChartResp);
 }

+ 9 - 0
app/cmd/organization/organization/organization.go

@@ -25,6 +25,9 @@ type (
 	ItemHistoryData               = pb.ItemHistoryData
 	ItemHistoryDataByTimeReq      = pb.ItemHistoryDataByTimeReq
 	ItemHistoryDataFirstLastResp  = pb.ItemHistoryDataFirstLastResp
+	ItemHistoryDataForChart       = pb.ItemHistoryDataForChart
+	ItemHistoryDataForChartReq    = pb.ItemHistoryDataForChartReq
+	ItemHistoryDataForChartResp   = pb.ItemHistoryDataForChartResp
 	ItemHistoryDataList           = pb.ItemHistoryDataList
 	ItemHistoryDataListReq        = pb.ItemHistoryDataListReq
 	ItemHistoryDataListResp       = pb.ItemHistoryDataListResp
@@ -51,6 +54,7 @@ type (
 		ItemHistoryDataMaxMinByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataMaxMinResp, error)
 		ItemHistoryDataFirstLastByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataFirstLastResp, error)
 		ChangeTypeItemHistoryData(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ChangeTypeItemHistoryDataResp, error)
+		ItemHistoryDataForChart(ctx context.Context, in *ItemHistoryDataForChartReq, opts ...grpc.CallOption) (*ItemHistoryDataForChartResp, error)
 	}
 
 	defaultOrganization struct {
@@ -118,3 +122,8 @@ func (m *defaultOrganization) ChangeTypeItemHistoryData(ctx context.Context, in
 	client := pb.NewOrganizationClient(m.cli.Conn())
 	return client.ChangeTypeItemHistoryData(ctx, in, opts...)
 }
+
+func (m *defaultOrganization) ItemHistoryDataForChart(ctx context.Context, in *ItemHistoryDataForChartReq, opts ...grpc.CallOption) (*ItemHistoryDataForChartResp, error) {
+	client := pb.NewOrganizationClient(m.cli.Conn())
+	return client.ItemHistoryDataForChart(ctx, in, opts...)
+}

+ 444 - 156
app/cmd/organization/pb/organization.pb.go

@@ -2628,6 +2628,222 @@ func (x *ItemHistoryDataList) GetHTime() string {
 	return ""
 }
 
+type ItemHistoryDataForChart struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// @gotags: json:"name"
+	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"`
+	// @gotags: json:"val"
+	Val float64 `protobuf:"fixed64,2,opt,name=val,proto3" json:"val"`
+	// @gotags: json:"htime_at"
+	HtimeAt string `protobuf:"bytes,3,opt,name=htime_at,json=htimeAt,proto3" json:"htime_at"`
+}
+
+func (x *ItemHistoryDataForChart) Reset() {
+	*x = ItemHistoryDataForChart{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_organization_proto_msgTypes[17]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ItemHistoryDataForChart) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ItemHistoryDataForChart) ProtoMessage() {}
+
+func (x *ItemHistoryDataForChart) ProtoReflect() protoreflect.Message {
+	mi := &file_organization_proto_msgTypes[17]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ItemHistoryDataForChart.ProtoReflect.Descriptor instead.
+func (*ItemHistoryDataForChart) Descriptor() ([]byte, []int) {
+	return file_organization_proto_rawDescGZIP(), []int{17}
+}
+
+func (x *ItemHistoryDataForChart) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *ItemHistoryDataForChart) GetVal() float64 {
+	if x != nil {
+		return x.Val
+	}
+	return 0
+}
+
+func (x *ItemHistoryDataForChart) GetHtimeAt() string {
+	if x != nil {
+		return x.HtimeAt
+	}
+	return ""
+}
+
+type ItemHistoryDataForChartReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// @gotags: json:"project_id"
+	ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id"`
+	// @gotags: json:"item_name"
+	ItemName string `protobuf:"bytes,2,opt,name=item_name,json=itemName,proto3" json:"item_name"`
+	// @gotags: json:"stime"
+	Stime string `protobuf:"bytes,3,opt,name=stime,proto3" json:"stime"`
+	// @gotags: json:"etime"
+	Etime string `protobuf:"bytes,4,opt,name=etime,proto3" json:"etime"`
+	// @gotags: json:"interval"
+	Interval string `protobuf:"bytes,5,opt,name=interval,proto3" json:"interval"`
+	// @gotags: json:"size"
+	Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size"`
+	// @gotags: json:"aggregator"
+	Aggregator string `protobuf:"bytes,7,opt,name=aggregator,proto3" json:"aggregator"`
+}
+
+func (x *ItemHistoryDataForChartReq) Reset() {
+	*x = ItemHistoryDataForChartReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_organization_proto_msgTypes[18]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ItemHistoryDataForChartReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ItemHistoryDataForChartReq) ProtoMessage() {}
+
+func (x *ItemHistoryDataForChartReq) ProtoReflect() protoreflect.Message {
+	mi := &file_organization_proto_msgTypes[18]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ItemHistoryDataForChartReq.ProtoReflect.Descriptor instead.
+func (*ItemHistoryDataForChartReq) Descriptor() ([]byte, []int) {
+	return file_organization_proto_rawDescGZIP(), []int{18}
+}
+
+func (x *ItemHistoryDataForChartReq) GetProjectId() int64 {
+	if x != nil {
+		return x.ProjectId
+	}
+	return 0
+}
+
+func (x *ItemHistoryDataForChartReq) GetItemName() string {
+	if x != nil {
+		return x.ItemName
+	}
+	return ""
+}
+
+func (x *ItemHistoryDataForChartReq) GetStime() string {
+	if x != nil {
+		return x.Stime
+	}
+	return ""
+}
+
+func (x *ItemHistoryDataForChartReq) GetEtime() string {
+	if x != nil {
+		return x.Etime
+	}
+	return ""
+}
+
+func (x *ItemHistoryDataForChartReq) GetInterval() string {
+	if x != nil {
+		return x.Interval
+	}
+	return ""
+}
+
+func (x *ItemHistoryDataForChartReq) GetSize() int64 {
+	if x != nil {
+		return x.Size
+	}
+	return 0
+}
+
+func (x *ItemHistoryDataForChartReq) GetAggregator() string {
+	if x != nil {
+		return x.Aggregator
+	}
+	return ""
+}
+
+type ItemHistoryDataForChartResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// @gotags: json:"list"
+	List []*ItemHistoryDataForChart `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
+}
+
+func (x *ItemHistoryDataForChartResp) Reset() {
+	*x = ItemHistoryDataForChartResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_organization_proto_msgTypes[19]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ItemHistoryDataForChartResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ItemHistoryDataForChartResp) ProtoMessage() {}
+
+func (x *ItemHistoryDataForChartResp) ProtoReflect() protoreflect.Message {
+	mi := &file_organization_proto_msgTypes[19]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ItemHistoryDataForChartResp.ProtoReflect.Descriptor instead.
+func (*ItemHistoryDataForChartResp) Descriptor() ([]byte, []int) {
+	return file_organization_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *ItemHistoryDataForChartResp) GetList() []*ItemHistoryDataForChart {
+	if x != nil {
+		return x.List
+	}
+	return nil
+}
+
 type ItemHistoryDataListResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2640,7 +2856,7 @@ type ItemHistoryDataListResp struct {
 func (x *ItemHistoryDataListResp) Reset() {
 	*x = ItemHistoryDataListResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[17]
+		mi := &file_organization_proto_msgTypes[20]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2653,7 +2869,7 @@ func (x *ItemHistoryDataListResp) String() string {
 func (*ItemHistoryDataListResp) ProtoMessage() {}
 
 func (x *ItemHistoryDataListResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[17]
+	mi := &file_organization_proto_msgTypes[20]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2666,7 +2882,7 @@ func (x *ItemHistoryDataListResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use ItemHistoryDataListResp.ProtoReflect.Descriptor instead.
 func (*ItemHistoryDataListResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{17}
+	return file_organization_proto_rawDescGZIP(), []int{20}
 }
 
 func (x *ItemHistoryDataListResp) GetList() []*ItemHistoryDataList {
@@ -2688,7 +2904,7 @@ type GetWorkingUfByCodeResp struct {
 func (x *GetWorkingUfByCodeResp) Reset() {
 	*x = GetWorkingUfByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[18]
+		mi := &file_organization_proto_msgTypes[21]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2701,7 +2917,7 @@ func (x *GetWorkingUfByCodeResp) String() string {
 func (*GetWorkingUfByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingUfByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[18]
+	mi := &file_organization_proto_msgTypes[21]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2714,7 +2930,7 @@ func (x *GetWorkingUfByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingUfByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingUfByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{18}
+	return file_organization_proto_rawDescGZIP(), []int{21}
 }
 
 func (x *GetWorkingUfByCodeResp) GetList() []*WorkingUf {
@@ -2736,7 +2952,7 @@ type GetWorkingRoByCodeResp struct {
 func (x *GetWorkingRoByCodeResp) Reset() {
 	*x = GetWorkingRoByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[19]
+		mi := &file_organization_proto_msgTypes[22]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2749,7 +2965,7 @@ func (x *GetWorkingRoByCodeResp) String() string {
 func (*GetWorkingRoByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingRoByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[19]
+	mi := &file_organization_proto_msgTypes[22]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2762,7 +2978,7 @@ func (x *GetWorkingRoByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingRoByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingRoByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{19}
+	return file_organization_proto_rawDescGZIP(), []int{22}
 }
 
 func (x *GetWorkingRoByCodeResp) GetList() []*WorkingRo {
@@ -2784,7 +3000,7 @@ type GetWorkingNfByCodeResp struct {
 func (x *GetWorkingNfByCodeResp) Reset() {
 	*x = GetWorkingNfByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[20]
+		mi := &file_organization_proto_msgTypes[23]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2797,7 +3013,7 @@ func (x *GetWorkingNfByCodeResp) String() string {
 func (*GetWorkingNfByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingNfByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[20]
+	mi := &file_organization_proto_msgTypes[23]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2810,7 +3026,7 @@ func (x *GetWorkingNfByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingNfByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingNfByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{20}
+	return file_organization_proto_rawDescGZIP(), []int{23}
 }
 
 func (x *GetWorkingNfByCodeResp) GetList() []*WorkingNf {
@@ -2832,7 +3048,7 @@ type GetWorkingMfByCodeResp struct {
 func (x *GetWorkingMfByCodeResp) Reset() {
 	*x = GetWorkingMfByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[21]
+		mi := &file_organization_proto_msgTypes[24]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2845,7 +3061,7 @@ func (x *GetWorkingMfByCodeResp) String() string {
 func (*GetWorkingMfByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingMfByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[21]
+	mi := &file_organization_proto_msgTypes[24]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2858,7 +3074,7 @@ func (x *GetWorkingMfByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingMfByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingMfByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{21}
+	return file_organization_proto_rawDescGZIP(), []int{24}
 }
 
 func (x *GetWorkingMfByCodeResp) GetList() []*WorkingMf {
@@ -2880,7 +3096,7 @@ type GetWorkingPumpByCodeResp struct {
 func (x *GetWorkingPumpByCodeResp) Reset() {
 	*x = GetWorkingPumpByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[22]
+		mi := &file_organization_proto_msgTypes[25]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2893,7 +3109,7 @@ func (x *GetWorkingPumpByCodeResp) String() string {
 func (*GetWorkingPumpByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingPumpByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[22]
+	mi := &file_organization_proto_msgTypes[25]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2906,7 +3122,7 @@ func (x *GetWorkingPumpByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingPumpByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingPumpByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{22}
+	return file_organization_proto_rawDescGZIP(), []int{25}
 }
 
 func (x *GetWorkingPumpByCodeResp) GetList() []*WorkingPump {
@@ -2928,7 +3144,7 @@ type GetWorkingValveByCodeResp struct {
 func (x *GetWorkingValveByCodeResp) Reset() {
 	*x = GetWorkingValveByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[23]
+		mi := &file_organization_proto_msgTypes[26]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2941,7 +3157,7 @@ func (x *GetWorkingValveByCodeResp) String() string {
 func (*GetWorkingValveByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingValveByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[23]
+	mi := &file_organization_proto_msgTypes[26]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2954,7 +3170,7 @@ func (x *GetWorkingValveByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingValveByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingValveByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{23}
+	return file_organization_proto_rawDescGZIP(), []int{26}
 }
 
 func (x *GetWorkingValveByCodeResp) GetList() []*WorkingValve {
@@ -2976,7 +3192,7 @@ type GetWorkingChestByCodeResp struct {
 func (x *GetWorkingChestByCodeResp) Reset() {
 	*x = GetWorkingChestByCodeResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_organization_proto_msgTypes[24]
+		mi := &file_organization_proto_msgTypes[27]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -2989,7 +3205,7 @@ func (x *GetWorkingChestByCodeResp) String() string {
 func (*GetWorkingChestByCodeResp) ProtoMessage() {}
 
 func (x *GetWorkingChestByCodeResp) ProtoReflect() protoreflect.Message {
-	mi := &file_organization_proto_msgTypes[24]
+	mi := &file_organization_proto_msgTypes[27]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -3002,7 +3218,7 @@ func (x *GetWorkingChestByCodeResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use GetWorkingChestByCodeResp.ProtoReflect.Descriptor instead.
 func (*GetWorkingChestByCodeResp) Descriptor() ([]byte, []int) {
-	return file_organization_proto_rawDescGZIP(), []int{24}
+	return file_organization_proto_rawDescGZIP(), []int{27}
 }
 
 func (x *GetWorkingChestByCodeResp) GetList() []*WorkingChest {
@@ -3477,97 +3693,127 @@ var file_organization_proto_rawDesc = []byte{
 	0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a,
 	0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12,
 	0x15, 0x0a, 0x06, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x05, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x17, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
-	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
-	0x17, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
-	0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b,
-	0x0a, 0x16, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x42, 0x79,
+	0x05, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x17, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x72,
+	0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x01, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x74, 0x69, 0x6d, 0x65,
+	0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x74, 0x69, 0x6d, 0x65,
+	0x41, 0x74, 0x22, 0xd4, 0x01, 0x0a, 0x1a, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f,
+	0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65,
+	0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64,
+	0x12, 0x1b, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a,
+	0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74,
+	0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74,
+	0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x74,
+	0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x67, 0x67,
+	0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61,
+	0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x4e, 0x0a, 0x1b, 0x49, 0x74, 0x65,
+	0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x43,
+	0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74,
+	0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d,
+	0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x43, 0x68,
+	0x61, 0x72, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x46, 0x0a, 0x17, 0x49, 0x74, 0x65,
+	0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03,
+	0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74,
+	0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73,
+	0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55,
+	0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x6c,
+	0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57,
+	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b,
+	0x0a, 0x16, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79,
 	0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74,
 	0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x55, 0x66, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47,
-	0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x64,
+	0x69, 0x6e, 0x67, 0x52, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47,
+	0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4e, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64,
 	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20,
 	0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
-	0x52, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x57,
-	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4e, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65,
+	0x4e, 0x66, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x57,
+	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4d, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65,
 	0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
-	0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4e, 0x66, 0x52,
-	0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x4d, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x21, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
-	0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4d, 0x66, 0x52, 0x04, 0x6c, 0x69,
-	0x73, 0x74, 0x22, 0x3f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
-	0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23,
-	0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70,
-	0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x52, 0x04, 0x6c,
-	0x69, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e,
-	0x67, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
-	0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x76, 0x65,
+	0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x4d, 0x66, 0x52,
+	0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
+	0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x23, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70,
 	0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72,
-	0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52,
+	0x6b, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52,
 	0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68,
-	0x65, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x32, 0x8e, 0x07, 0x0a, 0x0c, 0x4f, 0x72,
-	0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x12, 0x47, 0x65,
-	0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65,
+	0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x56, 0x61,
+	0x6c, 0x76, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x19, 0x47, 0x65, 0x74,
+	0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f,
+	0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e,
+	0x67, 0x43, 0x68, 0x65, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x32, 0xea, 0x07, 0x0a,
+	0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a,
+	0x12, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x42, 0x79, 0x43,
+	0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69,
+	0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f,
+	0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x42, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52,
+	0x6f, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57,
+	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x47,
+	0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x64,
+	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
+	0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10,
+	0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71,
+	0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
+	0x43, 0x68, 0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x46, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d,
+	0x70, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57,
+	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47,
+	0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x43,
+	0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57, 0x6f,
+	0x72, 0x6b, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65,
 	0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52,
-	0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69,
-	0x6e, 0x67, 0x55, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42,
-	0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57,
-	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x48, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
-	0x43, 0x68, 0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62,
-	0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e,
-	0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65,
-	0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x14,
-	0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57,
-	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69,
-	0x6e, 0x67, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e,
-	0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a,
-	0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x56,
-	0x61, 0x6c, 0x76, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5a,
-	0x0a, 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
-	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4d,
-	0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f,
-	0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x4d,
-	0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f,
-	0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x13, 0x49, 0x74,
-	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73,
-	0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f,
-	0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e,
-	0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61,
-	0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, 0x0a, 0x15, 0x49, 0x74,
-	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54,
-	0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73,
-	0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65,
-	0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f,
-	0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5a,
-	0x0a, 0x1b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74,
-	0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e,
+	0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69,
+	0x6e, 0x67, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x5a, 0x0a, 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65,
+	0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x2e, 0x70,
+	0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70,
+	0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a,
+	0x13, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
+	0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
+	0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
+	0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x52, 0x0a,
+	0x15, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
+	0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d,
+	0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d,
+	0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x5a, 0x0a, 0x1b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
+	0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65,
+	0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
+	0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d,
+	0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44,
+	0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x60, 0x0a,
+	0x1e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
+	0x46, 0x69, 0x72, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12,
+	0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
+	0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e,
 	0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61,
-	0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62,
-	0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
-	0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x60, 0x0a, 0x1e, 0x49, 0x74,
-	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x69, 0x72,
-	0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70,
+	0x74, 0x61, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x5c, 0x0a, 0x19, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, 0x74, 0x65,
+	0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x2e, 0x70,
 	0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74,
-	0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e,
-	0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46,
-	0x69, 0x72, 0x73, 0x74, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x19,
+	0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e,
 	0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
-	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49,
-	0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79,
-	0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61,
-	0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f,
-	0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
-	0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5a, 0x0a,
+	0x17, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
+	0x46, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74,
+	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72,
+	0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74,
+	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72,
+	0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
+	0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -3582,7 +3828,7 @@ func file_organization_proto_rawDescGZIP() []byte {
 	return file_organization_proto_rawDescData
 }
 
-var file_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 25)
+var file_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 28)
 var file_organization_proto_goTypes = []interface{}{
 	(*DcWorkingReq)(nil),                  // 0: pb.DcWorkingReq
 	(*WorkingMf)(nil),                     // 1: pb.WorkingMf
@@ -3601,52 +3847,58 @@ var file_organization_proto_goTypes = []interface{}{
 	(*ItemHistoryDataFirstLastResp)(nil),  // 14: pb.ItemHistoryDataFirstLastResp
 	(*ChangeTypeItemHistoryDataResp)(nil), // 15: pb.ChangeTypeItemHistoryDataResp
 	(*ItemHistoryDataList)(nil),           // 16: pb.ItemHistoryDataList
-	(*ItemHistoryDataListResp)(nil),       // 17: pb.ItemHistoryDataListResp
-	(*GetWorkingUfByCodeResp)(nil),        // 18: pb.GetWorkingUfByCodeResp
-	(*GetWorkingRoByCodeResp)(nil),        // 19: pb.GetWorkingRoByCodeResp
-	(*GetWorkingNfByCodeResp)(nil),        // 20: pb.GetWorkingNfByCodeResp
-	(*GetWorkingMfByCodeResp)(nil),        // 21: pb.GetWorkingMfByCodeResp
-	(*GetWorkingPumpByCodeResp)(nil),      // 22: pb.GetWorkingPumpByCodeResp
-	(*GetWorkingValveByCodeResp)(nil),     // 23: pb.GetWorkingValveByCodeResp
-	(*GetWorkingChestByCodeResp)(nil),     // 24: pb.GetWorkingChestByCodeResp
+	(*ItemHistoryDataForChart)(nil),       // 17: pb.ItemHistoryDataForChart
+	(*ItemHistoryDataForChartReq)(nil),    // 18: pb.ItemHistoryDataForChartReq
+	(*ItemHistoryDataForChartResp)(nil),   // 19: pb.ItemHistoryDataForChartResp
+	(*ItemHistoryDataListResp)(nil),       // 20: pb.ItemHistoryDataListResp
+	(*GetWorkingUfByCodeResp)(nil),        // 21: pb.GetWorkingUfByCodeResp
+	(*GetWorkingRoByCodeResp)(nil),        // 22: pb.GetWorkingRoByCodeResp
+	(*GetWorkingNfByCodeResp)(nil),        // 23: pb.GetWorkingNfByCodeResp
+	(*GetWorkingMfByCodeResp)(nil),        // 24: pb.GetWorkingMfByCodeResp
+	(*GetWorkingPumpByCodeResp)(nil),      // 25: pb.GetWorkingPumpByCodeResp
+	(*GetWorkingValveByCodeResp)(nil),     // 26: pb.GetWorkingValveByCodeResp
+	(*GetWorkingChestByCodeResp)(nil),     // 27: pb.GetWorkingChestByCodeResp
 }
 var file_organization_proto_depIdxs = []int32{
 	8,  // 0: pb.MultiAddItemHistoryDataReq.list:type_name -> pb.ItemHistoryData
-	16, // 1: pb.ItemHistoryDataListResp.list:type_name -> pb.ItemHistoryDataList
-	2,  // 2: pb.GetWorkingUfByCodeResp.list:type_name -> pb.WorkingUf
-	4,  // 3: pb.GetWorkingRoByCodeResp.list:type_name -> pb.WorkingRo
-	3,  // 4: pb.GetWorkingNfByCodeResp.list:type_name -> pb.WorkingNf
-	1,  // 5: pb.GetWorkingMfByCodeResp.list:type_name -> pb.WorkingMf
-	6,  // 6: pb.GetWorkingPumpByCodeResp.list:type_name -> pb.WorkingPump
-	7,  // 7: pb.GetWorkingValveByCodeResp.list:type_name -> pb.WorkingValve
-	5,  // 8: pb.GetWorkingChestByCodeResp.list:type_name -> pb.WorkingChest
-	0,  // 9: pb.Organization.GetWorkingUfByCode:input_type -> pb.DcWorkingReq
-	0,  // 10: pb.Organization.GetWorkingRoByCode:input_type -> pb.DcWorkingReq
-	0,  // 11: pb.Organization.GetWorkingChestByCode:input_type -> pb.DcWorkingReq
-	0,  // 12: pb.Organization.GetWorkingPumpByCode:input_type -> pb.DcWorkingReq
-	0,  // 13: pb.Organization.GetWorkingValveByCode:input_type -> pb.DcWorkingReq
-	9,  // 14: pb.Organization.MultiAddItemHistoryData:input_type -> pb.MultiAddItemHistoryDataReq
-	11, // 15: pb.Organization.ItemHistoryDataList:input_type -> pb.ItemHistoryDataListReq
-	12, // 16: pb.Organization.ItemHistoryDataByTime:input_type -> pb.ItemHistoryDataByTimeReq
-	12, // 17: pb.Organization.ItemHistoryDataMaxMinByTime:input_type -> pb.ItemHistoryDataByTimeReq
-	12, // 18: pb.Organization.ItemHistoryDataFirstLastByTime:input_type -> pb.ItemHistoryDataByTimeReq
-	12, // 19: pb.Organization.ChangeTypeItemHistoryData:input_type -> pb.ItemHistoryDataByTimeReq
-	18, // 20: pb.Organization.GetWorkingUfByCode:output_type -> pb.GetWorkingUfByCodeResp
-	19, // 21: pb.Organization.GetWorkingRoByCode:output_type -> pb.GetWorkingRoByCodeResp
-	24, // 22: pb.Organization.GetWorkingChestByCode:output_type -> pb.GetWorkingChestByCodeResp
-	22, // 23: pb.Organization.GetWorkingPumpByCode:output_type -> pb.GetWorkingPumpByCodeResp
-	23, // 24: pb.Organization.GetWorkingValveByCode:output_type -> pb.GetWorkingValveByCodeResp
-	10, // 25: pb.Organization.MultiAddItemHistoryData:output_type -> pb.MultiAddItemHistoryDataResp
-	17, // 26: pb.Organization.ItemHistoryDataList:output_type -> pb.ItemHistoryDataListResp
-	17, // 27: pb.Organization.ItemHistoryDataByTime:output_type -> pb.ItemHistoryDataListResp
-	13, // 28: pb.Organization.ItemHistoryDataMaxMinByTime:output_type -> pb.ItemHistoryDataMaxMinResp
-	14, // 29: pb.Organization.ItemHistoryDataFirstLastByTime:output_type -> pb.ItemHistoryDataFirstLastResp
-	15, // 30: pb.Organization.ChangeTypeItemHistoryData:output_type -> pb.ChangeTypeItemHistoryDataResp
-	20, // [20:31] is the sub-list for method output_type
-	9,  // [9:20] is the sub-list for method input_type
-	9,  // [9:9] is the sub-list for extension type_name
-	9,  // [9:9] is the sub-list for extension extendee
-	0,  // [0:9] is the sub-list for field type_name
+	17, // 1: pb.ItemHistoryDataForChartResp.list:type_name -> pb.ItemHistoryDataForChart
+	16, // 2: pb.ItemHistoryDataListResp.list:type_name -> pb.ItemHistoryDataList
+	2,  // 3: pb.GetWorkingUfByCodeResp.list:type_name -> pb.WorkingUf
+	4,  // 4: pb.GetWorkingRoByCodeResp.list:type_name -> pb.WorkingRo
+	3,  // 5: pb.GetWorkingNfByCodeResp.list:type_name -> pb.WorkingNf
+	1,  // 6: pb.GetWorkingMfByCodeResp.list:type_name -> pb.WorkingMf
+	6,  // 7: pb.GetWorkingPumpByCodeResp.list:type_name -> pb.WorkingPump
+	7,  // 8: pb.GetWorkingValveByCodeResp.list:type_name -> pb.WorkingValve
+	5,  // 9: pb.GetWorkingChestByCodeResp.list:type_name -> pb.WorkingChest
+	0,  // 10: pb.Organization.GetWorkingUfByCode:input_type -> pb.DcWorkingReq
+	0,  // 11: pb.Organization.GetWorkingRoByCode:input_type -> pb.DcWorkingReq
+	0,  // 12: pb.Organization.GetWorkingChestByCode:input_type -> pb.DcWorkingReq
+	0,  // 13: pb.Organization.GetWorkingPumpByCode:input_type -> pb.DcWorkingReq
+	0,  // 14: pb.Organization.GetWorkingValveByCode:input_type -> pb.DcWorkingReq
+	9,  // 15: pb.Organization.MultiAddItemHistoryData:input_type -> pb.MultiAddItemHistoryDataReq
+	11, // 16: pb.Organization.ItemHistoryDataList:input_type -> pb.ItemHistoryDataListReq
+	12, // 17: pb.Organization.ItemHistoryDataByTime:input_type -> pb.ItemHistoryDataByTimeReq
+	12, // 18: pb.Organization.ItemHistoryDataMaxMinByTime:input_type -> pb.ItemHistoryDataByTimeReq
+	12, // 19: pb.Organization.ItemHistoryDataFirstLastByTime:input_type -> pb.ItemHistoryDataByTimeReq
+	12, // 20: pb.Organization.ChangeTypeItemHistoryData:input_type -> pb.ItemHistoryDataByTimeReq
+	18, // 21: pb.Organization.ItemHistoryDataForChart:input_type -> pb.ItemHistoryDataForChartReq
+	21, // 22: pb.Organization.GetWorkingUfByCode:output_type -> pb.GetWorkingUfByCodeResp
+	22, // 23: pb.Organization.GetWorkingRoByCode:output_type -> pb.GetWorkingRoByCodeResp
+	27, // 24: pb.Organization.GetWorkingChestByCode:output_type -> pb.GetWorkingChestByCodeResp
+	25, // 25: pb.Organization.GetWorkingPumpByCode:output_type -> pb.GetWorkingPumpByCodeResp
+	26, // 26: pb.Organization.GetWorkingValveByCode:output_type -> pb.GetWorkingValveByCodeResp
+	10, // 27: pb.Organization.MultiAddItemHistoryData:output_type -> pb.MultiAddItemHistoryDataResp
+	20, // 28: pb.Organization.ItemHistoryDataList:output_type -> pb.ItemHistoryDataListResp
+	20, // 29: pb.Organization.ItemHistoryDataByTime:output_type -> pb.ItemHistoryDataListResp
+	13, // 30: pb.Organization.ItemHistoryDataMaxMinByTime:output_type -> pb.ItemHistoryDataMaxMinResp
+	14, // 31: pb.Organization.ItemHistoryDataFirstLastByTime:output_type -> pb.ItemHistoryDataFirstLastResp
+	15, // 32: pb.Organization.ChangeTypeItemHistoryData:output_type -> pb.ChangeTypeItemHistoryDataResp
+	19, // 33: pb.Organization.ItemHistoryDataForChart:output_type -> pb.ItemHistoryDataForChartResp
+	22, // [22:34] is the sub-list for method output_type
+	10, // [10:22] is the sub-list for method input_type
+	10, // [10:10] is the sub-list for extension type_name
+	10, // [10:10] is the sub-list for extension extendee
+	0,  // [0:10] is the sub-list for field type_name
 }
 
 func init() { file_organization_proto_init() }
@@ -3860,7 +4112,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ItemHistoryDataListResp); i {
+			switch v := v.(*ItemHistoryDataForChart); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3872,7 +4124,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetWorkingUfByCodeResp); i {
+			switch v := v.(*ItemHistoryDataForChartReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3884,7 +4136,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetWorkingRoByCodeResp); i {
+			switch v := v.(*ItemHistoryDataForChartResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3896,7 +4148,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetWorkingNfByCodeResp); i {
+			switch v := v.(*ItemHistoryDataListResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3908,7 +4160,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetWorkingMfByCodeResp); i {
+			switch v := v.(*GetWorkingUfByCodeResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3920,7 +4172,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetWorkingPumpByCodeResp); i {
+			switch v := v.(*GetWorkingRoByCodeResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3932,7 +4184,7 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*GetWorkingValveByCodeResp); i {
+			switch v := v.(*GetWorkingNfByCodeResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -3944,6 +4196,42 @@ func file_organization_proto_init() {
 			}
 		}
 		file_organization_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GetWorkingMfByCodeResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_organization_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GetWorkingPumpByCodeResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_organization_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GetWorkingValveByCodeResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_organization_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*GetWorkingChestByCodeResp); i {
 			case 0:
 				return &v.state
@@ -3962,7 +4250,7 @@ func file_organization_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_organization_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   25,
+			NumMessages:   28,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 37 - 0
app/cmd/organization/pb/organization_grpc.pb.go

@@ -30,6 +30,7 @@ const (
 	Organization_ItemHistoryDataMaxMinByTime_FullMethodName    = "/pb.Organization/ItemHistoryDataMaxMinByTime"
 	Organization_ItemHistoryDataFirstLastByTime_FullMethodName = "/pb.Organization/ItemHistoryDataFirstLastByTime"
 	Organization_ChangeTypeItemHistoryData_FullMethodName      = "/pb.Organization/ChangeTypeItemHistoryData"
+	Organization_ItemHistoryDataForChart_FullMethodName        = "/pb.Organization/ItemHistoryDataForChart"
 )
 
 // OrganizationClient is the client API for Organization service.
@@ -47,6 +48,7 @@ type OrganizationClient interface {
 	ItemHistoryDataMaxMinByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataMaxMinResp, error)
 	ItemHistoryDataFirstLastByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataFirstLastResp, error)
 	ChangeTypeItemHistoryData(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ChangeTypeItemHistoryDataResp, error)
+	ItemHistoryDataForChart(ctx context.Context, in *ItemHistoryDataForChartReq, opts ...grpc.CallOption) (*ItemHistoryDataForChartResp, error)
 }
 
 type organizationClient struct {
@@ -156,6 +158,15 @@ func (c *organizationClient) ChangeTypeItemHistoryData(ctx context.Context, in *
 	return out, nil
 }
 
+func (c *organizationClient) ItemHistoryDataForChart(ctx context.Context, in *ItemHistoryDataForChartReq, opts ...grpc.CallOption) (*ItemHistoryDataForChartResp, error) {
+	out := new(ItemHistoryDataForChartResp)
+	err := c.cc.Invoke(ctx, Organization_ItemHistoryDataForChart_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // OrganizationServer is the server API for Organization service.
 // All implementations must embed UnimplementedOrganizationServer
 // for forward compatibility
@@ -171,6 +182,7 @@ type OrganizationServer interface {
 	ItemHistoryDataMaxMinByTime(context.Context, *ItemHistoryDataByTimeReq) (*ItemHistoryDataMaxMinResp, error)
 	ItemHistoryDataFirstLastByTime(context.Context, *ItemHistoryDataByTimeReq) (*ItemHistoryDataFirstLastResp, error)
 	ChangeTypeItemHistoryData(context.Context, *ItemHistoryDataByTimeReq) (*ChangeTypeItemHistoryDataResp, error)
+	ItemHistoryDataForChart(context.Context, *ItemHistoryDataForChartReq) (*ItemHistoryDataForChartResp, error)
 	mustEmbedUnimplementedOrganizationServer()
 }
 
@@ -211,6 +223,9 @@ func (UnimplementedOrganizationServer) ItemHistoryDataFirstLastByTime(context.Co
 func (UnimplementedOrganizationServer) ChangeTypeItemHistoryData(context.Context, *ItemHistoryDataByTimeReq) (*ChangeTypeItemHistoryDataResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ChangeTypeItemHistoryData not implemented")
 }
+func (UnimplementedOrganizationServer) ItemHistoryDataForChart(context.Context, *ItemHistoryDataForChartReq) (*ItemHistoryDataForChartResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ItemHistoryDataForChart not implemented")
+}
 func (UnimplementedOrganizationServer) mustEmbedUnimplementedOrganizationServer() {}
 
 // UnsafeOrganizationServer may be embedded to opt out of forward compatibility for this service.
@@ -422,6 +437,24 @@ func _Organization_ChangeTypeItemHistoryData_Handler(srv interface{}, ctx contex
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Organization_ItemHistoryDataForChart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ItemHistoryDataForChartReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(OrganizationServer).ItemHistoryDataForChart(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Organization_ItemHistoryDataForChart_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(OrganizationServer).ItemHistoryDataForChart(ctx, req.(*ItemHistoryDataForChartReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Organization_ServiceDesc is the grpc.ServiceDesc for Organization service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -473,6 +506,10 @@ var Organization_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "ChangeTypeItemHistoryData",
 			Handler:    _Organization_ChangeTypeItemHistoryData_Handler,
 		},
+		{
+			MethodName: "ItemHistoryDataForChart",
+			Handler:    _Organization_ItemHistoryDataForChart_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "organization.proto",

+ 69 - 0
app/model/dcitemhistorydatamodel.go

@@ -23,6 +23,7 @@ type (
 		QueryHistoryDataMaxMinByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*MaxMinData, error)
 		QueryHistoryDataFirstByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*ItemHistoryData, error)
 		QueryHistoryDataLastByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*ItemHistoryData, error)
+		QueryHistoryDataForChart(ctx context.Context, in *pb.ItemHistoryDataForChartReq) ([]*pb.ItemHistoryDataForChart, error)
 	}
 
 	customDcItemHistoryDataModel struct {
@@ -166,6 +167,74 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataLastByTime(ctx context.C
 	}
 }
 
+func (m *defaultDcItemHistoryDataModel) QueryHistoryDataForChart(ctx context.Context, in *pb.ItemHistoryDataForChartReq) ([]*pb.ItemHistoryDataForChart, error) {
+	resp := make([]*pb.ItemHistoryDataForChart, 0)
+	var err error
+	var selectFormat, timeLpad, timeZero string
+	if in.Interval == "minute" {
+		selectFormat = "%Y-%m-%d %H:"
+		timeLpad = "%i"
+		timeZero = ":00"
+	} else if in.Interval == "h" {
+		selectFormat = "%Y-%m-%d "
+		timeLpad = "%H"
+		timeZero = ":00:00"
+	} else {
+		// day
+		selectFormat = "%Y-%m-"
+		timeLpad = "%d"
+		timeZero = " 00:00:00"
+	}
+	if in.Aggregator == "realtime" {
+		query := fmt.Sprintf("SELECT t1.item_name AS `name`, t1.val AS `val`, t2.htime AS `htime_at`"+
+			" FROM %s AS t1 JOIN ("+
+			" SELECT hd.item_name,"+
+			" CASE WHEN MINUTE(h_time) >= 30  THEN DATE_FORMAT(DATE_ADD(h_time, INTERVAL 1 HOUR), '%%Y-%%m-%%d %%H:00:00') "+
+			" ELSE DATE_FORMAT(h_time, '%%Y-%%m-%%d %%H:00:00') END AS htime"+
+			" FROM %s AS hd"+
+			" LEFT JOIN dc_item_config as ic ON hd.item_name = ic.item_name "+
+			" WHERE hd.item_name = ? AND h_time >= ? AND h_time < ?"+
+			" AND (ic.id IS NULL OR (hd.val > ic.min_val AND hd.val < ic.max_val))"+
+			" GROUP BY htime) AS t2 ON t1.item_name = t2.item_name AND t1.h_time = t2.htime"+
+			" WHERE t1.item_name = ? ORDER BY t1.h_time ASC",
+			m.getTableName(in.ProjectId), m.getTableName(in.ProjectId))
+		err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ItemName, in.Stime, in.Etime, in.ItemName)
+	} else if in.Aggregator == "new" {
+		query := fmt.Sprintf("SELECT t1.item_name AS `name`, t1.val AS `val`, t2.grouped_h_time AS `htime_at`"+
+			" FROM %s AS t1 JOIN ("+
+			" SELECT hd.item_name,"+
+			" CONCAT(DATE_FORMAT(h_time, '%s'), LPAD(FLOOR(DATE_FORMAT(h_time, '%s') / %d) * %d, 2, 0), '%s') AS grouped_h_time "+
+			" FROM %s AS hd"+
+			" LEFT JOIN dc_item_config as ic ON hd.item_name = ic.item_name "+
+			" WHERE hd.item_name = ? AND h_time >= ? AND h_time < ?"+
+			" AND (ic.id IS NULL OR (hd.val > ic.min_val AND hd.val < ic.max_val))"+
+			" GROUP BY hd.item_name,grouped_h_time) AS t2 ON t1.item_name = t2.item_name AND t1.h_time = t2.grouped_h_time"+
+			" WHERE t1.item_name = ? ORDER BY t1.h_time ASC",
+			m.getTableName(in.ProjectId), selectFormat, timeLpad, in.Size, in.Size, timeZero, m.getTableName(in.ProjectId))
+		err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ItemName, in.Stime, in.Etime, in.ItemName)
+	} else {
+		query := fmt.Sprintf("SELECT hd.item_name AS `name`, %s(val) AS `val`, "+
+			" CONCAT(DATE_FORMAT(h_time,'%s'),LPAD(FLOOR(DATE_FORMAT(h_time, '%s')/%d)*%d,2,0),'%s') AS `htime_at`"+
+			" FROM %s AS hd "+
+			" LEFT JOIN dc_item_config as ic ON hd.item_name = ic.item_name "+
+			" WHERE hd.item_name = ? AND h_time >= ?"+
+			" AND h_time < ?"+
+			" AND (ic.id IS NULL OR (hd.val > ic.min_val AND hd.val < ic.max_val))"+
+			" GROUP BY htime_at ORDER BY htime_at desc",
+			in.Aggregator, selectFormat, timeLpad, in.Size, in.Size, timeZero, m.getTableName(in.ProjectId))
+		err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ItemName, in.Stime, in.Etime)
+	}
+
+	switch err {
+	case nil:
+		return resp, nil
+	case sqlc.ErrNotFound:
+		return nil, ErrNotFound
+	default:
+		return nil, err
+	}
+}
+
 func (m *defaultDcItemHistoryDataModel) getTableName(projectId int64) string {
 	return fmt.Sprintf("dc_item_history_data_%d", projectId)
 }