当前位置:网站首页>Final summary of addition, deletion, modification and query - 2.2 (knowledge points in mapper.xml)
Final summary of addition, deletion, modification and query - 2.2 (knowledge points in mapper.xml)
2022-06-12 03:03:00 【Men should be calm, boiling water will only evaporate】
1、 Dynamic values / Do not take a fixed value
#{key} example :id = #{id}、name = #{name}……
2、xml Escape character
> use > Instead of
< use < Instead of
& use & Instead of
Universal escape character <![CDATA[ Escape content , There are >、< And so on , Will the whole sql Statement put here ]]>
3、 ... and 、Sql label —— Example : Add, delete, modify and check the final summary —1( Additions and deletions )→ Fuzzy query
Sql Repeated data often appears in statements . If you write your own handwriting every time you repeat . The efficiency of development is low ;
Sql Tags can save code
shortcoming : Readability has deteriorated , It doesn't look intuitive If it is an association operation Depending on the situation
<!--Sql label : Draw out the public Sql sentence -->
<sql id="tableColumn">
id,name,age,sex
</sql>
<select id="findUserByLike" resultType="User">
/*SELECT id,name,age,sex FROM demo_user WHERE NAME LIKE "%"#{name}"%" Just use the following line instead */
SELECT <include refid="tableColumn"/> FROM demo_user WHERE NAME LIKE "%"#{name}"%"
</select> <!-- among refid It means to quote -->
边栏推荐
- The program actively carries out telephone short message alarm, and customizes telephone, short message and nail alarm notifications
- 分数大小的比较
- Interpreting 2021 of middleware: after being reshaped by cloud nativity, it is more difficult to select models
- Introduce the functions of the new project aleo
- Query the duplicate values of multiple fields in the database, output the number, and add them.
- Bochuang smart sprint technology innovation board: annual revenue of RMB 1.1 billion, book value of accounts receivable of RMB 300million
- The market value has exceeded $3trillion. Why should apple, which has been criticized as a loser, rise again and again?
- Intel case
- How to prevent electrical fire in shopping malls?
- Apply concentrated load to nodes in batch in ABAQUS
猜你喜欢

Comparaison de la taille des fractions

Wechat applet project example - renju for two

如何防止商场电气火灾的发生?

Drawcall, batches, setpasscall in unity3d

(9) Serial port interrupt

微积分复习2

Hypergraph tilted data is merged into root node and transferred to 3dfiles

Demand and business model innovation - demand 6- stakeholder analysis and hard sampling

Apache simple honeypot

Requirements and business model innovation - Requirements 12 - process oriented modeling
随机推荐
How to prevent electrical fire in shopping malls?
ssh公钥登录失败报错:sign_and_send_pubkey: no mutual signature supported
Restful interface design specification [for reference only]
I2C protocol overview
The four pain points of enterprise digitalization are solved by low code platform
微信小程序項目實例——體質計算器
errno: -4078, code: ‘ECONNREFUSED‘, syscall: ‘connect‘, address: ‘127.0.0.1‘, port: 3306; Postman error
Interpreting 2021 of middleware: after being reshaped by cloud nativity, it is more difficult to select models
Demand and business model innovation - demand 11 - overview of demand analysis
Depth copy
How to build urban smart bus travel? Quick code to answer
Cupp dictionary generation tool (similar tools include crunch)
JSON and XML pros and cons
微信小程序项目实例——体质计算器
How to make div 100% page (not screen) height- How to make a div 100% of page (not screen) height?
oracle之序列
The market value has exceeded $3trillion. Why should apple, which has been criticized as a loser, rise again and again?
Demand and business model innovation - demand 6- stakeholder analysis and hard sampling
Function templatesfunction templates
Common errors when mysql8 connects through JDBC