提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mcs.pre.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5c6007
|
4 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7fd198
|
5 |
import com.iailab.framework.common.pojo.PageResult; |
潘 |
6 |
import com.iailab.module.model.mcs.pre.dao.MmResultTableDao; |
|
7 |
import com.iailab.module.model.mcs.pre.entity.MmResultTableEntity; |
5c6007
|
8 |
import com.iailab.module.model.mcs.pre.service.MmResultTableService; |
7fd198
|
9 |
import com.iailab.module.model.mcs.pre.vo.MmResultTablePageReqVO; |
潘 |
10 |
import org.apache.commons.lang3.StringUtils; |
5c6007
|
11 |
import org.springframework.beans.factory.annotation.Autowired; |
7fd198
|
12 |
import org.springframework.stereotype.Service; |
潘 |
13 |
import org.springframework.transaction.annotation.Transactional; |
|
14 |
|
5c6007
|
15 |
import java.util.*; |
L |
16 |
|
|
17 |
; |
7fd198
|
18 |
|
潘 |
19 |
/** |
|
20 |
* @author PanZhibao |
|
21 |
* @date 2021年04月23日 16:28 |
|
22 |
*/ |
5c6007
|
23 |
@Service |
L |
24 |
public class MmResultTableServiceImpl extends ServiceImpl<MmResultTableDao, MmResultTableEntity> implements MmResultTableService { |
|
25 |
@Autowired |
|
26 |
private MmResultTableDao mmResultTableDao; |
|
27 |
|
7fd198
|
28 |
@Override |
潘 |
29 |
public PageResult<MmResultTableEntity> page(MmResultTablePageReqVO reqVO) { |
5c6007
|
30 |
return mmResultTableDao.selectPage(reqVO); |
7fd198
|
31 |
} |
潘 |
32 |
|
|
33 |
@Override |
5c6007
|
34 |
public MmResultTableEntity info(String id) { |
L |
35 |
return mmResultTableDao.selectById(id); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
public List<MmResultTableEntity> list(Map<String, Object> params) { |
48c57b
|
40 |
return mmResultTableDao.selectList(new QueryWrapper<>()); |
5c6007
|
41 |
} |
L |
42 |
|
|
43 |
@Override |
7fd198
|
44 |
public void saveResultTable(MmResultTableEntity resultTable) { |
潘 |
45 |
resultTable.setId(UUID.randomUUID().toString()); |
5c6007
|
46 |
mmResultTableDao.insert(resultTable); |
7fd198
|
47 |
} |
潘 |
48 |
|
|
49 |
@Override |
|
50 |
public void update(MmResultTableEntity resultTable) { |
5c6007
|
51 |
mmResultTableDao.updateById(resultTable); |
7fd198
|
52 |
} |
潘 |
53 |
|
|
54 |
@Override |
|
55 |
public void deleteBatch(String[] resultTableIds) { |
5c6007
|
56 |
mmResultTableDao.deleteBatchIds(Arrays.asList(resultTableIds)); |
7fd198
|
57 |
} |
潘 |
58 |
|
|
59 |
@Override |
|
60 |
public int check(MmResultTableEntity resultTable) { |
|
61 |
String id = resultTable.getId(); |
|
62 |
String tablename = resultTable.getTablename(); |
|
63 |
QueryWrapper<MmResultTableEntity> queryWrapper = new QueryWrapper<>(); |
|
64 |
queryWrapper.ne(StringUtils.isNotBlank(id), "id", id); |
|
65 |
queryWrapper.and(wrapper -> wrapper.eq("tablename",tablename)); |
|
66 |
|
5c6007
|
67 |
List<MmResultTableEntity> list = mmResultTableDao.selectList(queryWrapper); |
7fd198
|
68 |
return list.size(); |
潘 |
69 |
} |
|
70 |
} |