package com.jkcredit.invoice.service.manager.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jkcredit.invoice.mapper.manager.ParamMapper;
import com.jkcredit.invoice.model.entity.manager.Param;
import com.jkcredit.invoice.service.manager.ParamService;
import com.jkcredit.invoice.util.RespR;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * @description:
 * @author: sunzhaoning
 * @create: 2019-05-28 17:53
 * @version: V1.0
 **/
@Service
public class ParamServiceImpl extends ServiceImpl<ParamMapper, Param> implements ParamService {


    @Override
    public IPage getParamWithRolePage(Page page, Param param) {
        return baseMapper.getParamsPage(page, param);
    }

    @Override
    public Param getParamsByParamName(String paramName) {
        return baseMapper.getParamByParamName(paramName);
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveParam(Param param) {
        this.save(param);
        return Boolean.TRUE;
    }


    @Override
    public RespR<Boolean> updateParam(Param param) {
        return new RespR<>(baseMapper.updateParam(param));
    }

}