|
select * from student 1.動態(tài)語句中的prepend屬性<dynamic prepend="where"> <isNotNull property="id" prepend="and"> id = #id# </isNotNull> <isNotNull property="name" prepend="and"> name like '%$name$%' </isNotNull> </dynamic> prepend是添加在動態(tài)語句的前面 <dynamic>標(biāo)簽中首個prepend被忽略. <isNotNull property="id" prepend="and">標(biāo)簽中必須加prepend="and"因為如果不加的話, <isNotNull property="name" prepend="and">此標(biāo)簽中的prepend="and"中的and會被忽略. 2.like模糊查詢 '%$name$%' 3.<isNotNull>標(biāo)簽與<isNotEmpty>標(biāo)簽的區(qū)分 |
|
|
來自: 篤志書堂 > 《IT技術(shù)》