如何编写Mybatis的动态SQL语句?
- 内容介绍
- 文章标签
- 相关推荐
本文共计705个文字,预计阅读时间需要3分钟。
使用`if`语句将需要根据条件执行的操作包含在`WHERE`子句中,示例代码如下:
sqlt.text=1;if (condition) { select * from tb_employee where state='active' and id=condition_value;}
t.text1.if
通过if把会做的事情有条件的包含在where里面,例子:
select * from tb_employee where state='active'
本文共计705个文字,预计阅读时间需要3分钟。
使用`if`语句将需要根据条件执行的操作包含在`WHERE`子句中,示例代码如下:
sqlt.text=1;if (condition) { select * from tb_employee where state='active' and id=condition_value;}
t.text1.if
通过if把会做的事情有条件的包含在where里面,例子:
select * from tb_employee where state='active'

