| 12345678910111213141516171819202122232425262728293031323334353637 |
- package com.hssx.cloudmodel.service.impl;
- import com.hssx.cloudmodel.entity.Mould;
- import com.hssx.cloudmodel.entity.User;
- import com.hssx.cloudmodel.mapper.MouldMapper;
- import com.hssx.cloudmodel.service.MouldService;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import com.hssx.cloudmodel.util.HttpRespMsg;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import javax.annotation.Resource;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author 吴涛涛
- * @since 2019-07-30
- */
- @Service
- public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements MouldService {
- @Resource
- MouldMapper mouldMapper;
- @Override
- public HttpRespMsg addAndUpdateMould(Mould mould, User user) {
- if(mould.getId() != null){
- //修改
- mouldMapper.updateById(mould);
- }else{
- mould.setCreatorId(user.getId());
- mouldMapper.insert(mould);
- }
- return null;
- }
- }
|