1. Conditional constructor

Description:

  • The first input parameter that appears below, Boolean condition, indicates whether the condition is added to the final SQL generated
  • Multiple methods in the following code block are top – down inputs to individual Boolean types, which default to true
  • The following occurrences of generic Param are subclass instances of Wrapper (all with AbstractWrapper methods)
  • The following methods appear as a generic R in an input parameter, a String in a plain Wrapper, and a function in a LambdaWrapper (e.g. Entity::getId,Entity is an Entity class, and getId is getMethod for the field ID)
  • The R column in the following methods represents the database field, or the database field name if the R type is String. ! Not entity class data field name!! In addition, the project Runtime does not support eclipse’s own compiler when R is of type SFunction.
  • The following examples use normal wrapper, and Map and List entries are represented as JSON!
  • If the Map or List is empty, it will not be added to the final SQL generated!!

2, QueryWrapper

Description:

Derived from AbstractWrapper, its own internal entity property is also used to generate a WHERE condition and a LambdaQueryWrapper, which can be obtained via the new QueryWrapper().lambda() method

Provide reference for subsequent tests

Note: data number 7 has been logically deleted


2.1. Eq. Ne

Eq: equal, ne: not equal


2.2 gt, GE, LT, LE

Gt: greater than ge: greater than or equal to lt: less than or equal to le: less than or equal to


2.3. Between and notBetween

Between: indicates that the value is between 1 and 2. NotBetween: indicates that the value is notBetween 1 and 2


2.4, like, notLike, likeLeft, likeRight

Like: ‘% value %’, notLike: ‘% value %’, likeLeft: ‘% value ‘, likeRight: ‘% value ‘


2.4, isNull, isNotNull

IsNull: indicates that the field IS NULL. IsNotNull: indicates that the field IS NOT NULL


2.5、in、notIn

In: field in (v0, v1…) , notIn: NOT IN (value.get(0), value.get(1)…


2.5. InSql and notInSql

InSql: field IN (SQL statement), notInSql: field NOT IN (SQL statement)


2.6, or, and

Or: splicing or, AND nesting

Matters needing attention:

Calling or actively means that the next method is not joined with and! (Default to use and if you do not call OR)

The default is to connect and without using and


2.6、exists、notExists

NotExists: concatenate NOT exists (SQL statement)


2.7, orderByAsc, orderByDesc

OrderByAsc: sort: ORDER BY field,… ASC, orderByDesc: ORDER: ORDER BY field,… DESC


The blogger will continue to update, interested partners can like, pay attention to and favorites oh, your support is the biggest motivation for my creation!

Java Learning path directory index