Untitled

mail@pastecode.io avatar
unknown
plain_text
11 days ago
2.5 kB
3
Indexable
Never
    private Map<Integer, FeatureRuleConfigProjection> query(ParameterDTO parameter) {
        String regionCode = replaceNullToEmpty(countryRegionServiceBase.getRegionCodeByCountryCode(
                parameter.getCountryCode()));
        return from(featureRuleConfig)
                .where(buildWhereExpression(parameter, regionCode))
                .orderBy(
                        featureRuleConfig.rule.platformType.desc(),
                        featureRuleConfig.rule.deviceType.desc(),
                        featureRuleConfig.rule.platformVersion.desc(),
                        featureRuleConfig.rule.androidVersionFrom.desc(),
                        featureRuleConfig.rule.androidVersionTo.desc(),
                        featureRuleConfig.rule.deviceManufacturer.desc(),
                        featureRuleConfig.rule.internetRelease.desc(),
                        featureRuleConfig.rule.internetVersionMajor.desc(),
                        featureRuleConfig.rule.internetVersionMinor.desc(),
                        featureRuleConfig.rule.internetVersionPatch.desc(),
                        featureRuleConfig.rule.flavorResolution.desc(),
                        featureRuleConfig.rule.deviceModel.desc(),
                        featureRuleConfig.rule.operatorCode.desc(),
                        featureRuleConfig.rule.countryCode.desc(),
                        featureRuleConfig.rule.regionCode.desc(),
                        featureRuleConfig.rule.clientType.desc(),
                        featureRuleConfig.rule.experimentId.desc()
                )
                .leftJoin(featureRuleConfig.fields, featureRuleConfigField)
                .leftJoin(featureRuleConfig.feature, feature)
                .transform(groupBy(featureRuleConfig.id).as(new QFeatureRuleConfigProjection(
                        featureRuleConfig.exclude,
                        featureRuleConfig.support,
                        featureRuleConfig.version,
                        featureRuleConfig.id,
                        featureRuleConfig.featureId,
                        featureRuleConfig.feature.key,
                        featureRuleConfig.rule.experimentId,
                        list(new QFeatureRuleConfigFieldProjection(featureRuleConfigField.encrypted,
                                featureRuleConfigField.key, featureRuleConfigField.valueType,
                                featureRuleConfigField.type, featureRuleConfigField.value)))));
    }
Leave a Comment