beetlsql使用like条件做查询

Updated on in 程序人生 with 0 views and 0 comments

md中编写sql

select * from test_table where 1=1
@if(!isEmpty(indexName)){
        and index_name_ like #'%'+indexName+'%'#
    @}

在##符号中拼接%值%,最外层使用@if做判断,只在条件非空时执行此操作


标题:beetlsql使用like条件做查询
作者:wenyl
地址:http://www.wenyoulong.com/articles/2020/06/08/1591582216653.html