在这里就推荐 原地址 ,可以访问这个链接有详细介绍。
注意:如果是ssh框架做模糊查询的时候,最好是自己写HQL语句,要不然出不了数据,反正我试过了。
ssh框架的HQL例子:
@Query("SELECT it FROM magneto.Xmgl it WHERE it.ztId=?1 and it.listType=?2 and it.name like %?3% and it.projectCode like %?4%") Page<Xmgl> findAllByZtIdAndListTypeAndNameLikeAndProjectCodeLike(int ztId, ListType listType, String name, String projectCode, Pageable pageable); @Query("SELECT count(it.id) FROM magneto.Xmgl it WHERE it.ztId=?1 and it.listType=?2 and it.name like %?3% and it.projectCode like %?4%") long countByZtIdAndListTypeAndNameLikeAndProjectCodeLike(int ztId, ListType listType, String name, String projectCode);