|
@Query("select no, name, sex from Student #{#where} order by age desc")
// 增加若干个条件
@Condition("no like ?1") // ?1的值,如果是null, 该行条件将不参与运算
@Condition("and name like ?2") // 参数 ?2,如果接收到的值为null,该条件不参与运算
// 通过 ignoreNull=false 开启条件值即使是null也参与运算
@Condition(value = "and age > ?3",ignoreNull=false) //?3收到null,该条件也参与运算
@Condition("or dept in(?4,?5,?6)") //第4个或第5个或第6个参数,传递null值,该行条件将不参与运算
@Condition("and name not like ?7")
@Condition("or age between ?8 and ?9")
Student[] findAllStudent(... args ...); |
|
|