李林
2023-07-20 232fd37c627f703d3908dc1bdf8225defe4efd7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.yuanchu.limslaboratory.service.impl;
 
import com.yuanchu.limslaboratory.pojo.Inspection;
import com.yuanchu.limslaboratory.mapper.InspectionMapper;
import com.yuanchu.limslaboratory.pojo.dto.InspectionDto;
import com.yuanchu.limslaboratory.service.InspectionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
 
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2023-07-17
 */
@Service
public class InspectionServiceImpl extends ServiceImpl<InspectionMapper, Inspection> implements InspectionService {
 
    @Resource
    private InspectionMapper inspectionMapper;
 
    @Override
    public Inspection addInspection(String userName,int type) {
        Inspection inspection = new Inspection(type, 0,1,1, userName);
        int judge = inspectionMapper.insert(inspection);
        return judge>0?inspection:null;
    }
 
    @Override
    public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) {
        return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state);
    }
}