select distinct code,name from bd_customer where enablestate = 2 and dr = 0 and name = '%${name}%' order by code
用这个语句查不出来呢
like
这样试试
模糊查询不是用like '%...%' 的吗,你写成等于了