tk.mybatis 中 Example 的使用

import tk.mybatis.mapper.entity.Example;
import com.github.pagehelper.PageHelper;

@Override
public List<RepaymentPlan> selectOrderItem(Integer pageNum, Integer pageSize) {
    Example example = new Example(OrderItem.class);
    // 排序
    example.orderBy("id");
    // 条件查询
    example.createCriteria()
            .andNotEqualTo("status", 3)
            .andLessThanOrEqualTo("createDate", new Date());
    // 分页
    PageHelper.startPage(pageNum, pageSize); // pageNum 页数;pageSize每页个数
    return orderItemMapper.selectByExample(example);
}

猜你喜欢