站内搜索功能 我想在我的表中3个字段中去查询,如:
select * from test where name like '%?%' or title like '?' or score like '?'  假如,这三个字段都是一个实体类testlike中的一些属性,用list怎么去传参?我测试过  list.add(condition.getName()); 是不行的! 
这个语句的参数我怎么传给我的java代码?有具体代码最好,小弟借鉴拜读一下!

解决方案 »

  1.   

    Object[] args = new Object[5];
    args[0] = deptId;
    args[1] = sign;
    SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
    args[2] = sf.parse(sf.format(new Date()));         args[3] = "-";
    args[4] = corpId;this.bzhXwqyService.updateByHql("update TbshyBzhXwqyPsjg set checkDdzId = ?,checkIsPass = ?,checkRecordTime = ?,checkResult = ? where corpId = ?", args);你问的是这个不?
      

  2.   

    没看懂
    这三个字段都是一个实体类testlike中的一些属性,那你就直接传testlike对象过去,然后使用testlike.getName();等方式设置那三个值啊?