标签:aaa script prope epo match system str concat 排序
例子
public void aaa() { //1. @Query List<LogisticsFinanceDayOrder> list1 = logisticsFinanceDayOrderDao.ccc(); LogisticsFinanceDayOrder list2 = logisticsFinanceDayOrderDao.ccc2("5"); List<String> list3 = logisticsFinanceDayOrderDao.ccc3("18日"); //2. 排序查询 Sort sort=new Sort(Sort.Direction.DESC,"id"); List<LogisticsFinanceDayOrder> list = logisticsFinanceDayOrderDao.findAll(sort); System.out.println("ccc"); //3. 分页排序查询 PageRequest pageRequest = PageRequest.of(0,4,sort); Page<LogisticsFinanceDayOrder> page = logisticsFinanceDayOrderDao.findAll(pageRequest); System.out.println("ccc"); //4. 实体匹配查询 LogisticsFinanceDayOrder logisticsFinanceDayOrder = new LogisticsFinanceDayOrder(); //logisticsFinanceDayOrder.setId("5"); logisticsFinanceDayOrder.setDescription("18日"); ExampleMatcher exampleMatcher = ExampleMatcher.matching().withMatcher("description", ExampleMatcher.GenericPropertyMatchers.startsWith()); Example example = Example.of(logisticsFinanceDayOrder,exampleMatcher); List<LogisticsFinanceDayOrder> l = logisticsFinanceDayOrderDao.findAll(example); } @Repository public interface LogisticsFinanceDayOrderDao extends BaseDao<LogisticsFinanceDayOrder>, LogisticsFinanceDayOrderDaoCustom { @Query("from LogisticsFinanceDayOrder") public List<LogisticsFinanceDayOrder> ccc(); @Query("from LogisticsFinanceDayOrder where id = ?1") public LogisticsFinanceDayOrder ccc2(String id); @Query("select orderNo from LogisticsFinanceDayOrder where description like CONCAT(:description,‘%‘)") public List<String> ccc3(@Param("description") String description); }
标签:aaa script prope epo match system str concat 排序
原文地址:https://www.cnblogs.com/yifanSJ/p/9815638.html