Browse Source

Merge branch 'dev'

= 8 năm trước cách đây
mục cha
commit
38858f7cae

+ 29 - 0
mybatis-plus/src/main/java/com/baomidou/mybatisplus/mapper/EntityWrapper.java

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.toolkit.StringUtils;
 
 import java.io.Serializable;
 import java.text.MessageFormat;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -402,6 +403,34 @@ public class EntityWrapper<T> implements Serializable {
 		return this;
 	}
 
+	/**
+	 * IN 条件语句,目前适配mysql及oracle
+	 *
+	 * @param column
+	 *            字段名称
+	 * @param value
+	 *            匹配值 object数组
+	 * @return this
+	 */
+	public EntityWrapper<T> in(String column, Object... value) {
+		sql.IN(column, Arrays.asList(value));
+		return this;
+	}
+
+	/**
+	 * NOT IN 条件语句,目前适配mysql及oracle
+	 *
+	 * @param column
+	 *            字段名称
+	 * @param value
+	 *            匹配值 object数组
+	 * @return this
+	 */
+	public EntityWrapper<T> notIn(String column, Object... value) {
+		sql.NOT_IN(column, Arrays.asList(value));
+		return this;
+	}
+
 	/**
 	 * betwwee 条件语句
 	 *