1.baseresultmap
2.sql
id, name, password
3.確切的select
select from login_test
name=#
4.模糊的select
select from login_test
name like '%#%'
5.批量的select(可用於資料庫表的批量匯出)
select
from login_test where id in
#
6.有選擇性的update
update login_test
username = #,
password = #,
where id = #
7.無選擇性的uptate
update login_test
set name = #,
password = #,
where id = #
8.單個delete
delete from login_test
where id =#
9.批量delete
delete from login_test where id in
#
10.有選擇性的單個insert
insert into login_test
id,username,
password,
#,#,
#,
11.無選擇性的單個insert
insert into mmall_user (id, username, password)
values (#, #, #)
12.批量插入
insert into mmall_order_item (id, name, password)
values
(#,#,# )
13.多表更新
update $ set object_version_number=#
code_id = #
and code_value_id = #
and product_id = #
and property_id = #
and cmd_id = #
and param_id = #
and title = #
14.自定義插入某個表:
update $ set object_version_number=#
code_id = #
and code_value_id = #
and product_id = #
and property_id = #
and cmd_id = #
and param_id = #
and template_id = #
Mybatis中常用註解
select employee id,employee name,employee password,employee age,department id from employee where employee id select employee id,employee name,employe...
SQL中常用的聯接
內聯接 只包含匹配的行,也就是只返回兩個資料集都有的部分對應的行 select from table1 inner join table2 on table1.column table2.column 外聯接擴充套件了內聯接,它還返回左邊或右邊的資料集中不匹配的資料,不匹配的資料以null顯示 左外...
mybatis常用的sql語句
目錄基礎 查詢分頁查詢 多條件查詢 查詢單條資料 查詢like 插入 普通插入 批量插入 刪除 批量刪除 更新 更新語句 批量更新 eviction lru flushinterval快取時間,以毫秒為單位 size快取大小 readonly如果為false的話,快取物件必須是可序列化的 selec...