![Mybatis动态SQL单一基础类型参数用if标签 Mybatis动态SQL单一基础类型参数用if标签](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
Mybatis动态SQL单一基础类型参数用if标签时,test中应该用 _parameter,如:
1
2
3
4
5
6
|
<select id= "selectByName" resultMap= "ResultMap" parameterType= "java.lang.String" >
select * from table1
< if test= "_parameter != null" >
where _name = #{name}
</ if >
</select> |