本帖最后由 tian 于 2016-7-29 21:21 编辑
select org.name as ks ,c.name as 名称,c.prc as 单价,sum(b.rksl) as 数量
from mtruku as a ,mtrukuinfo as b,mtprod as c,org
where a.mtykdrugstore=11
and a.iid=b.mtruku
and a.tp=2
and b.mtprod=c.iid
and org.iid=a.provider
${if(len(mingcheng) == 0, "", "and c.name like ' "+mingcheng+"%'")}
and rkriqi>'2016-01-01 00:00:00' and rkriqi<'2016-07-01 00:00:00'
group by org.name,c.name,c.prc
我的sql语句,要求在mingcheng的文本框里输入汉字,我不输入市能够查询所有值,但是一输入汉字,就一个都查不出来,请问是怎么回事呢?谢谢