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.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.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.*;
|
|
;
|
|
/**
|
* @author PanZhibao
|
* @date 2021年04月23日 16:28
|
*/
|
@Service
|
public class MmResultTableServiceImpl extends ServiceImpl<MmResultTableDao, MmResultTableEntity> implements MmResultTableService {
|
@Autowired
|
private MmResultTableDao mmResultTableDao;
|
|
@Override
|
public PageResult<MmResultTableEntity> page(MmResultTablePageReqVO reqVO) {
|
return mmResultTableDao.selectPage(reqVO);
|
}
|
|
@Override
|
public MmResultTableEntity info(String id) {
|
return mmResultTableDao.selectById(id);
|
}
|
|
@Override
|
public List<MmResultTableEntity> list(Map<String, Object> params) {
|
return mmResultTableDao.selectList(new QueryWrapper<>());
|
}
|
|
@Override
|
public void saveResultTable(MmResultTableEntity resultTable) {
|
resultTable.setId(UUID.randomUUID().toString());
|
mmResultTableDao.insert(resultTable);
|
}
|
|
@Override
|
public void update(MmResultTableEntity resultTable) {
|
mmResultTableDao.updateById(resultTable);
|
}
|
|
@Override
|
public void deleteBatch(String[] resultTableIds) {
|
mmResultTableDao.deleteBatchIds(Arrays.asList(resultTableIds));
|
}
|
|
@Override
|
public int check(MmResultTableEntity resultTable) {
|
String id = resultTable.getId();
|
String tablename = resultTable.getTablename();
|
QueryWrapper<MmResultTableEntity> queryWrapper = new QueryWrapper<>();
|
queryWrapper.ne(StringUtils.isNotBlank(id), "id", id);
|
queryWrapper.and(wrapper -> wrapper.eq("tablename",tablename));
|
|
List<MmResultTableEntity> list = mmResultTableDao.selectList(queryWrapper);
|
return list.size();
|
}
|
}
|