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 { private BaseMapper baseMapper; public void setBaseMapper(BaseMapper 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 getList(Q q) { return baseMapper.getList(q); } }