| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Assert; |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import java.io.Serializable; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.text.MessageFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.Collection; |
| | |
| | | |
| | | |
| | | public class ExtraLambdaQueryWrapper<T> extends AbstractLambdaWrapper<T, ExtraLambdaQueryWrapper<T>> implements Query<ExtraLambdaQueryWrapper<T>, T, SFunction<T, ?>> { |
| | | public static final DbType MASTER_DB_TYPE; |
| | | private SharedString sqlSelect; |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 7355848306213787157L; |
| | | |
| | | public static final DbType MASTER_DB_TYPE; |
| | | private SharedString sqlSelect = new SharedString(); |
| | | private static final String ORACLE_NUM = "ROWNUM <= {}"; |
| | | private static final String MYSQL_NUM = "limit {}"; |
| | | private DbType dbType; |
| | |
| | | setEntity(entity); |
| | | initNeed(); |
| | | } |
| | | |
| | | |
| | | private ExtraLambdaQueryWrapper(Class<T> entityClass) { |
| | | //this.sqlSelect = new SharedString(); |
| | | |
| | | super.setEntityClass(entityClass); |
| | | super.initNeed(); |
| | | } |
| | |
| | | case ORACLE: |
| | | wrapper.and(q->{q.last(StrUtil.format("ROWNUM <= {}", new Object[]{num}));}); |
| | | return; |
| | | default: |
| | | wrapper.last(StrUtil.format("limit {}", new Object[] { num })); |
| | | return; |
| | | default: |
| | | wrapper.last(StrUtil.format("limit {}", new Object[] { num })); |
| | | return; |
| | | } |
| | | |
| | | }); |
| | |
| | | } |
| | | |
| | | public ExtraLambdaQueryWrapper<T> orderBy(boolean condition, SFunction<T, ?> column, boolean isAsc, Collection<?> values) { |
| | | |
| | | String param = columnsToString(new SFunction[] { column }); |
| | | String param = columnsToString(column ); |
| | | //String param = columnsToString(new SFunction[] { column }); |
| | | String sqlData = String.format(values |
| | | .stream().map(it -> (it instanceof String) ? "'%s'" : "%s").collect(Collectors.joining(",")), values |
| | | .toArray()); |
| | |
| | | */ |
| | | } |
| | | |
| | | /* JADX INFO: Access modifiers changed from: package-private */ |
| | | /* renamed from: org.springblade.common.utils.ExtraLambdaQueryWrapper$1 reason: invalid class name */ |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/ExtraLambdaQueryWrapper$1.class */ |
| | | public static /* synthetic */ class AnonymousClass1 { |
| | | static final /* synthetic */ int[] $SwitchMap$com$baomidou$mybatisplus$annotation$DbType = new int[DbType.values().length]; |
| | | |
| | | static { |
| | | try { |
| | | $SwitchMap$com$baomidou$mybatisplus$annotation$DbType[DbType.ORACLE.ordinal()] = 1; |
| | | } catch (NoSuchFieldError e) { |
| | | } |
| | | try { |
| | | $SwitchMap$com$baomidou$mybatisplus$annotation$DbType[DbType.DM.ordinal()] = 2; |
| | | } catch (NoSuchFieldError e2) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private String left(SFunction<T, ?> column, int len) { |
| | | String param = columnsToString(new SFunction[] { column }); |