The SQL statement queries all data by default when the query condition is empty, and queries according to the condition if it is not empty

select * from 表 where (字段=条件 or 条件='')


When the condition is not empty, the SQL statement is equivalent to:select * from 表 where 字段=条件;

When the condition is empty, the SQL statement is equivalent to: select * from 表 where ''='';In this way, when the query condition is empty, all data is queried by default, and when the query result is not empty, the corresponding data is queried.

edge: (where condition)

where f_name like '%${name}%' and (f_status=#{status} or #{status}='') and (f_data_node=#{dataNode} or #{dataNode}='') and (f_warehousing_scheme like '%${warehousingScheme}%' or '%${warehousingScheme}%' like '%%')")

Guess you like

Origin blog.csdn.net/Jiang5106/article/details/129795818