| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- package com.persagy.apm.dmpalarm.criteria;
- import java.util.ArrayList;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Set;
- import com.alibaba.fastjson.JSONObject;
- import lombok.Data;
- import lombok.Getter;
- import lombok.Setter;
- /**
- * @author: yaoll
- * @date: 2020-09-04
- * @verison: 1.0
- *
- * <pre>
- * {
- * "page": 1,
- * "size": 10,
- * "onlyCount": false,
- * "criteria": {
- * "name": "zhangsan",
- * "name": [ "zhangsan", "lisi" ],
- * "age": {
- * "$gt": 18,
- * "$lt": 35
- * },
- * "gender": {
- * "$null": false
- * }
- * },
- * "orders": [
- * {
- * "column": "name",
- * "asc": false
- * }
- * ],
- * "withColumns": [
- * "name", "age"
- * ],
- * "groupByColumns": [
- * "name", "age"
- * ]
- * }
- * </pre>
- */
- public class JsonCriteria {
- @Getter
- @Setter
- private Integer page =1;
- @Getter
- @Setter
- private Integer size=500;
- /**
- * 是否只统计数量
- */
- @Getter
- @Setter
- private boolean onlyCount = false;
- @Getter
- @Setter
- private boolean withoutCount = false;
- @Getter
- @Setter
- private JSONObject criteria = new JSONObject();
- @Getter
- @Setter
- private List<Order> orders = new ArrayList<>();
- @Getter
- @Setter
- private Set<String> withColumns = new HashSet<>();
- @Getter
- @Setter
- private Set<String> groupByColumns = new HashSet<>();
- @Data
- public static class Order {
- private String column;
- private boolean asc = true;
- public Order() {
- }
- public Order(String column) {
- this.column = column;
- }
- public Order(String column, boolean asc) {
- this.column = column;
- this.asc = asc;
- }
- }
- }
|