Forráskód Böngészése

字段校验规则维护查询接口修改

zhanghang 3 éve
szülő
commit
48a8f88a42

+ 2 - 2
daqe-center/src/main/java/com/lantone/daqe/dto/GetColumnVerifyPageDTO.java

@@ -34,8 +34,8 @@ public class GetColumnVerifyPageDTO implements Serializable {
     @ApiModelProperty(value = "字段名称(英文)")
     private String columnEname;
 
-    @ApiModelProperty(value = "是否必填")
-    private String nonnull;
+    @ApiModelProperty(value = "是否必填,0:否,1:是")
+    private String isRequired;
 
     @ApiModelProperty(value = "标准值")
     private String standardvalue;

+ 11 - 0
daqe-center/src/main/java/com/lantone/daqe/vo/AddColumnVerifyVO.java

@@ -1,10 +1,14 @@
 package com.lantone.daqe.vo;
 
+import com.lantone.daqe.entity.ColumnInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * @Description: 新增字段校验规则-接口入参
@@ -18,4 +22,11 @@ public class AddColumnVerifyVO implements Serializable {
     private static final long serialVersionUID = -7833991160014144645L;
 
 
+    @ApiModelProperty(value = "表字段信息", required = true )
+    @NotNull(message = "表信息不能为空")
+    List<ColumnInfo> columnList;
+
+    @ApiModelProperty(value = "是否必填,0:否,1:是")
+    String isRequired;
+
 }

+ 2 - 2
daqe-center/src/main/java/com/lantone/daqe/vo/GetColumnVerifyPageVO.java

@@ -32,8 +32,8 @@ public class GetColumnVerifyPageVO extends Page {
     @ApiModelProperty(value = "字段名称(英文)")
     private String columnEname;
 
-    @ApiModelProperty(value = "是否必填")
-    private String nonnull;
+    @ApiModelProperty(value = "是否必填,0:否,1:是")
+    private String isRequired;
 
     @ApiModelProperty(value = "标准值")
     private String standardValue;

+ 8 - 5
daqe-center/src/main/resources/mapper/ColumnVerifyMapper.xml

@@ -3,13 +3,14 @@
 <mapper namespace="com.lantone.daqe.mapper.ColumnVerifyMapper">
 
     <select id="getColumnVerifyPage" resultType="com.lantone.daqe.dto.GetColumnVerifyPageDTO">
+        SELECT * from(
         SELECT
         a.column_id,
         a.table_cname,
         a.table_ename,
         a.column_cname,
         a.column_ename,
-        GROUP_CONCAT(a.nonnull SEPARATOR ';') nonnull,
+        GROUP_CONCAT(a.isRequired SEPARATOR ';') isRequired,
         GROUP_CONCAT(a.standardvalue SEPARATOR ';') standardvalue,
         GROUP_CONCAT(a.regular SEPARATOR ';') regular,
         a.description
@@ -23,7 +24,7 @@
         dcv.column_ename,
         dcv.type,
         dcv.description,
-        CASE dcv.type WHEN 1 THEN dcv.verify_val ELSE NULL END nonnull,
+        CASE dcv.type WHEN 1 THEN dcv.verify_val ELSE NULL END isRequired,
         CASE dcv.type WHEN 2 THEN dcv.verify_val ELSE NULL END standardvalue,
         CASE dcv.type WHEN 3 THEN dcv.verify_val ELSE NULL END regular
         FROM
@@ -43,9 +44,13 @@
             AND dcv.column_ename= #{getColumnVerifyPageVO.columnEname}
         </if>
         ) a
+
+        GROUP BY
+        a.column_id
+        )a
         where
         1=1
-        <if test="getColumnVerifyPageVO.nonnull != null and getColumnVerifyPageVO.nonnull != ''">
+        <if test="getColumnVerifyPageVO.isRequired != null and getColumnVerifyPageVO.isRequired != ''">
             AND a.column_ename = #{getColumnVerifyPageVO.columnEname}
         </if>
         <if test="getColumnVerifyPageVO.regularName != null and getColumnVerifyPageVO.regularName != ''">
@@ -54,8 +59,6 @@
         <if test="getColumnVerifyPageVO.standardValue != null and getColumnVerifyPageVO.standardValue != ''">
             AND a.standardvalue LIKE CONCAT('%',#{getColumnVerifyPageVO.regularName},'%')
         </if>
-        GROUP BY
-        a.column_id
     </select>
 
 </mapper>