mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
生产报表添加统计字段
This commit is contained in:
@@ -2,11 +2,17 @@ package cn.lihongjie.coal.coalWashingMonthReport.dto;
|
||||
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
|
||||
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CoalWashingMonthReportDto extends OrgCommonDto {
|
||||
@@ -26,4 +32,15 @@ public class CoalWashingMonthReportDto extends OrgCommonDto {
|
||||
private String remark11;
|
||||
private Double days;
|
||||
|
||||
|
||||
private Double runHours;
|
||||
private Integer cnt;
|
||||
|
||||
|
||||
|
||||
|
||||
@Column(columnDefinition = "text[]")
|
||||
@Type(ListArrayType.class)
|
||||
private List<String> ids;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,19 @@ package cn.lihongjie.coal.coalWashingMonthReport.entity;
|
||||
|
||||
import cn.lihongjie.coal.base.entity.OrgCommonEntity;
|
||||
|
||||
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Subselect;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@@ -67,7 +72,10 @@ select gen_random_uuid()::text as id,
|
||||
'' as create_user_id,
|
||||
'' as update_user_id,
|
||||
null as file_ids,
|
||||
round(sum(d.xx), 2) as days
|
||||
round(sum(d.xx), 2) as days,
|
||||
sum(d.run_hours) as run_hours,
|
||||
count(1) as cnt,
|
||||
array_agg(d.id) as ids
|
||||
from ((select 1.0 / count(1) over (partition by date_trunc('day', date)) as xx , *
|
||||
from t_coal_washing_daily_analysis)) d
|
||||
group by d.organization_id, d.name, date_trunc('month', d.date)
|
||||
@@ -90,5 +98,15 @@ public class CoalWashingMonthReportEntity extends OrgCommonEntity {
|
||||
private String remark11;
|
||||
|
||||
private Double days;
|
||||
private Double runHours;
|
||||
private Integer cnt;
|
||||
|
||||
|
||||
|
||||
|
||||
@Column(columnDefinition = "text[]")
|
||||
@Type(ListArrayType.class)
|
||||
private List<String> ids;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user