Java Code Examples for com.baomidou.mybatisplus.core.conditions.query.QueryWrapper#likeRight()

The following examples show how to use com.baomidou.mybatisplus.core.conditions.query.QueryWrapper#likeRight() . 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: ObjectParseUtil.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @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 2
Source File: ObjectParseUtil.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
 * 
 * @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 3
Source File: ObjectParseUtil.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @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 Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @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: QueryGenerator.java    From jeecg-cloud with Apache License 2.0 4 votes vote down vote up
/**
  * 根据规则走不同的查询
 * @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 6
Source File: QueryGenerator.java    From jeecg-boot-with-activiti with MIT License 4 votes vote down vote up
/**
  * 根据规则走不同的查询
 * @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 7
Source File: QueryGenerator.java    From teaching with Apache License 2.0 4 votes vote down vote up
/**
  * 根据规则走不同的查询
 * @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 Apache License 2.0 4 votes vote down vote up
/**
  * 根据规则走不同的查询
 * @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;
	}
}