All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vilya.common.service.AbstractService Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package io.vilya.common.service;

import java.util.List;

import com.github.pagehelper.PageHelper;

import io.vilya.common.bean.EntityBean;
import io.vilya.common.bean.req.QueryBean;
import io.vilya.common.mapper.BaseMapper;

public abstract class AbstractService implements BaseService {

    public T get(Integer id) {
        return getMapper().get(id);
    }

    public List list(QueryBean pageBean, T record) {
        if (pageBean != null && pageBean.getCurrentPage() != null && pageBean.getPageSize() != null) {
            PageHelper.startPage(pageBean.getCurrentPage(), pageBean.getPageSize());
        }
        return getMapper().list(record);
    }

    public void delete(Integer id) {
        getMapper().delete(id);
    }

    public void save(T record) {
        getMapper().save(record);
    }

    public void update(T record) {
        getMapper().update(record);
    }

    protected abstract BaseMapper getMapper();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy