Stage 3 1.Mybatis_08. SQL_03.mybatis dynamic sql dynamic sql statement -foreach and labels

foreach tag

in query

sql statement is well written, but the pass argument to change how pass it in the mapping document which

defined a List <Integer> member variable, and then generates get and set

to define a new query method






open: start symbol
close: the end of the symbol
item: traverse out where each store to store to the above mentioned id
separator: comma to separate

uid here. These two places are corresponding relationship. Written above uid below have to use # {uid}



found three data

Repeat the extraction of sql statement


Use the following labels include the introduction of select * from user


all the way to query, select * introduced by inlude way



to test the statement in a query. As used herein include the way also introduces select * from user

error.

The reasons for errors.

Remove the semicolon, executed in the query again

 

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11319224.html