This is the fourth day of my participation in the August More text Challenge. For details, see:August is more challenging
⭐ August more text challenge day 4 ⭐, MybatisPlus learning, welcome friends to learn 😁
Code Mantis shrimp is a sand sculpture and interesting young boy, like most friends like listening to music, games, of course, in addition to the interest of writing, Emm… The day is still very long, let us walk together 🌈
Welcome friends to pay attention to my public number: JavaCodes, although the name with Java, but the scope of more than Java field oh 😁, look forward to your attention ❤
The original link⭐MybatisPlus study Notes ⭐ (4) Conditional constructor Wrapper method detailed explanation
Before the order
⭐MybatisPlus learning notes ⭐ (1) Environment setup and entry HelloWorld
⭐MybatisPlus study Notes ⭐ (2) CRUD full set of detailed explanation
⭐MybatisPlus learning notes ⭐ (3) To achieve logical deletion, paging
1. Conditional constructor
Description:
- The Boolean condition indicates whether the condition is added to the last generated SQL
- The methods in the following code block complete individual Boolean input arguments from the top down. The default is true
- The following generic Param occurrences are subclass instances of Wrapper (all with AbstractWrapper methods)
- The R in the input of the following methods is generic, String in the wrapper and function in the LambdaWrapper (for example,Entity ::getId,Entity is the Entity class and getId is the getMethod of the field ID)
- The R column in the following methods represents the database field, or the name of the database field when the R specific type is String. (The name of the field is the database keyword itself wrapped with an escape character!) ! Instead of entity class data field name!! If the R concrete type is SFunction, the project runtime does not support eclipse’s own compiler.
- In the following examples, the wrapper is used, and the Map and List parameters are expressed in JSON form.
- If the Map or List is empty, it will not be added to the SQL generated.
2, QueryWrapper
Description:
Inherited from AbstractWrapper, the internal entity property is also used to generate the WHERE condition and LambdaQueryWrapper, which can be obtained via the new QueryWrapper().lambda() method
Provide reference for subsequent testing
Note: Data number 7 has been logically deleted
2.1 eq and NE
Eq: equals, ne: does not equal
2.2. Gt, GE, LT, LE
Gt: greater than, GE: greater than or equal to, LT: less than, le: less than or equal to
2.3. Between and notBetween
Between: between value 1 and value 2. NotBetween: notBetween value 1 and value 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: Field 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
Notes:
An active call to or means that the next method is not connected with and! (If you do not call or, use the and connection by default)
The default is an and connection
2.6 there are exists and notExists
Exists: concatenated EXISTS, notExists: Concatenated NOT exists (SQL statement)
OrderByAsc, orderByDesc
OrderByAsc: ORDER BY field,… ASC, orderByDesc: ORDER BY… DESC
The last
I am aCode pipi shrimpI am a mantis shrimp lover who loves to share knowledge. I will keep updating my blog in the future. I look forward to your attention!!
Creation is not easy, if this blog is helpful to you, I hope you can == a key three! ==, thanks for your support, see you next time ~~~
Share the outline
Big factory interview questions column
PC crawler column
App Crawler Column