Java Code Examples for com.baomidou.mybatisplus.core.conditions.query.QueryWrapper#ge()
The following examples show how to use
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper#ge() .
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: ApiLoggerServiceImpl.java From sophia_scaffolding with Apache License 2.0 | 6 votes |
@Override public IPage<ApiLoggerVo> queryApiLoggerList(ApiLoggerSearchDto param) { Integer currentPage = param.getCurrentPage() == null ? 1 : param.getCurrentPage(); Integer pageSize = param.getPageSize() == null ? 10 : param.getPageSize(); Page<ApiLoggerVo> result = new Page<>(currentPage, pageSize); Page<ApiLogger> page = new Page<>(currentPage, pageSize); QueryWrapper<ApiLogger> queryWrapper = new QueryWrapper<>(); queryWrapper.like(StringUtils.isNotBlank(param.getUserName()), "USER_NAME", param.getUserName()); queryWrapper.like(StringUtils.isNotBlank(param.getMethod()), "METHOD", param.getMethod()); queryWrapper.like(StringUtils.isNotBlank(param.getMethodName()), "METHOD_NAME", param.getMethodName()); queryWrapper.ge(null != param.getStartTime(), "CREATE_TIME", param.getStartTime()); queryWrapper.le(null != param.getEndTime(), "CREATE_TIME", param.getEndTime()); queryWrapper.orderByDesc("CREATE_TIME"); IPage<ApiLogger> iPage = baseMapper.selectPage(page, queryWrapper); BeanUtils.copyProperties(iPage, result); return result.setRecords(new ApiLoggerVo().buildVoList(iPage.getRecords())); }
Example 2
Source File: ApiLoggerServiceImpl.java From sophia_scaffolding with Apache License 2.0 | 6 votes |
@Override public IPage<ApiLoggerVo> queryApiLoggerList(ApiLoggerSearchDto param) { Integer currentPage = param.getCurrentPage() == null ? 1 : param.getCurrentPage(); Integer pageSize = param.getPageSize() == null ? 10 : param.getPageSize(); Page<ApiLoggerVo> result = new Page<>(currentPage, pageSize); Page<ApiLogger> page = new Page<>(currentPage, pageSize); QueryWrapper<ApiLogger> queryWrapper = new QueryWrapper<>(); queryWrapper.like(StringUtils.isNotBlank(param.getUserName()), "USER_NAME", param.getUserName()); queryWrapper.like(StringUtils.isNotBlank(param.getMethod()), "METHOD", param.getMethod()); queryWrapper.like(StringUtils.isNotBlank(param.getMethodName()), "METHOD_NAME", param.getMethodName()); queryWrapper.ge(null != param.getStartTime(), "CREATE_TIME", param.getStartTime()); queryWrapper.le(null != param.getEndTime(), "CREATE_TIME", param.getEndTime()); queryWrapper.orderByDesc("CREATE_TIME"); IPage<ApiLogger> iPage = baseMapper.selectPage(page, queryWrapper); BeanUtils.copyProperties(iPage, result); return result.setRecords(new ApiLoggerVo().buildVoList(iPage.getRecords())); }
Example 3
Source File: ObjectParseUtil.java From jeecg-cloud with Apache License 2.0 | 5 votes |
/** * * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ public static void addCriteria(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null) { return; } switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: queryWrapper.in(name, (Object[]) value); break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: break; } }
Example 4
Source File: ObjectParseUtil.java From jeecg-boot-with-activiti with MIT License | 5 votes |
/** * * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ public static void addCriteria(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null) { return; } switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: queryWrapper.in(name, (Object[]) value); break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: break; } }
Example 5
Source File: ObjectParseUtil.java From teaching with Apache License 2.0 | 5 votes |
/** * * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ public static void addCriteria(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null) { return; } switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: queryWrapper.in(name, (Object[]) value); break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: break; } }
Example 6
Source File: ObjectParseUtil.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ public static void addCriteria(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null) { return; } switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: queryWrapper.in(name, (Object[]) value); break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: break; } }
Example 7
Source File: QueryGenerator.java From jeecg-cloud with Apache License 2.0 | 4 votes |
/** * 根据规则走不同的查询 * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ private static void addEasyQuery(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null || oConvertUtils.isEmpty(value)) { return; } name = oConvertUtils.camelToUnderline(name); log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value); switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: if(value instanceof String) { queryWrapper.in(name, (Object[])value.toString().split(",")); }else if(value instanceof String[]) { queryWrapper.in(name, (Object[]) value); }else { queryWrapper.in(name, value); } break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: log.info("--查询规则未匹配到---"); break; } }
Example 8
Source File: QueryGenerator.java From jeecg-boot-with-activiti with MIT License | 4 votes |
/** * 根据规则走不同的查询 * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ private static void addEasyQuery(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null) { return; } name = oConvertUtils.camelToUnderline(name); log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value); switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: if(value instanceof String) { queryWrapper.in(name, (Object[])value.toString().split(",")); }else if(value instanceof String[]) { queryWrapper.in(name, (Object[]) value); }else { queryWrapper.in(name, value); } break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: log.info("--查询规则未匹配到---"); break; } }
Example 9
Source File: QueryGenerator.java From teaching with Apache License 2.0 | 4 votes |
/** * 根据规则走不同的查询 * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ private static void addEasyQuery(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null || oConvertUtils.isEmpty(value)) { return; } name = oConvertUtils.camelToUnderline(name); log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value); switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: if(value instanceof String) { queryWrapper.in(name, (Object[])value.toString().split(",")); }else if(value instanceof String[]) { queryWrapper.in(name, (Object[]) value); }else { queryWrapper.in(name, value); } break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: log.info("--查询规则未匹配到---"); break; } }
Example 10
Source File: QueryGenerator.java From jeecg-boot with Apache License 2.0 | 4 votes |
/** * 根据规则走不同的查询 * @param queryWrapper QueryWrapper * @param name 字段名字 * @param rule 查询规则 * @param value 查询条件值 */ private static void addEasyQuery(QueryWrapper<?> queryWrapper, String name, QueryRuleEnum rule, Object value) { if (value == null || rule == null || oConvertUtils.isEmpty(value)) { return; } name = oConvertUtils.camelToUnderline(name); log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value); switch (rule) { case GT: queryWrapper.gt(name, value); break; case GE: queryWrapper.ge(name, value); break; case LT: queryWrapper.lt(name, value); break; case LE: queryWrapper.le(name, value); break; case EQ: queryWrapper.eq(name, value); break; case NE: queryWrapper.ne(name, value); break; case IN: if(value instanceof String) { queryWrapper.in(name, (Object[])value.toString().split(",")); }else if(value instanceof String[]) { queryWrapper.in(name, (Object[]) value); }else { queryWrapper.in(name, value); } break; case LIKE: queryWrapper.like(name, value); break; case LEFT_LIKE: queryWrapper.likeLeft(name, value); break; case RIGHT_LIKE: queryWrapper.likeRight(name, value); break; default: log.info("--查询规则未匹配到---"); break; } }