Эх сурвалжийг харах

fit:
1. 膜组数据表, 增加filter_time
2. 配置线上tidb数据库

gaoyagang 1 жил өмнө
parent
commit
c5ffbf5ae0

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

@@ -13,7 +13,7 @@ Log:
 GtServerIp: 47.96.12.136:8788
 
 DtDataStoreDB:
-  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(192.168.60.201:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
+  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(172.16.0.194:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
 
 Redis:
   Host: 47.96.12.136:6379

+ 36 - 35
app/model/dcWorkingMfModel_gen.go

@@ -37,35 +37,36 @@ type (
 	}
 
 	DcWorkingMf struct {
-		Id               int64         `db:"id"`
-		ProjectId        int64         `db:"project_id"`
-		DeviceCode       string        `db:"device_code"`
-		WaterTemperature float64       `db:"water_temperature"` // 水温 摄氏度
-		FeedFlow         float64       `db:"feed_flow"`         // 进水流量
-		ConFlow          float64       `db:"con_flow"`          // 浓水流量
-		ProductFlow      float64       `db:"product_flow"`      // 产水流量
-		FeedPressure     float64       `db:"feed_pressure"`     // 进水压力
-		ConPressure      float64       `db:"con_pressure"`      // 浓水压力
-		ProductPressure  float64       `db:"product_pressure"`  // 产水压力
-		Tmp              float64       `db:"tmp"`               // 跨膜压差
-		Flux             float64       `db:"flux"`              // 膜通量
-		FeedWqTurbidity  float64       `db:"feed_wq_turbidity"` // 进水浊度
-		FeedWqPh         int64         `db:"feed_wq_ph"`        // 进水 PH 值
-		ProductWqPh      int64         `db:"product_wq_ph"`     // 产水 PH 值
-		FeedWqAl         float64       `db:"feed_wq_al"`        // 进水水质:铝
-		ProductWqAl      float64       `db:"product_wq_al"`     // 产水水质:铝
-		FeedWqFe         float64       `db:"feed_wq_fe"`        // 进水水质:铁
-		ProductWqFe      float64       `db:"product_wq_fe"`     // 产水水质:铁
-		FeedWqMn         float64       `db:"feed_wq_mn"`        // 进水水质:锰
-		ProductWqMn      float64       `db:"product_wq_mn"`     // 产水水质:锰
-		FeedWqSio2       float64       `db:"feed_wq_sio2"`      // 进水水质:二氧化硅
-		ProductWqSio2    float64       `db:"product_wq_sio2"`   // 产水水质:二氧化硅
-		FeedWqCod        float64       `db:"feed_wq_cod"`       // 进水水质:COD
-		ProductWqCod     float64       `db:"product_wq_cod"`    // 产水水质:COD
-		FeedWqP          float64       `db:"feed_wq_p"`         // 进水水质:磷
-		ProductWqP       float64       `db:"product_wq_p"`      // 产水水质:磷
-		Step             int64 `db:"step"`              // 设备当前步序值
-		CTime            time.Time     `db:"c_time"`
+		Id               int64     `db:"id"`
+		ProjectId        int64     `db:"project_id"`
+		DeviceCode       string    `db:"device_code"`
+		WaterTemperature float64   `db:"water_temperature"` // 水温 摄氏度
+		FeedFlow         float64   `db:"feed_flow"`         // 进水流量
+		ConFlow          float64   `db:"con_flow"`          // 浓水流量
+		ProductFlow      float64   `db:"product_flow"`      // 产水流量
+		FeedPressure     float64   `db:"feed_pressure"`     // 进水压力
+		ConPressure      float64   `db:"con_pressure"`      // 浓水压力
+		ProductPressure  float64   `db:"product_pressure"`  // 产水压力
+		Tmp              float64   `db:"tmp"`               // 跨膜压差
+		Flux             float64   `db:"flux"`              // 膜通量
+		FeedWqTurbidity  float64   `db:"feed_wq_turbidity"` // 进水浊度
+		FeedWqPh         int64     `db:"feed_wq_ph"`        // 进水 PH 值
+		ProductWqPh      int64     `db:"product_wq_ph"`     // 产水 PH 值
+		FeedWqAl         float64   `db:"feed_wq_al"`        // 进水水质:铝
+		ProductWqAl      float64   `db:"product_wq_al"`     // 产水水质:铝
+		FeedWqFe         float64   `db:"feed_wq_fe"`        // 进水水质:铁
+		ProductWqFe      float64   `db:"product_wq_fe"`     // 产水水质:铁
+		FeedWqMn         float64   `db:"feed_wq_mn"`        // 进水水质:锰
+		ProductWqMn      float64   `db:"product_wq_mn"`     // 产水水质:锰
+		FeedWqSio2       float64   `db:"feed_wq_sio2"`      // 进水水质:二氧化硅
+		ProductWqSio2    float64   `db:"product_wq_sio2"`   // 产水水质:二氧化硅
+		FeedWqCod        float64   `db:"feed_wq_cod"`       // 进水水质:COD
+		ProductWqCod     float64   `db:"product_wq_cod"`    // 产水水质:COD
+		FeedWqP          float64   `db:"feed_wq_p"`         // 进水水质:磷
+		ProductWqP       float64   `db:"product_wq_p"`      // 产水水质:磷
+		Step             int64     `db:"step"`              // 设备当前步序值
+		FilterTime       float64   `db:"filter_time"`       // 过滤时间
+		CTime            time.Time `db:"c_time"`
 	}
 )
 
@@ -104,11 +105,11 @@ func (m *defaultDcWorkingMfModel) FindOne(ctx context.Context, id int64) (*DcWor
 }
 
 func (m *defaultDcWorkingMfModel) MultiInsert(ctx context.Context, datas []DcWorkingMf) (int64, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingMfRowsExpectAutoSet)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingMfRowsExpectAutoSet)
 
-	if bulk, err := sqlx.NewBulkInserter(m.conn, query);err == nil {
+	if bulk, err := sqlx.NewBulkInserter(m.conn, query); err == nil {
 		for _, data := range datas {
-			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime);err != nil {
+			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime); err != nil {
 				return 0, err
 			}
 		}
@@ -121,14 +122,14 @@ func (m *defaultDcWorkingMfModel) MultiInsert(ctx context.Context, datas []DcWor
 }
 
 func (m *defaultDcWorkingMfModel) Insert(ctx context.Context, data *DcWorkingMf) (sql.Result, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingMfRowsExpectAutoSet)
-	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingMfRowsExpectAutoSet)
+	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime)
 	return ret, err
 }
 
 func (m *defaultDcWorkingMfModel) Update(ctx context.Context, data *DcWorkingMf) error {
 	query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, dcWorkingMfRowsWithPlaceHolder)
-	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime, data.Id)
+	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime, data.Id)
 	return err
 }
 

+ 55 - 54
app/model/dcWorkingNfModel_gen.go

@@ -37,54 +37,55 @@ type (
 	}
 
 	DcWorkingNf struct {
-		Id                 int64         `db:"id"`
-		ProjectId          int64         `db:"project_id"`
-		DeviceCode         string        `db:"device_code"`
-		WaterTemperature   float64       `db:"water_temperature"`    // 水温 摄氏度
-		FeedFlow1St        float64       `db:"feed_flow_1st"`        // 一段进水流量
-		ConFlow1St         float64       `db:"con_flow_1st"`         // 一段浓水流量
-		ProductFlow1St     float64       `db:"product_flow_1st"`     // 一段产水流量
-		FeedPressure1St    float64       `db:"feed_pressure_1st"`    // 一段进水压力
-		ConPressure1St     float64       `db:"con_pressure_1st"`     // 一段浓水压力
-		ProductPressure1St float64       `db:"product_pressure_1st"` // 一段产水压力
-		Tmp1St             float64       `db:"tmp_1st"`              // 一段跨膜压差
-		Flux1St            float64       `db:"flux_1st"`             // 一段膜通量
-		Permeability1St    float64       `db:"permeability_1st"`     // 一段渗透率
-		FeedFlow2Nd        float64       `db:"feed_flow_2nd"`        // 二段进水流量
-		ConFlow2Nd         float64       `db:"con_flow_2nd"`         // 二段浓水流量
-		ProductFlow2Nd     float64       `db:"product_flow_2nd"`     // 二段产水流量
-		FeedPressure2Nd    float64       `db:"feed_pressure_2nd"`    // 二段进水压力
-		ConPressure2Nd     float64       `db:"con_pressure_2nd"`     // 二段浓水压力
-		ProductPressure2Nd float64       `db:"product_pressure_2nd"` // 二段产水压力
-		Tmp2Nd             float64       `db:"tmp_2nd"`              // 二段压差
-		Flux2Nd            float64       `db:"flux_2nd"`             // 二段通量
-		Permeability2Nd    float64       `db:"permeability_2nd"`     // 二段渗透率
-		FeedFlow3Th        float64       `db:"feed_flow_3th"`        // 三段进水流量
-		ConFlow3Th         float64       `db:"con_flow_3th"`         // 三段浓水流量
-		ProductFlow3Th     float64       `db:"product_flow_3th"`     // 三段产水流量
-		FeedPressure3Th    float64       `db:"feed_pressure_3th"`    // 三段进水压力
-		ConPressure3Th     float64       `db:"con_pressure_3th"`     // 三段浓水压力
-		ProductPressure3Th float64       `db:"product_pressure_3th"` // 三段产水压力
-		Tmp3Th             float64       `db:"tmp_3th"`              // 三段压差
-		Flux3Th            float64       `db:"flux_3th"`             // 三段通量
-		Permeability3Th    float64       `db:"permeability_3th"`     // 三段渗透率
-		FeedWqTurbidity    float64       `db:"feed_wq_turbidity"`    // 进水浊度
-		FeedWqPh           int64         `db:"feed_wq_ph"`           // 进水 PH 值
-		ProductWqPh        int64         `db:"product_wq_ph"`        // 产水 PH 值
-		FeedWqAl           float64       `db:"feed_wq_al"`           // 进水水质:铝
-		ProductWqAl        float64       `db:"product_wq_al"`        // 产水水质:铝
-		FeedWqFe           float64       `db:"feed_wq_fe"`           // 进水水质:铁
-		ProductWqFe        float64       `db:"product_wq_fe"`        // 产水水质:铁
-		FeedWqMn           float64       `db:"feed_wq_mn"`           // 进水水质:锰
-		ProductWqMn        float64       `db:"product_wq_mn"`        // 产水水质:锰
-		FeedWqSio2         float64       `db:"feed_wq_sio2"`         // 进水水质:二氧化硅
-		ProductWqSio2      float64       `db:"product_wq_sio2"`      // 产水水质:二氧化硅
-		FeedWqCod          float64       `db:"feed_wq_cod"`          // 进水水质:COD
-		ProductWqCod       float64       `db:"product_wq_cod"`       // 产水水质:COD
-		FeedWqP            float64       `db:"feed_wq_p"`            // 进水水质:磷
-		ProductWqP         float64       `db:"product_wq_p"`         // 产水水质:磷
-		Step               int64 `db:"step"`                 // 设备当前步序值
-		CTime              time.Time     `db:"c_time"`
+		Id                 int64     `db:"id"`
+		ProjectId          int64     `db:"project_id"`
+		DeviceCode         string    `db:"device_code"`
+		WaterTemperature   float64   `db:"water_temperature"`    // 水温 摄氏度
+		FeedFlow1St        float64   `db:"feed_flow_1st"`        // 一段进水流量
+		ConFlow1St         float64   `db:"con_flow_1st"`         // 一段浓水流量
+		ProductFlow1St     float64   `db:"product_flow_1st"`     // 一段产水流量
+		FeedPressure1St    float64   `db:"feed_pressure_1st"`    // 一段进水压力
+		ConPressure1St     float64   `db:"con_pressure_1st"`     // 一段浓水压力
+		ProductPressure1St float64   `db:"product_pressure_1st"` // 一段产水压力
+		Tmp1St             float64   `db:"tmp_1st"`              // 一段跨膜压差
+		Flux1St            float64   `db:"flux_1st"`             // 一段膜通量
+		Permeability1St    float64   `db:"permeability_1st"`     // 一段渗透率
+		FeedFlow2Nd        float64   `db:"feed_flow_2nd"`        // 二段进水流量
+		ConFlow2Nd         float64   `db:"con_flow_2nd"`         // 二段浓水流量
+		ProductFlow2Nd     float64   `db:"product_flow_2nd"`     // 二段产水流量
+		FeedPressure2Nd    float64   `db:"feed_pressure_2nd"`    // 二段进水压力
+		ConPressure2Nd     float64   `db:"con_pressure_2nd"`     // 二段浓水压力
+		ProductPressure2Nd float64   `db:"product_pressure_2nd"` // 二段产水压力
+		Tmp2Nd             float64   `db:"tmp_2nd"`              // 二段压差
+		Flux2Nd            float64   `db:"flux_2nd"`             // 二段通量
+		Permeability2Nd    float64   `db:"permeability_2nd"`     // 二段渗透率
+		FeedFlow3Th        float64   `db:"feed_flow_3th"`        // 三段进水流量
+		ConFlow3Th         float64   `db:"con_flow_3th"`         // 三段浓水流量
+		ProductFlow3Th     float64   `db:"product_flow_3th"`     // 三段产水流量
+		FeedPressure3Th    float64   `db:"feed_pressure_3th"`    // 三段进水压力
+		ConPressure3Th     float64   `db:"con_pressure_3th"`     // 三段浓水压力
+		ProductPressure3Th float64   `db:"product_pressure_3th"` // 三段产水压力
+		Tmp3Th             float64   `db:"tmp_3th"`              // 三段压差
+		Flux3Th            float64   `db:"flux_3th"`             // 三段通量
+		Permeability3Th    float64   `db:"permeability_3th"`     // 三段渗透率
+		FeedWqTurbidity    float64   `db:"feed_wq_turbidity"`    // 进水浊度
+		FeedWqPh           int64     `db:"feed_wq_ph"`           // 进水 PH 值
+		ProductWqPh        int64     `db:"product_wq_ph"`        // 产水 PH 值
+		FeedWqAl           float64   `db:"feed_wq_al"`           // 进水水质:铝
+		ProductWqAl        float64   `db:"product_wq_al"`        // 产水水质:铝
+		FeedWqFe           float64   `db:"feed_wq_fe"`           // 进水水质:铁
+		ProductWqFe        float64   `db:"product_wq_fe"`        // 产水水质:铁
+		FeedWqMn           float64   `db:"feed_wq_mn"`           // 进水水质:锰
+		ProductWqMn        float64   `db:"product_wq_mn"`        // 产水水质:锰
+		FeedWqSio2         float64   `db:"feed_wq_sio2"`         // 进水水质:二氧化硅
+		ProductWqSio2      float64   `db:"product_wq_sio2"`      // 产水水质:二氧化硅
+		FeedWqCod          float64   `db:"feed_wq_cod"`          // 进水水质:COD
+		ProductWqCod       float64   `db:"product_wq_cod"`       // 产水水质:COD
+		FeedWqP            float64   `db:"feed_wq_p"`            // 进水水质:磷
+		ProductWqP         float64   `db:"product_wq_p"`         // 产水水质:磷
+		Step               int64     `db:"step"`                 // 设备当前步序值
+		FilterTime         float64   `db:"filter_time"`          // 过滤时间
+		CTime              time.Time `db:"c_time"`
 	}
 )
 
@@ -123,11 +124,11 @@ func (m *defaultDcWorkingNfModel) FindOne(ctx context.Context, id int64) (*DcWor
 }
 
 func (m *defaultDcWorkingNfModel) MultiInsert(ctx context.Context, datas []DcWorkingNf) (int64, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingNfRowsExpectAutoSet)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingNfRowsExpectAutoSet)
 
-	if bulk, err := sqlx.NewBulkInserter(m.conn, query);err == nil {
+	if bulk, err := sqlx.NewBulkInserter(m.conn, query); err == nil {
 		for _, data := range datas {
-			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime);err != nil {
+			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime); err != nil {
 				return 0, err
 			}
 		}
@@ -140,14 +141,14 @@ func (m *defaultDcWorkingNfModel) MultiInsert(ctx context.Context, datas []DcWor
 }
 
 func (m *defaultDcWorkingNfModel) Insert(ctx context.Context, data *DcWorkingNf) (sql.Result, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingNfRowsExpectAutoSet)
-	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingNfRowsExpectAutoSet)
+	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime)
 	return ret, err
 }
 
 func (m *defaultDcWorkingNfModel) Update(ctx context.Context, data *DcWorkingNf) error {
 	query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, dcWorkingNfRowsWithPlaceHolder)
-	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime, data.Id)
+	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime, data.Id)
 	return err
 }
 

+ 55 - 54
app/model/dcWorkingRoModel_gen.go

@@ -37,54 +37,55 @@ type (
 	}
 
 	DcWorkingRo struct {
-		Id                 int64         `db:"id"`
-		ProjectId          int64         `db:"project_id"`
-		DeviceCode         string        `db:"device_code"`
-		WaterTemperature   float64       `db:"water_temperature"`    // 水温 摄氏度
-		FeedFlow1St        float64       `db:"feed_flow_1st"`        // 一段进水流量
-		ConFlow1St         float64       `db:"con_flow_1st"`         // 一段浓水流量
-		ProductFlow1St     float64       `db:"product_flow_1st"`     // 一段产水流量
-		FeedPressure1St    float64       `db:"feed_pressure_1st"`    // 一段进水压力
-		ConPressure1St     float64       `db:"con_pressure_1st"`     // 一段浓水压力
-		ProductPressure1St float64       `db:"product_pressure_1st"` // 一段产水压力
-		Tmp1St             float64       `db:"tmp_1st"`              // 一段跨膜压差
-		Flux1St            float64       `db:"flux_1st"`             // 一段膜通量
-		Permeability1St    float64       `db:"permeability_1st"`     // 一段渗透率
-		FeedFlow2Nd        float64       `db:"feed_flow_2nd"`        // 二段进水流量
-		ConFlow2Nd         float64       `db:"con_flow_2nd"`         // 二段浓水流量
-		ProductFlow2Nd     float64       `db:"product_flow_2nd"`     // 二段产水流量
-		FeedPressure2Nd    float64       `db:"feed_pressure_2nd"`    // 二段进水压力
-		ConPressure2Nd     float64       `db:"con_pressure_2nd"`     // 二段浓水压力
-		ProductPressure2Nd float64       `db:"product_pressure_2nd"` // 二段产水压力
-		Tmp2Nd             float64       `db:"tmp_2nd"`              // 二段压差
-		Flux2Nd            float64       `db:"flux_2nd"`             // 二段通量
-		Permeability2Nd    float64       `db:"permeability_2nd"`     // 二段渗透率
-		FeedFlow3Th        float64       `db:"feed_flow_3th"`        // 三段进水流量
-		ConFlow3Th         float64       `db:"con_flow_3th"`         // 三段浓水流量
-		ProductFlow3Th     float64       `db:"product_flow_3th"`     // 三段产水流量
-		FeedPressure3Th    float64       `db:"feed_pressure_3th"`    // 三段进水压力
-		ConPressure3Th     float64       `db:"con_pressure_3th"`     // 三段浓水压力
-		ProductPressure3Th float64       `db:"product_pressure_3th"` // 三段产水压力
-		Tmp3Th             float64       `db:"tmp_3th"`              // 三段压差
-		Flux3Th            float64       `db:"flux_3th"`             // 三段通量
-		Permeability3Th    float64       `db:"permeability_3th"`     // 三段渗透率
-		FeedWqTurbidity    float64       `db:"feed_wq_turbidity"`    // 进水浊度
-		FeedWqPh           int64         `db:"feed_wq_ph"`           // 进水 PH 值
-		ProductWqPh        int64         `db:"product_wq_ph"`        // 产水 PH 值
-		FeedWqAl           float64       `db:"feed_wq_al"`           // 进水水质:铝
-		ProductWqAl        float64       `db:"product_wq_al"`        // 产水水质:铝
-		FeedWqFe           float64       `db:"feed_wq_fe"`           // 进水水质:铁
-		ProductWqFe        float64       `db:"product_wq_fe"`        // 产水水质:铁
-		FeedWqMn           float64       `db:"feed_wq_mn"`           // 进水水质:锰
-		ProductWqMn        float64       `db:"product_wq_mn"`        // 产水水质:锰
-		FeedWqSio2         float64       `db:"feed_wq_sio2"`         // 进水水质:二氧化硅
-		ProductWqSio2      float64       `db:"product_wq_sio2"`      // 产水水质:二氧化硅
-		FeedWqCod          float64       `db:"feed_wq_cod"`          // 进水水质:COD
-		ProductWqCod       float64       `db:"product_wq_cod"`       // 产水水质:COD
-		FeedWqP            float64       `db:"feed_wq_p"`            // 进水水质:磷
-		ProductWqP         float64       `db:"product_wq_p"`         // 产水水质:磷
-		Step               int64 `db:"step"`                 // 设备当前步序值
-		CTime              time.Time     `db:"c_time"`
+		Id                 int64     `db:"id"`
+		ProjectId          int64     `db:"project_id"`
+		DeviceCode         string    `db:"device_code"`
+		WaterTemperature   float64   `db:"water_temperature"`    // 水温 摄氏度
+		FeedFlow1St        float64   `db:"feed_flow_1st"`        // 一段进水流量
+		ConFlow1St         float64   `db:"con_flow_1st"`         // 一段浓水流量
+		ProductFlow1St     float64   `db:"product_flow_1st"`     // 一段产水流量
+		FeedPressure1St    float64   `db:"feed_pressure_1st"`    // 一段进水压力
+		ConPressure1St     float64   `db:"con_pressure_1st"`     // 一段浓水压力
+		ProductPressure1St float64   `db:"product_pressure_1st"` // 一段产水压力
+		Tmp1St             float64   `db:"tmp_1st"`              // 一段跨膜压差
+		Flux1St            float64   `db:"flux_1st"`             // 一段膜通量
+		Permeability1St    float64   `db:"permeability_1st"`     // 一段渗透率
+		FeedFlow2Nd        float64   `db:"feed_flow_2nd"`        // 二段进水流量
+		ConFlow2Nd         float64   `db:"con_flow_2nd"`         // 二段浓水流量
+		ProductFlow2Nd     float64   `db:"product_flow_2nd"`     // 二段产水流量
+		FeedPressure2Nd    float64   `db:"feed_pressure_2nd"`    // 二段进水压力
+		ConPressure2Nd     float64   `db:"con_pressure_2nd"`     // 二段浓水压力
+		ProductPressure2Nd float64   `db:"product_pressure_2nd"` // 二段产水压力
+		Tmp2Nd             float64   `db:"tmp_2nd"`              // 二段压差
+		Flux2Nd            float64   `db:"flux_2nd"`             // 二段通量
+		Permeability2Nd    float64   `db:"permeability_2nd"`     // 二段渗透率
+		FeedFlow3Th        float64   `db:"feed_flow_3th"`        // 三段进水流量
+		ConFlow3Th         float64   `db:"con_flow_3th"`         // 三段浓水流量
+		ProductFlow3Th     float64   `db:"product_flow_3th"`     // 三段产水流量
+		FeedPressure3Th    float64   `db:"feed_pressure_3th"`    // 三段进水压力
+		ConPressure3Th     float64   `db:"con_pressure_3th"`     // 三段浓水压力
+		ProductPressure3Th float64   `db:"product_pressure_3th"` // 三段产水压力
+		Tmp3Th             float64   `db:"tmp_3th"`              // 三段压差
+		Flux3Th            float64   `db:"flux_3th"`             // 三段通量
+		Permeability3Th    float64   `db:"permeability_3th"`     // 三段渗透率
+		FeedWqTurbidity    float64   `db:"feed_wq_turbidity"`    // 进水浊度
+		FeedWqPh           int64     `db:"feed_wq_ph"`           // 进水 PH 值
+		ProductWqPh        int64     `db:"product_wq_ph"`        // 产水 PH 值
+		FeedWqAl           float64   `db:"feed_wq_al"`           // 进水水质:铝
+		ProductWqAl        float64   `db:"product_wq_al"`        // 产水水质:铝
+		FeedWqFe           float64   `db:"feed_wq_fe"`           // 进水水质:铁
+		ProductWqFe        float64   `db:"product_wq_fe"`        // 产水水质:铁
+		FeedWqMn           float64   `db:"feed_wq_mn"`           // 进水水质:锰
+		ProductWqMn        float64   `db:"product_wq_mn"`        // 产水水质:锰
+		FeedWqSio2         float64   `db:"feed_wq_sio2"`         // 进水水质:二氧化硅
+		ProductWqSio2      float64   `db:"product_wq_sio2"`      // 产水水质:二氧化硅
+		FeedWqCod          float64   `db:"feed_wq_cod"`          // 进水水质:COD
+		ProductWqCod       float64   `db:"product_wq_cod"`       // 产水水质:COD
+		FeedWqP            float64   `db:"feed_wq_p"`            // 进水水质:磷
+		ProductWqP         float64   `db:"product_wq_p"`         // 产水水质:磷
+		Step               int64     `db:"step"`                 // 设备当前步序值
+		FilterTime         float64   `db:"filter_time"`          // 过滤时间
+		CTime              time.Time `db:"c_time"`
 	}
 )
 
@@ -123,11 +124,11 @@ func (m *defaultDcWorkingRoModel) FindOne(ctx context.Context, id int64) (*DcWor
 }
 
 func (m *defaultDcWorkingRoModel) MultiInsert(ctx context.Context, datas []DcWorkingRo) (int64, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingRoRowsExpectAutoSet)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingRoRowsExpectAutoSet)
 
-	if bulk, err := sqlx.NewBulkInserter(m.conn, query);err == nil {
+	if bulk, err := sqlx.NewBulkInserter(m.conn, query); err == nil {
 		for _, data := range datas {
-			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime);err != nil {
+			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime); err != nil {
 				return 0, err
 			}
 		}
@@ -140,14 +141,14 @@ func (m *defaultDcWorkingRoModel) MultiInsert(ctx context.Context, datas []DcWor
 }
 
 func (m *defaultDcWorkingRoModel) Insert(ctx context.Context, data *DcWorkingRo) (sql.Result, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingRoRowsExpectAutoSet)
-	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingRoRowsExpectAutoSet)
+	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime)
 	return ret, err
 }
 
 func (m *defaultDcWorkingRoModel) Update(ctx context.Context, data *DcWorkingRo) error {
 	query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, dcWorkingRoRowsWithPlaceHolder)
-	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime, data.Id)
+	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow1St, data.ConFlow1St, data.ProductFlow1St, data.FeedPressure1St, data.ConPressure1St, data.ProductPressure1St, data.Tmp1St, data.Flux1St, data.Permeability1St, data.FeedFlow2Nd, data.ConFlow2Nd, data.ProductFlow2Nd, data.FeedPressure2Nd, data.ConPressure2Nd, data.ProductPressure2Nd, data.Tmp2Nd, data.Flux2Nd, data.Permeability2Nd, data.FeedFlow3Th, data.ConFlow3Th, data.ProductFlow3Th, data.FeedPressure3Th, data.ConPressure3Th, data.ProductPressure3Th, data.Tmp3Th, data.Flux3Th, data.Permeability3Th, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime, data.Id)
 	return err
 }
 

+ 36 - 35
app/model/dcWorkingUfModel_gen.go

@@ -37,35 +37,36 @@ type (
 	}
 
 	DcWorkingUf struct {
-		Id               int64         `db:"id"`
-		ProjectId        int64         `db:"project_id"`
-		DeviceCode       string        `db:"device_code"`
-		WaterTemperature float64       `db:"water_temperature"` // 水温 摄氏度
-		FeedFlow         float64       `db:"feed_flow"`         // 进水流量
-		ConFlow          float64       `db:"con_flow"`          // 浓水流量
-		ProductFlow      float64       `db:"product_flow"`      // 产水流量
-		FeedPressure     float64       `db:"feed_pressure"`     // 进水压力
-		ConPressure      float64       `db:"con_pressure"`      // 浓水压力
-		ProductPressure  float64       `db:"product_pressure"`  // 产水压力
-		Tmp              float64       `db:"tmp"`               // 跨膜压差
-		Flux             float64       `db:"flux"`              // 膜通量
-		FeedWqTurbidity  float64       `db:"feed_wq_turbidity"` // 进水浊度
-		FeedWqPh         int64         `db:"feed_wq_ph"`        // 进水 PH 值
-		ProductWqPh      int64         `db:"product_wq_ph"`     // 产水 PH 值
-		FeedWqAl         float64       `db:"feed_wq_al"`        // 进水水质:铝
-		ProductWqAl      float64       `db:"product_wq_al"`     // 产水水质:铝
-		FeedWqFe         float64       `db:"feed_wq_fe"`        // 进水水质:铁
-		ProductWqFe      float64       `db:"product_wq_fe"`     // 产水水质:铁
-		FeedWqMn         float64       `db:"feed_wq_mn"`        // 进水水质:锰
-		ProductWqMn      float64       `db:"product_wq_mn"`     // 产水水质:锰
-		FeedWqSio2       float64       `db:"feed_wq_sio2"`      // 进水水质:二氧化硅
-		ProductWqSio2    float64       `db:"product_wq_sio2"`   // 产水水质:二氧化硅
-		FeedWqCod        float64       `db:"feed_wq_cod"`       // 进水水质:COD
-		ProductWqCod     float64       `db:"product_wq_cod"`    // 产水水质:COD
-		FeedWqP          float64       `db:"feed_wq_p"`         // 进水水质:磷
-		ProductWqP       float64       `db:"product_wq_p"`      // 产水水质:磷
-		Step             int64 `db:"step"`              // 设备当前步序值
-		CTime            time.Time     `db:"c_time"`
+		Id               int64     `db:"id"`
+		ProjectId        int64     `db:"project_id"`
+		DeviceCode       string    `db:"device_code"`
+		WaterTemperature float64   `db:"water_temperature"` // 水温 摄氏度
+		FeedFlow         float64   `db:"feed_flow"`         // 进水流量
+		ConFlow          float64   `db:"con_flow"`          // 浓水流量
+		ProductFlow      float64   `db:"product_flow"`      // 产水流量
+		FeedPressure     float64   `db:"feed_pressure"`     // 进水压力
+		ConPressure      float64   `db:"con_pressure"`      // 浓水压力
+		ProductPressure  float64   `db:"product_pressure"`  // 产水压力
+		Tmp              float64   `db:"tmp"`               // 跨膜压差
+		Flux             float64   `db:"flux"`              // 膜通量
+		FeedWqTurbidity  float64   `db:"feed_wq_turbidity"` // 进水浊度
+		FeedWqPh         int64     `db:"feed_wq_ph"`        // 进水 PH 值
+		ProductWqPh      int64     `db:"product_wq_ph"`     // 产水 PH 值
+		FeedWqAl         float64   `db:"feed_wq_al"`        // 进水水质:铝
+		ProductWqAl      float64   `db:"product_wq_al"`     // 产水水质:铝
+		FeedWqFe         float64   `db:"feed_wq_fe"`        // 进水水质:铁
+		ProductWqFe      float64   `db:"product_wq_fe"`     // 产水水质:铁
+		FeedWqMn         float64   `db:"feed_wq_mn"`        // 进水水质:锰
+		ProductWqMn      float64   `db:"product_wq_mn"`     // 产水水质:锰
+		FeedWqSio2       float64   `db:"feed_wq_sio2"`      // 进水水质:二氧化硅
+		ProductWqSio2    float64   `db:"product_wq_sio2"`   // 产水水质:二氧化硅
+		FeedWqCod        float64   `db:"feed_wq_cod"`       // 进水水质:COD
+		ProductWqCod     float64   `db:"product_wq_cod"`    // 产水水质:COD
+		FeedWqP          float64   `db:"feed_wq_p"`         // 进水水质:磷
+		ProductWqP       float64   `db:"product_wq_p"`      // 产水水质:磷
+		Step             int64     `db:"step"`              // 设备当前步序值
+		FilterTime       float64   `db:"filter_time"`       // 过滤时间
+		CTime            time.Time `db:"c_time"`
 	}
 )
 
@@ -104,11 +105,11 @@ func (m *defaultDcWorkingUfModel) FindOne(ctx context.Context, id int64) (*DcWor
 }
 
 func (m *defaultDcWorkingUfModel) MultiInsert(ctx context.Context, datas []DcWorkingUf) (int64, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingUfRowsExpectAutoSet)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingUfRowsExpectAutoSet)
 
-	if bulk, err := sqlx.NewBulkInserter(m.conn, query);err == nil {
+	if bulk, err := sqlx.NewBulkInserter(m.conn, query); err == nil {
 		for _, data := range datas {
-			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime);err != nil {
+			if err = bulk.Insert(data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime); err != nil {
 				return 0, err
 			}
 		}
@@ -121,14 +122,14 @@ func (m *defaultDcWorkingUfModel) MultiInsert(ctx context.Context, datas []DcWor
 }
 
 func (m *defaultDcWorkingUfModel) Insert(ctx context.Context, data *DcWorkingUf) (sql.Result, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingUfRowsExpectAutoSet)
-	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime)
+	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, dcWorkingUfRowsExpectAutoSet)
+	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime)
 	return ret, err
 }
 
 func (m *defaultDcWorkingUfModel) Update(ctx context.Context, data *DcWorkingUf) error {
 	query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, dcWorkingUfRowsWithPlaceHolder)
-	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.CTime, data.Id)
+	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.DeviceCode, data.WaterTemperature, data.FeedFlow, data.ConFlow, data.ProductFlow, data.FeedPressure, data.ConPressure, data.ProductPressure, data.Tmp, data.Flux, data.FeedWqTurbidity, data.FeedWqPh, data.ProductWqPh, data.FeedWqAl, data.ProductWqAl, data.FeedWqFe, data.ProductWqFe, data.FeedWqMn, data.ProductWqMn, data.FeedWqSio2, data.ProductWqSio2, data.FeedWqCod, data.ProductWqCod, data.FeedWqP, data.ProductWqP, data.Step, data.FilterTime, data.CTime, data.Id)
 	return err
 }
 

+ 7 - 2
deploy/test.sh

@@ -3,7 +3,7 @@
 # 机器: 192.168.60.201
 # 账号: gaoyagang 互信已添加
 user="gt"
-target="192.168.60.201"
+target="47.96.12.136"
 
 # 编译
 build () {
@@ -26,6 +26,11 @@ upload () {
     if [ "$?" != "0" ]; then
         exit $?
     fi
+
+    echo "start upload ${1}.yaml"
+    rsync -av ./app/cmd/${1}/etc/${1}.yaml ${user}@${target}:/home/${user}/etc/${1}.yaml
+    echo "remove ${1}"
+    rm -f ./${1}
 }
 
 # 清理中间资源
@@ -37,7 +42,7 @@ clear () {
 restart () {
     echo "restart ${1} and wait 2 seconds..."
     sleep 2
-    ssh ${user}@${target} supervisorctl restart ${1}
+    ssh ${user}@${target} sudo /usr/local/bin/supervisorctl restart ${1}
 }
 
 deploy () {