SELECT * FROM [dbo].[patrol]
where 1=1 ${if(公司名称="景田总部",and "1=1",and "company'"+公司名称+"'" )}
and date between '${starttime}' and '${endtime}'
order by date,
patrolTime
sql粘贴出来一下
1=1 ${if(公司名称="景田总部", " and 1=1", " and company'"+公司名称+"'" )}
------------
where
date between '${starttime}' and '${endtime}'
and 1=1 ${if(公司名称="景田总部", " and 1=1", " and company'"+公司名称+"'" )}
----
写错了