| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.iailab.module.model.mcs.pre.dao.DmModuleItemDao; |
| | | import com.iailab.module.model.mcs.pre.entity.DmModuleItemEntity; |
| | | import com.iailab.module.model.mcs.pre.service.DmModuleItemService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * @author PanZhibao |
| | | * @date 2021年04月27日 9:20 |
| | | */ |
| | | @Service("dmModuleItemService") |
| | | public class DmModuleItemServiceImpl extends BaseServiceImpl<DmModuleItemDao, DmModuleItemEntity> implements DmModuleItemService { |
| | | |
| | | @Service |
| | | public class DmModuleItemServiceImpl extends ServiceImpl<DmModuleItemDao, DmModuleItemEntity> implements DmModuleItemService { |
| | | @Autowired |
| | | private DmModuleItemDao dmModuleItemDao; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveModuleItem(DmModuleItemEntity moduleItem) { |
| | | moduleItem.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(moduleItem); |
| | | dmModuleItemDao.insert(moduleItem); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(DmModuleItemEntity moduleItem) { |
| | | baseDao.updateById(moduleItem); |
| | | dmModuleItemDao.updateById(moduleItem); |
| | | } |
| | | |
| | | public DmModuleItemEntity getByItemid(String itemid) { |
| | | List<DmModuleItemEntity> list = baseDao.selectList(new QueryWrapper<DmModuleItemEntity>().in("itemid", itemid)); |
| | | List<DmModuleItemEntity> list = dmModuleItemDao.selectList(new QueryWrapper<DmModuleItemEntity>().in("itemid", itemid)); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return new DmModuleItemEntity(); |
| | | } |