mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
水电表统计小数位处理
This commit is contained in:
@@ -37,7 +37,7 @@ order by DATE_TRUNC('day', time), meter_id, organization_id, t_meter_log.time de
|
||||
|
||||
""")
|
||||
|
||||
@jakarta.persistence.Table(indexes = @jakarta.persistence.Index(name ="idx_meter_day_log_org_id", columnList = "organization_id"))
|
||||
//@jakarta.persistence.Table(indexes = @jakarta.persistence.Index(name ="idx_meter_day_log_org_id", columnList = "organization_id"))
|
||||
|
||||
public class MeterDayLogEntity extends OrgCommonEntity {
|
||||
|
||||
@@ -52,6 +52,6 @@ public class MeterDayLogEntity extends OrgCommonEntity {
|
||||
|
||||
@Formula("( lag(value, 1, (select tm.init_value from t_meter tm where tm.id = meter_id)) over (partition by meter_id order by time asc ) )")
|
||||
private java.lang.Double previousValue;
|
||||
@Formula(" ( value - ( lag(value, 1, (select tm.init_value from t_meter tm where tm.id = meter_id)) over (partition by meter_id order by time asc ) ) )")
|
||||
@Formula(" (round( ( value - ( lag(value, 1, (select tm.init_value from t_meter tm where tm.id = meter_id)) over (partition by meter_id order by time asc ) ) )::numeric, 2))")
|
||||
private java.lang.Double usage;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ order by DATE_TRUNC('month', time), meter_id, organization_id, t_meter_log.time
|
||||
|
||||
""")
|
||||
|
||||
@jakarta.persistence.Table(indexes = @jakarta.persistence.Index(name ="idx_meter_month_log_org_id", columnList = "organization_id"))
|
||||
//@jakarta.persistence.Table(indexes = @jakarta.persistence.Index(name ="idx_meter_month_log_org_id", columnList = "organization_id"))
|
||||
|
||||
public class MeterMonthLogEntity extends OrgCommonEntity {
|
||||
|
||||
@@ -52,6 +52,6 @@ public class MeterMonthLogEntity extends OrgCommonEntity {
|
||||
|
||||
@Formula("( lag(value, 1, (select tm.init_value from t_meter tm where tm.id = meter_id)) over (partition by meter_id order by time asc ) )")
|
||||
private java.lang.Double previousValue;
|
||||
@Formula(" ( value - ( lag(value, 1, (select tm.init_value from t_meter tm where tm.id = meter_id)) over (partition by meter_id order by time asc ) ) )")
|
||||
@Formula(" (round(( value - ( lag(value, 1, (select tm.init_value from t_meter tm where tm.id = meter_id)) over (partition by meter_id order by time asc ) ) )::numeric, 2))")
|
||||
private java.lang.Double usage;
|
||||
}
|
||||
Reference in New Issue
Block a user