完善原煤配煤

This commit is contained in:
2024-01-13 20:09:13 +08:00
parent 3269609091
commit 89c5f91e18
4 changed files with 56 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
import java.util.List;
@@ -33,6 +34,19 @@ public class CoalBlendDto extends OrgCommonDto {
private String blendTypeName;
private String blendType;
@Comment("煤类型")
private String coalType;
@Formula(
"(select i.name\n"
+ "from t_dictionary d,\n"
+ " t_dictionary_item i\n"
+ "where d.id = i.dictionary_id\n"
+ " and d.code = 'coalBlend.coalType'\n"
+ " and i.code = coal_type)")
private String coalTypeName;
@Comment("结果个数")
private Integer count = 20;

View File

@@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -29,6 +32,19 @@ public class CoalBlendRequest {
/** 最长等待时间 */
private Long maxTime = 10L;
@Comment("煤类型")
private String coalType;
@Formula(
"(select i.name\n"
+ "from t_dictionary d,\n"
+ " t_dictionary_item i\n"
+ "where d.id = i.dictionary_id\n"
+ " and d.code = 'coalBlend.coalType'\n"
+ " and i.code = coal_type)")
private String coalTypeName;
public Map<String, CoalConstraint> getConstraintMap() {
if (constraintMap == null) {
if (constraints != null) {

View File

@@ -11,6 +11,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
import java.util.List;
@@ -33,6 +34,18 @@ public class CreateCoalBlendDto extends OrgCommonDto {
private String blendTypeName;
private String blendType;
@Comment("煤类型")
private String coalType;
@Formula(
"(select i.name\n"
+ "from t_dictionary d,\n"
+ " t_dictionary_item i\n"
+ "where d.id = i.dictionary_id\n"
+ " and d.code = 'coalBlend.coalType'\n"
+ " and i.code = coal_type)")
private String coalTypeName;
@Comment("结果个数")
private Integer count = 20;

View File

@@ -11,6 +11,7 @@ import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
import java.util.List;
@@ -32,6 +33,18 @@ public class UpdateCoalBlendDto extends OrgCommonDto {
private String blendTypeName;
private String blendType;
@Comment("煤类型")
private String coalType;
@Formula(
"(select i.name\n"
+ "from t_dictionary d,\n"
+ " t_dictionary_item i\n"
+ "where d.id = i.dictionary_id\n"
+ " and d.code = 'coalBlend.coalType'\n"
+ " and i.code = coal_type)")
private String coalTypeName;
@Comment("结果个数")
private Integer count = 20;