赞
踩
@Query(value = "select * from tb_ajjbxx " +
"where 1=1 " +
"AND (coalesce(:#{#param.barPoliceNo},null) is null or \"bar1_police_no\" in (:#{#param.barPoliceNo}) OR coalesce(:#{#param.barPoliceNo},null) is null or \"bar2_police_no\" in (:#{#param.barPoliceNo}))" +
" order by \"SLRQ\" desc"
, nativeQuery = true)
Page<Ajjbxx> getDataByList(@Param("param") QueryDetalParam param,Pageable pageable);
相当于sql语句:select * from tb_ajjbxx where 1=1 AND ( bar1_police_no in (‘test1’,‘test2’) or bar2_police_no in (‘test1’,‘test2’)) order by “SLRQ” desc;
注:parpm的barPoliceNo字段类型为List。
(记录一下!)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。