| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.iailab.framework.common.page.PageData; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | |
| | | import com.iailab.module.model.mcs.pre.service.DmModuleService; |
| | | import com.iailab.module.model.mcs.pre.vo.DmModulePageReqVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @date 2021年04月23日 8:36 |
| | | */ |
| | | @Service("dmModuleService") |
| | | public class DmModuleServiceImpl extends BaseServiceImpl<DmModuleDao, DmModuleEntity> implements DmModuleService { |
| | | @Service |
| | | public class DmModuleServiceImpl extends ServiceImpl<DmModuleDao, DmModuleEntity> implements DmModuleService { |
| | | |
| | | @Autowired |
| | | private DmModuleDao dmModuleDao; |
| | | |
| | | @Override |
| | | public PageResult<DmModuleEntity> queryPage(DmModulePageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | return dmModuleDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | public List<DmModuleEntity> list(Map<String, Object> params) { |
| | | QueryWrapper<DmModuleEntity> wrapper = getWrapper(params); |
| | | wrapper.orderByDesc("CREATE_TIME"); |
| | | return baseDao.selectList(wrapper); |
| | | return dmModuleDao.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public DmModuleEntity get(String id) { |
| | | return baseDao.selectById(id); |
| | | public DmModuleEntity info(String id) { |
| | | return dmModuleDao.selectById(id); |
| | | } |
| | | |
| | | private QueryWrapper<DmModuleEntity> getWrapper(Map<String, Object> params) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveModule(DmModuleEntity module) { |
| | | module.setId(UUID.randomUUID().toString()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | module.setPredicttime(calendar.getTime()); |
| | | module.setCollecttime(calendar.getTime()); |
| | | module.setUpdateTime(new Date()); |
| | | baseDao.insert(module); |
| | | dmModuleDao.insert(module); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(DmModuleEntity module) { |
| | | module.setUpdateTime(new Date()); |
| | | baseDao.updateById(module); |
| | | dmModuleDao.updateById(module); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteBatch(String[] moduleIds) { |
| | | baseDao.deleteBatchIds(Arrays.asList(moduleIds)); |
| | | dmModuleDao.deleteBatchIds(Arrays.asList(moduleIds)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | Map<String, Object> params = new HashMap<>(1); |
| | | params.put("moduletype", moduletype); |
| | | QueryWrapper<DmModuleEntity> wrapper = getWrapper(params); |
| | | return baseDao.selectList(wrapper); |
| | | return dmModuleDao.selectList(wrapper); |
| | | |
| | | } |
| | | |
| | |
| | | moduleWrapper.ne(StringUtils.isNotBlank(id), "id", id); |
| | | moduleWrapper.and(wrapper -> wrapper.eq("modulename", modulename)); |
| | | |
| | | List<DmModuleEntity> list = baseDao.selectList(moduleWrapper); |
| | | List<DmModuleEntity> list = dmModuleDao.selectList(moduleWrapper); |
| | | return list.size(); |
| | | } |
| | | |