package com.thhy.usercore.modules.sys.sysbutton.service.impl;
|
|
import com.thhy.usercore.modules.sys.sysbutton.entity.ButtonDto;
|
import com.thhy.usercore.modules.sys.sysbutton.entity.ButtonVo;
|
import com.thhy.usercore.modules.sys.sysbutton.entity.SysButton;
|
import com.thhy.usercore.modules.sys.sysbutton.mapper.SysButtonMapper;
|
import com.thhy.usercore.modules.sys.sysbutton.service.ISysButtonService;
|
import com.thhy.usercore.modules.sys.sysmenubutton.entity.MenuButtonListVo;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.io.Serializable;
|
import java.util.List;
|
|
/**
|
* <p>
|
* 服务实现类
|
* </p>
|
*
|
* @author zhang_xiao_bo
|
* @since 2022-04-01
|
*/
|
@Service
|
public class SysButtonServiceImpl implements ISysButtonService {
|
|
|
@Autowired
|
private SysButtonMapper sysButtonMapper;
|
|
public SysButton get(Serializable id){
|
return sysButtonMapper.queryById(id);
|
}
|
|
public List<SysButton> findList(SysButton sysButton){
|
return sysButtonMapper.findList(sysButton);
|
}
|
|
@Override
|
public List<ButtonVo> RoleButtonList(ButtonDto buttonDto) {
|
return sysButtonMapper.RoleButtonList(buttonDto);
|
}
|
|
@Override
|
public List<MenuButtonListVo> MenuButtonList(ButtonDto buttonDto) {
|
return sysButtonMapper.menuButtonList(buttonDto);
|
}
|
|
@Transactional
|
public SysButton addButton(SysButton sysButton){
|
if(sysButton.getButtonId()==null){
|
sysButtonMapper.insert(sysButton);
|
}else{
|
sysButtonMapper.update(sysButton);
|
}
|
return sysButton;
|
}
|
|
/**
|
* 物理删除
|
* @param id
|
*/
|
public int delete(Serializable id){
|
return sysButtonMapper.deleteById(id);
|
}
|
|
|
}
|