package com.yqzx.common.service.impl;
|
|
|
import com.yqzx.common.mapper.BaseMapper;
|
|
import java.util.List;
|
|
/**
|
* @Description: 公共基础Service实现类
|
* @Author: liujun
|
* @Date: 2019-08-02 11:18
|
**/
|
public abstract class BaseServiceImpl<T,Q,R> {
|
|
private BaseMapper<T,Q,R> baseMapper;
|
|
public void setBaseMapper(BaseMapper<T,Q,R> baseMapper) {
|
this.baseMapper = baseMapper;
|
}
|
|
|
public int del(Long id) {
|
return baseMapper.deleteByPrimaryKey(id);
|
}
|
|
public int add(T t) {
|
return baseMapper.insert(t);
|
}
|
|
public int addSelective(T t) {
|
return baseMapper.insertSelective(t);
|
}
|
|
public T get(Long id) {
|
return baseMapper.selectByPrimaryKey(id);
|
}
|
|
public int editSelective(T t) {
|
return baseMapper.updateByPrimaryKeySelective(t);
|
}
|
|
public int edit(T t) {
|
return baseMapper.updateByPrimaryKey(t);
|
}
|
|
public List<R> getList(Q q) {
|
return baseMapper.getList(q);
|
}
|
}
|