mybatis写动态sql时需要多个必要条件加上任意一个不必要条件怎么写

2025-03-20 16:54:55
推荐回答(1个)
回答1:

我是这样解决的:select userName from users where userId > 0 and 别的条件。如果你要通用的,也可以在这样写:
select userName from ysers where 1=1 and 条件