package com.thhy.engineering.modules.biz.company.service.impl;
|
|
import com.thhy.engineering.modules.biz.company.entity.ComDepart;
|
import com.thhy.engineering.modules.biz.company.mapper.ComDepartMapper;
|
import com.thhy.engineering.modules.biz.company.service.ComDepartService;
|
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;
|
|
/**
|
* 服务实现类
|
* @author zhang_xiao_bo
|
* @since 2023-04-28 08:55:43
|
*/
|
@Service
|
public class ComDepartServiceImpl implements ComDepartService {
|
|
|
|
@Autowired
|
private ComDepartMapper comDepartMapper;
|
|
public ComDepart get(Serializable id){
|
return comDepartMapper.queryById(id);
|
}
|
|
public List<ComDepart> findList(ComDepart comDepart){
|
return comDepartMapper.findList(comDepart);
|
}
|
|
/**
|
* 增加和修改
|
* @param comDepart
|
*/
|
@Transactional
|
public void addComDepart(ComDepart comDepart){
|
if(comDepart.getId() == null){
|
//增加操作
|
comDepartMapper.insert(comDepart);
|
}else{
|
//修改操作
|
comDepartMapper.update(comDepart);
|
}
|
|
}
|
|
/**
|
* 修改
|
* @param comDepart
|
*/
|
public void update(ComDepart comDepart){
|
comDepartMapper.update(comDepart);
|
}
|
|
/**
|
* 删除
|
* @param id
|
*/
|
public void delete(Serializable id){
|
comDepartMapper.deletelogic(id);
|
}
|
}
|