jpa 模糊 查询 like
1 2 3 4 5 6 7 8 9 10 11 12 13 | if (StringUtil.isNotEmpty(biaozhun)){ list = ruKuDao.huizong_biaozhun(StringUtil.formatLike(biaozhun.trim())); for (JSONObject object :list){ Material material = materialDao.findId(object.getInt( "material_id" )); object.put( "materialName" ,material.getName()); } } @Query(value= "SELECT biaozhun,guige,material_id , SUM(num-use_num) num ,SUM(weight) weight,SUM(jine) jine FROM `t_ruku` " + " WHERE is_live = 1 AND num>0 and biaozhun like ?1 GROUP BY biaozhun, guige ,material_id \n" ,nativeQuery = true ) public List<JSONObject> huizong_biaozhun( String biaozhun); |
站长微信:xiaomao0055
站长QQ:14496453