传入的对象需要用@param注解修饰,value是查询语句,countQuery是查询总数,页数语句

 @Query(nativeQuery = true, value = "select * from client " +
            "where type = 1 " +
            "and if(:#{#customer.bluury} is not null, company like CONCAT(:#{#customer.blurry},'%'),1=1) " +
            "and client.dept_id = :#{#customer.deptId} " +
            "and if(:#{#customer.principal} is not null,principal = :#{#customer.principal},1=1) " +
            "order by follow_time desc ",
            countQuery = "select count(1) from client " +
                    "where type = 1 " +
                    "and if(:#{#customer.bluury} is not null, company like CONCAT(:#{#customer.blurry},'%'),1=1) " +
                    "and client.dept_id = :#{#customer.deptId} " +
                    "and if(:#{#customer.principal} is not null,principal = :#{#customer.principal},1=1) " )
    Page<Client> findAllByDeptId(Pageable pageable,@Param("customer") CustomerQueryReq customer );

相关文章:

  • 2021-08-26
  • 2021-06-18
  • 2021-05-22
  • 2022-02-15
  • 2021-06-19
猜你喜欢
  • 2021-06-16
  • 2021-06-10
  • 2021-11-15
  • 2022-01-08
  • 2021-06-01
相关资源
相似解决方案