package com.thhy.staff.modules.biz.dormuser.service.impl;
|
|
import com.thhy.staff.modules.biz.dormuser.entity.DormUser;
|
import com.thhy.staff.modules.biz.dormuser.mapper.DormUserMapper;
|
import com.thhy.staff.modules.biz.dormuser.service.DormUserService;
|
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-03 12:51:43
|
*/
|
@Service
|
public class DormUserServiceImpl implements DormUserService {
|
|
|
|
@Autowired
|
private DormUserMapper dormUserMapper;
|
|
public DormUser get(Serializable id){
|
return dormUserMapper.queryById(id);
|
}
|
|
public List<DormUser> findList(DormUser dormUser){
|
return dormUserMapper.findList(dormUser);
|
}
|
|
/**
|
* 增加和修改
|
* @param dormUser
|
*/
|
@Transactional
|
public void addDormUser(DormUser dormUser){
|
if(dormUser.getDormId() == null){
|
//增加操作
|
dormUserMapper.insert(dormUser);
|
}else{
|
//修改操作
|
dormUserMapper.update(dormUser);
|
}
|
|
}
|
|
/**
|
* 修改
|
* @param dormUser
|
*/
|
public void update(DormUser dormUser){
|
dormUserMapper.update(dormUser);
|
}
|
|
/**
|
* 删除
|
* @param dormId
|
*/
|
public void delete(Serializable dormId){
|
dormUserMapper.deletelogic(dormId);
|
}
|
}
|