Browse Source

入库参数

lmstack 3 years ago
parent
commit
6be543cba9

+ 5 - 0
src/main/java/cn/fastfun/controller/api/ApiAppDeviceLogController.java

@@ -141,6 +141,11 @@ public class ApiAppDeviceLogController {
             sql.append(" AND sn like '%" + param.getSn() + "%'");
         }
 
+        if (!StringUtils.isEmpty(param.getOrderBy())) {
+            sql.append(" AND order by " + param.getOrderBy());
+        }
+
+
         log.info("SQL: {}", sql.toString());
 
         ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);

+ 12 - 0
src/main/java/cn/fastfun/controller/param/DeviceBatchQueryParam.java

@@ -19,6 +19,18 @@ public class DeviceBatchQueryParam extends QueryParam {
     @ApiModelProperty(value = "批次号", name = "batchNum", required = true)
     private String batchNum;
 
+    @ApiModelProperty(value = "sn", name = "sn", required = true)
+    public void setSn(String sn) {
+        if (!StringUtils.isEmpty(sn))
+            addParam(QueryParamExp.like("sn", "%".concat(sn).concat("%")));
+    }
+
+    @ApiModelProperty(value = "status", name = "status", required = true)
+    public void setStatus(Integer status) {
+        if (!StringUtils.isEmpty(status))
+            addParam(QueryParamExp.eq("status", status));
+    }
+
     @ApiModelProperty(value = "录入时间起始", name = "recordTimeStart", required = true)
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

+ 4 - 0
src/main/java/cn/fastfun/controller/param/LibraryInQueryParam.java

@@ -22,6 +22,10 @@ public class LibraryInQueryParam extends QueryParam{
     @ApiModelProperty(value = "设备编号", name = "sn", required = false)
     private String sn;
 
+
+    @ApiModelProperty(value = "排序", name = "orderBy", required = false)
+    private String orderBy;
+
     @ApiModelProperty(value = "自检状态", name = "checkStatus", example = "0, 0:未通过 ; 1:已通过;  空:全部")
     private Integer checkStatus;