Sfoglia il codice sorgente

:memo: 调整部分 javadoc 的格式

Cat73 6 anni fa
parent
commit
9b990ff0ef

+ 7 - 37
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/interfaces/Compare.java

@@ -20,10 +20,8 @@ import java.util.Map;
 import java.util.function.BiPredicate;
 
 /**
- * <p>
  * 查询条件封装
- * 比较值
- * </p>
+ * <p>比较值</p>
  *
  * @author hubin miemie HCL
  * @since 2017-05-26
@@ -45,9 +43,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * map 所有非空属性等于 =
-     * </p>
      *
      * @param condition   执行条件
      * @param params      map 类型的参数, key 是字段名, value 是字段值
@@ -71,9 +67,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
-     * 字段过滤接口,传入多参数时允许对参数进行过滤<br/>
-     * </p>
+     * 字段过滤接口,传入多参数时允许对参数进行过滤
      *
      * @param condition   执行条件
      * @param filter      返回 true 来允许字段传入比对条件中
@@ -91,9 +85,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * 等于 =
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -110,9 +102,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
-     * 不等于 <>
-     * </p>
+     * 不等于 &lt;&gt;
      *
      * @param condition 执行条件
      * @param column    字段
@@ -129,9 +119,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
-     * 大于 >
-     * </p>
+     * 大于 &gt;
      *
      * @param condition 执行条件
      * @param column    字段
@@ -148,9 +136,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
-     * 大于等于 >=
-     * </p>
+     * 大于等于 &gt;=
      *
      * @param condition 执行条件
      * @param column    字段
@@ -167,9 +153,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
-     * 小于 <
-     * </p>
+     * 小于 &lt;
      *
      * @param condition 执行条件
      * @param column    字段
@@ -186,9 +170,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
-     * 小于等于 <=
-     * </p>
+     * 小于等于 &lt;=
      *
      * @param condition 执行条件
      * @param column    字段
@@ -205,9 +187,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * BETWEEN 值1 AND 值2
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -225,9 +205,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * NOT BETWEEN 值1 AND 值2
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -245,9 +223,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * LIKE '%值%'
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -264,9 +240,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * NOT LIKE '%值%'
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -283,9 +257,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * LIKE '%值'
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -302,9 +274,7 @@ public interface Compare<Children, R> extends Serializable {
     }
 
     /**
-     * <p>
      * LIKE '值%'
-     * </p>
      *
      * @param condition 执行条件
      * @param column    字段

+ 23 - 26
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/interfaces/Func.java

@@ -25,10 +25,7 @@ import java.util.Optional;
 import static java.util.stream.Collectors.toList;
 
 /**
- * <p>
  * 查询条件封装
- * 比较值
- * </p>
  *
  * @author hubin miemie HCL
  * @since 2017-05-26
@@ -45,7 +42,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IS NULL
-     * 例: isNull("name")
+     * <p>例: isNull("name")</p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -62,7 +59,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IS NOT NULL
-     * 例: isNotNull("name")
+     * <p>例: isNotNull("name")</p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -86,7 +83,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN (value.get(0), value.get(1), ...)
-     * 例: in("id", Arrays.asList(1,2,3,4,5))
+     * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
      *
      * <li> 如果集合为 empty 则直接抛出异常 </li>
      *
@@ -102,7 +99,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN (value.get(0), value.get(1), ...)
-     * 例: in("id", Arrays.asList(1,2,3,4,5))
+     * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
      *
      * <li> 如果集合为 empty 则不会进行 sql 拼接 </li>
      *
@@ -122,7 +119,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN (value.get(0), value.get(1), ...)
-     * 例: in("id", Arrays.asList(1,2,3,4,5))
+     * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
      *
      * <li> 如果数组为 empty 则直接抛出异常 </li>
      *
@@ -145,7 +142,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN (v0, v1, ...)
-     * 例: in("id", 1, 2, 3, 4, 5)
+     * <p>例: in("id", 1, 2, 3, 4, 5)</p>
      *
      * <li> 如果动态数组为 empty 则不会进行 sql 拼接 </li>
      *
@@ -175,7 +172,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN (value.get(0), value.get(1), ...)
-     * 例: in("id", Arrays.asList(1,2,3,4,5))
+     * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
      *
      * <li> 如果集合为 empty 则直接抛出异常 </li>
      *
@@ -191,7 +188,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 NOT IN (value.get(0), value.get(1), ...)
-     * 例: notIn("id", Arrays.asList(1,2,3,4,5))
+     * <p>例: notIn("id", Arrays.asList(1, 2, 3, 4, 5))</p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -216,7 +213,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN (value.get(0), value.get(1), ...)
-     * 例: in("id", Arrays.asList(1,2,3,4,5))
+     * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
      *
      * <li> 如果数组为 empty 则直接抛出异常 </li>
      *
@@ -232,7 +229,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 NOT IN (v0, v1, ...)
-     * 例: notIn("id", 1, 2, 3, 4, 5)
+     * <p>例: notIn("id", 1, 2, 3, 4, 5)</p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -253,9 +250,9 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 IN ( sql语句 )
-     * !! sql 注入方式的 in 方法 !!
-     * 例1: inSql("id", "1,2,3,4,5,6")
-     * 例2: inSql("id", "select id from table where id < 3")
+     * <p>!! sql 注入方式的 in 方法 !!</p>
+     * <p>例1: inSql("id", "1, 2, 3, 4, 5, 6")</p>
+     * <p>例2: inSql("id", "select id from table where id &lt; 3")</p>
      *
      * @param condition 执行条件
      * @param column    字段
@@ -273,13 +270,13 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 字段 NOT IN ( sql语句 )
-     * !! sql 注入方式的 not in 方法 !!
-     * 例1: notInSql("id", "1,2,3,4,5,6")
-     * 例2: notInSql("id", "select id from table where id < 3")
+     * <p>!! sql 注入方式的 not in 方法 !!</p>
+     * <p>例1: notInSql("id", "1, 2, 3, 4, 5, 6")</p>
+     * <p>例2: notInSql("id", "select id from table where id &lt; 3")</p>
      *
      * @param condition 执行条件
      * @param column    字段
-     * @param inValue   sql语句 ---> 1,2,3,4,5,6 或者 select id from table where id < 3
+     * @param inValue   sql语句 ---&gt; 1,2,3,4,5,6 或者 select id from table where id &lt; 3
      * @return children
      */
     Children notInSql(boolean condition, R column, String inValue);
@@ -293,7 +290,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 分组:GROUP BY 字段, ...
-     * 例: groupBy("id", "name")
+     * <p>例: groupBy("id", "name")</p>
      *
      * @param condition 执行条件
      * @param columns   字段数组
@@ -310,7 +307,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 排序:ORDER BY 字段, ... ASC
-     * 例: orderByAsc("id", "name")
+     * <p>例: orderByAsc("id", "name")</p>
      *
      * @param condition 执行条件
      * @param columns   字段数组
@@ -329,7 +326,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 排序:ORDER BY 字段, ... DESC
-     * 例: orderByDesc("id", "name")
+     * <p>例: orderByDesc("id", "name")</p>
      *
      * @param condition 执行条件
      * @param columns   字段数组
@@ -341,7 +338,7 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * 排序:ORDER BY 字段, ...
-     * 例: orderBy(true, "id", "name")
+     * <p>例: orderBy(true, "id", "name")</p>
      *
      * @param condition 执行条件
      * @param isAsc     是否是 ASC 排序
@@ -359,8 +356,8 @@ public interface Func<Children, R> extends Serializable {
 
     /**
      * HAVING ( sql语句 )
-     * 例1: having("sum(age) > 10")
-     * 例2: having("sum(age) > {0}", 10)
+     * <p>例1: having("sum(age) &gt; 10")</p>
+     * <p>例2: having("sum(age) &gt; {0}", 10)</p>
      *
      * @param condition 执行条件
      * @param sqlHaving sql 语句

+ 11 - 13
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/interfaces/Join.java

@@ -18,10 +18,8 @@ package com.baomidou.mybatisplus.core.conditions.interfaces;
 import java.io.Serializable;
 
 /**
- * <p>
  * 查询条件封装
- * 拼接
- * </p>
+ * <p>拼接</p>
  *
  * @author hubin miemie HCL
  * @since 2017-05-26
@@ -51,11 +49,11 @@ public interface Join<Children> extends Serializable {
     }
 
     /**
-     * !! 会有 sql 注入风险 !!
      * 拼接 sql
-     * 例1: apply("id = 1")
-     * 例2: apply("date_format(dateColumn,'%Y-%m-%d') = '2008-08-08'")
-     * 例3: apply("date_format(dateColumn,'%Y-%m-%d') = {0}", LocalDate.now())
+     * <p>!! 会有 sql 注入风险 !!</p>
+     * <p>例1: apply("id = 1")</p>
+     * <p>例2: apply("date_format(dateColumn,'%Y-%m-%d') = '2008-08-08'")</p>
+     * <p>例3: apply("date_format(dateColumn,'%Y-%m-%d') = {0}", LocalDate.now())</p>
      *
      * @param condition 执行条件
      * @return children
@@ -71,8 +69,8 @@ public interface Join<Children> extends Serializable {
 
     /**
      * 无视优化规则直接拼接到 sql 的最后(有sql注入的风险,请谨慎使用)
-     * 例: last("limit 1")
-     * 注意只能调用一次,多次调用以最后一次为准
+     * <p>例: last("limit 1")</p>
+     * <p>注意只能调用一次,多次调用以最后一次为准</p>
      *
      * @param condition 执行条件
      * @param lastSql   sql语句
@@ -88,9 +86,9 @@ public interface Join<Children> extends Serializable {
     }
 
     /**
-     * !! sql 注入方法 !!
      * 拼接 EXISTS ( sql语句 )
-     * 例: exists("select id from table where age = 1")
+     * <p>!! sql 注入方法 !!</p>
+     * <p>例: exists("select id from table where age = 1")</p>
      *
      * @param condition 执行条件
      * @param existsSql sql语句
@@ -106,9 +104,9 @@ public interface Join<Children> extends Serializable {
     }
 
     /**
-     * !! sql 注入方法 !!
      * 拼接 NOT EXISTS ( sql语句 )
-     * 例: notExists("select id from table where age = 1")
+     * <p>!! sql 注入方法 !!</p>
+     * <p>例: notExists("select id from table where age = 1")</p>
      *
      * @param condition    执行条件
      * @param notExistsSql sql语句

+ 7 - 9
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/interfaces/Nested.java

@@ -19,10 +19,8 @@ import java.io.Serializable;
 import java.util.function.Function;
 
 /**
- * <p>
  * 查询条件封装
- * 嵌套
- * </p>
+ * <p>嵌套</p>
  *
  * @author hubin miemie HCL
  * @since 2017-05-26
@@ -37,9 +35,9 @@ public interface Nested<Param, Children> extends Serializable {
     }
 
     /**
+     * AND 嵌套
      * <p>
-     * AND 嵌套<br/>
-     * 例: and(i -> i.eq("name", "李白").ne("status", "活着"))<br/>
+     * 例: and(i -&gt; i.eq("name", "李白").ne("status", "活着"))
      * </p>
      *
      * @param condition 执行条件
@@ -56,9 +54,9 @@ public interface Nested<Param, Children> extends Serializable {
     }
 
     /**
+     * OR 嵌套
      * <p>
-     * OR 嵌套<br/>
-     * 例: or(i -> i.eq("name", "李白").ne("status", "活着"))<br/>
+     * 例: or(i -&gt; i.eq("name", "李白").ne("status", "活着"))
      * </p>
      *
      * @param condition 执行条件
@@ -75,9 +73,9 @@ public interface Nested<Param, Children> extends Serializable {
     }
 
     /**
+     * 正常嵌套 不带 AND 或者 OR
      * <p>
-     * 正常嵌套 不带 AND 或者 OR<br/>
-     * 例: nested(i -> i.eq("name", "李白").ne("status", "活着"))
+     * 例: nested(i -&gt; i.eq("name", "李白").ne("status", "活着"))
      * </p>
      *
      * @param condition 执行条件