| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.module.model.mcs.pre.dao.MmResultTableDao; |
| | | import com.iailab.module.model.mcs.pre.entity.MmResultTableEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmResultTableService;; |
| | | import com.iailab.module.model.mcs.pre.service.MmResultTableService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmResultTablePageReqVO; |
| | | 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 java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | ; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @date 2021年04月23日 16:28 |
| | | */ |
| | | @Service("mmResultTableService") |
| | | public class MmResultTableServiceImpl extends BaseServiceImpl<MmResultTableDao, MmResultTableEntity> implements MmResultTableService { |
| | | @Service |
| | | public class MmResultTableServiceImpl extends ServiceImpl<MmResultTableDao, MmResultTableEntity> implements MmResultTableService { |
| | | @Autowired |
| | | private MmResultTableDao mmResultTableDao; |
| | | |
| | | @Override |
| | | public PageResult<MmResultTableEntity> page(MmResultTablePageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | } |
| | | |
| | | private QueryWrapper<MmResultTableEntity> getWrapper(Map<String, Object> params) { |
| | | String tablename = (String)params.get("tablename"); |
| | | |
| | | QueryWrapper<MmResultTableEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.like(StringUtils.isNotBlank(tablename),"tablename", tablename); |
| | | |
| | | return wrapper; |
| | | return mmResultTableDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public MmResultTableEntity info(String id) { |
| | | return mmResultTableDao.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<MmResultTableEntity> list(Map<String, Object> params) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public void saveResultTable(MmResultTableEntity resultTable) { |
| | | resultTable.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(resultTable); |
| | | mmResultTableDao.insert(resultTable); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(MmResultTableEntity resultTable) { |
| | | baseDao.updateById(resultTable); |
| | | mmResultTableDao.updateById(resultTable); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteBatch(String[] resultTableIds) { |
| | | baseDao.deleteBatchIds(Arrays.asList(resultTableIds)); |
| | | mmResultTableDao.deleteBatchIds(Arrays.asList(resultTableIds)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | queryWrapper.ne(StringUtils.isNotBlank(id), "id", id); |
| | | queryWrapper.and(wrapper -> wrapper.eq("tablename",tablename)); |
| | | |
| | | List<MmResultTableEntity> list = baseDao.selectList(queryWrapper); |
| | | List<MmResultTableEntity> list = mmResultTableDao.selectList(queryWrapper); |
| | | return list.size(); |
| | | } |
| | | } |