传递过来三个参数,如果第一个参数不为null,另外两个为null,查询条件是where第一个参数,如果第一第二参数不为null,查询条件为where第一个参数 and 第二个参数
where 1=1
${if(len(参数1)=0,""," AND 字段1 IN ('"+参数1+"')")}
${if(len(参数2)=0,""," AND 字段2 IN ('"+参数2+"')")}
${if(len(参数3)=0,""," AND 字段3 IN ('"+参数3+"')")}
用${if(len(area) == 0,"","and 货主地区 = '" + area + "'")} 替换使用即可
WHERE 1=1 AND ${IF(LEN(参数1)=0,"1=1"," 你的字段='"+参数1+"'")} AND ${IF(LEN(参数2)=0,"1=1"," 你的字段='"+参数2+"'")}