#
luxiaotao1123
2024-02-14 34cbd8375f3048a88a1f83c042632b5b19d13270
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/common/domain/PageParam.java
@@ -5,7 +5,9 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.domain.QueryField;
import com.zy.asrs.framework.domain.QueryType;
import com.zy.asrs.wcs.utils.Utils;
import java.lang.reflect.Field;
import java.util.Arrays;
@@ -21,17 +23,26 @@
    private final U where;
    /**
     * 是否把字段名称驼峰转下划线
     */
    private final boolean isToUnderlineCase;
    public PageParam() {
        this(null);
    }
    public PageParam(U where) {
        this(where, true);
    }
    public PageParam(U where, boolean isToUnderlineCase) {
        super();
        this.where = where;
        this.isToUnderlineCase = isToUnderlineCase;
        if (where != null) {
            if (where.getPageIdx() != null) {
                setCurrent(where.getPageIdx());
            if (where.getCurrent() != null) {
                setCurrent(where.getCurrent());
            }
            if (where.getPageSize() != null) {
                setSize(where.getPageSize());
@@ -39,9 +50,20 @@
        }
    }
    /**
     * @param excludes 不包含的字段
     */
    public QueryWrapper<T> getWrapper(String... excludes) {
        return buildWrapper(null, Arrays.asList(excludes));
    }
    /**
     * @param columns 只包含的字段
     */
    public QueryWrapper<T> getWrapperWith(String... columns) {
        return buildWrapper(Arrays.asList(columns), null);
    }
    private QueryWrapper<T> buildWrapper(List<String> columns, List<String> excludes) {
        QueryWrapper<T> queryWrapper = new QueryWrapper<>();
@@ -77,9 +99,8 @@
                if (!Cools.isEmpty(queryField.value())) {
                    fieldName = queryField.value();
                }
                if (queryField.type() != null) {
                    queryType = queryField.type();
                }
                queryField.type();
                queryType = queryField.type();
            } else {
                // 过滤非本表的字段
                TableField tableField = field.getAnnotation(TableField.class);