Java Code Examples for com.querydsl.core.types.dsl.BooleanExpression#andAnyOf()

The following examples show how to use com.querydsl.core.types.dsl.BooleanExpression#andAnyOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RewardPromotionController.java    From ZTuoExchange_framework with MIT License 6 votes vote down vote up
/**
 * 查询所有未被禁用的(判断type条件)
 * 默认按照updatetime降序
 *
 * @param enable
 * @param type
 * @return
 */
@RequiresPermissions("promotion:reward:page-query")
@GetMapping("page-query")
@AccessLog(module = AdminModule.SYSTEM, operation = "分页查询邀请奖励设置")
public MessageResult pageQuery(
        PageModel pageModel,
        @RequestParam(value = "status", defaultValue = "1") BooleanEnum enable,
        @RequestParam(value = "type", required = false) PromotionRewardType type) {
    BooleanExpression predicate = null;
    if (type != null) {
        predicate.andAnyOf(QRewardPromotionSetting.rewardPromotionSetting.type.eq(type));
    }
    Page<RewardPromotionSetting> all = rewardPromotionSettingService.findAll(predicate, pageModel);
    for(RewardPromotionSetting setting : all){
        if(StringUtils.isEmpty(setting.getInfo())) {
            continue ;
        }
        JSONObject jsonObject = JSONObject.parseObject(setting.getInfo());
        setting.setOne(jsonObject.getBigDecimal("one"));
        setting.setTwo(jsonObject.getBigDecimal("two"));
    }
    return success(all);
}
 
Example 2
Source File: RewardPromotionController.java    From ZTuoExchange_framework with MIT License 6 votes vote down vote up
/**
 * 查询所有未被禁用的(判断type条件)
 * 默认按照updatetime降序
 *
 * @param enable
 * @param type
 * @return
 */
@RequiresPermissions("promotion:reward:page-query")
@GetMapping("page-query")
@AccessLog(module = AdminModule.SYSTEM, operation = "分页查询邀请奖励设置")
public MessageResult pageQuery(
        PageModel pageModel,
        @RequestParam(value = "status", defaultValue = "1") BooleanEnum enable,
        @RequestParam(value = "type", required = false) PromotionRewardType type) {
    BooleanExpression predicate = null;
    if (type != null) {
        predicate.andAnyOf(QRewardPromotionSetting.rewardPromotionSetting.type.eq(type));
    }
    Page<RewardPromotionSetting> all = rewardPromotionSettingService.findAll(predicate, pageModel);
    for(RewardPromotionSetting setting : all){
        if(StringUtils.isEmpty(setting.getInfo())) {
            continue ;
        }
        JSONObject jsonObject = JSONObject.parseObject(setting.getInfo());
        setting.setOne(jsonObject.getBigDecimal("one"));
        setting.setTwo(jsonObject.getBigDecimal("two"));
    }
    return success(all);
}