Java Code Examples for io.jboot.db.model.Columns#like()

The following examples show how to use io.jboot.db.model.Columns#like() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogServiceImpl.java    From jboot-admin with Apache License 2.0 6 votes vote down vote up
@Override
public Page<Log> findPage(Log log, int pageNumber, int pageSize) {
    Columns columns = Columns.create();

    if (StrKit.notBlank(log.getIp())) {
        columns.like("ip", "%"+log.getIp()+"%");
    }
    if (StrKit.notBlank(log.getUrl())) {
        columns.like("url", "%"+log.getUrl()+"%");
    }
    if (StrKit.notBlank(log.getLastUpdAcct())) {
        columns.like("lastUpdAcct", "%"+log.getLastUpdAcct()+"%");
    }

    return DAO.paginateByColumns(pageNumber, pageSize, columns.getList(), "id desc");
}
 
Example 2
Source File: UserServiceImpl.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public Page<User> findPage(User user, int pageNumber, int pageSize) {
    Columns columns = Columns.create();

    if (StrKit.notBlank(user.getName())) {
        columns.like("name", "%"+user.getName()+"%");
    }
    if (StrKit.notBlank(user.getPhone())) {
        columns.like("phone", "%"+user.getPhone()+"%");
    }
    return DAO.paginateByColumns(pageNumber, pageSize, columns.getList(), "id desc");
}
 
Example 3
Source File: RoleServiceImpl.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public Page<Role> findPage(Role sysRole, int pageNumber, int pageSize) {
    Columns columns = Columns.create();

    if (StrKit.notBlank(sysRole.getName())) {
        columns.like("name", "%"+sysRole.getName()+"%");
    }

    return DAO.paginateByColumns(pageNumber, pageSize, columns.getList(), "seq asc");
}
 
Example 4
Source File: ResServiceImpl.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public Page<Res> findPage(Res sysRes, int pageNumber, int pageSize) {
    Columns columns = Columns.create();

    columns.eq("pid", sysRes.getPid() == null ? 0L : sysRes.getPid());
    if (StrKit.notBlank(sysRes.getName())) {
        columns.like("name", "%"+sysRes.getName()+"%");
    }
    if (StrKit.notBlank(sysRes.getUrl())) {
        columns.like("url", "%"+sysRes.getUrl()+"%");
    }

    return DAO.paginateByColumns(pageNumber, pageSize, columns.getList(), "seq asc");
}
 
Example 5
Source File: DataServiceImpl.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public Page<Data> findPage(Data data, int pageNumber, int pageSize) {
    Columns columns = Columns.create();

    if (StrKit.notBlank(data.getType())) {
        columns.like("type", "%"+data.getType()+"%");
    }
    if (StrKit.notBlank(data.getTypeDesc())) {
        columns.like("typeDesc", "%"+data.getTypeDesc()+"%");
    }
    return DAO.paginateByColumns(pageNumber, pageSize, columns.getList(), "type asc ,orderNo asc");
}
 
Example 6
Source File: ProductServiceImpl.java    From jboot-admin with Apache License 2.0 5 votes vote down vote up
@Override
public Page<Product> findPage(Product product, int pageNumber, int pageSize) {
    Columns columns = Columns.create();

    if (StrKit.notBlank(product.getName())) {
        columns.like("name", "%"+product.getName()+"%");
    }
    return DAO.paginateByColumns(pageNumber, pageSize, columns.getList(), "id desc");
}
 
Example 7
Source File: AttachmentServiceProvider.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Page _paginate(int page, int pagesieze, String title) {
    Columns columns = Columns.create();
    if (StrUtil.isNotBlank(title)) {
        columns.like("title", "%" + title + "%");
    }

    return DAO.paginateByColumns(page, pagesieze, columns, "id desc");
}
 
Example 8
Source File: SinglePageServiceProvider.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Page<SinglePage> _paginateByStatus(int page, int pagesize, String title, String status) {

    Columns columns = Columns.create("status", status);
    if (StrUtil.isNotBlank(title)) {
        columns.like("title", "%" + title + "%");
    }

    return DAO.paginateByColumns(page,
            pagesize,
            columns,
            "id desc");
}
 
Example 9
Source File: SinglePageServiceProvider.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Page<SinglePage> _paginateWithoutTrash(int page, int pagesize, String title) {

    Columns columns = Columns.create(Column.create("status", SinglePage.STATUS_TRASH, Column.LOGIC_NOT_EQUALS));
    if (StrUtil.isNotBlank(title)) {
        columns.like("title", "%" + title + "%");
    }

    return DAO.paginateByColumns(page,
            pagesize,
            columns,
            "id desc");
}