package com.example.erp.service.pp;
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.example.erp.entity.pp.TagStyle;
|
import com.example.erp.mapper.pp.TagStyleMapper;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
@Service
|
@DS("pp")
|
public class TagStyleService {
|
private final TagStyleMapper tagStyleMapper;
|
|
public TagStyleService(TagStyleMapper tagStyleMapper) {
|
this.tagStyleMapper = tagStyleMapper;
|
}
|
|
public Boolean saveTag(TagStyle tagStyle) {
|
if(tagStyle.getId()==null){
|
return tagStyleMapper.insert(tagStyle)>0;
|
}else {
|
return tagStyleMapper.updateById(tagStyle)>0;
|
}
|
|
}
|
|
public List<TagStyle> getTagList() {
|
return tagStyleMapper.selectList(null);
|
}
|
|
public boolean deleteTag(Integer id) {
|
return tagStyleMapper.deleteById(id)>0;
|
}
|
|
public Boolean updateTag(TagStyle tagStyle) {
|
return tagStyleMapper.updateById(tagStyle)>0;
|
}
|
|
public TagStyle getTagById(Integer id) {
|
return tagStyleMapper.selectById(id);
|
}
|
}
|