whyclxw
2024-01-12 fde6f36bcbeca3b02ed958a369f37069675a6eae
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
40
41
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.whyc.dto.Response;
import com.whyc.mapper.SOPFileTypeMapper;
import com.whyc.pojo.SOPFileType;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
@Service
public class SOPFileTypeService {
 
    @Resource
    private SOPFileTypeMapper mapper;
 
 
    public List<SOPFileType> getAllInDB(List<SOPFileType> typeList) {
        return mapper.getAllInDB(typeList);
    }
 
    public void addBatch(List<SOPFileType> newRecordList) {
        mapper.insertBatchSomeColumn(newRecordList);
    }
 
    public Response getType1List() {
        QueryWrapper<SOPFileType> query = Wrappers.query();
        query.select(" distinct type1");
        List<SOPFileType> sopFileTypes = mapper.selectList(query);
        return new Response().set(1,sopFileTypes);
    }
 
    public Response getType2List(String type1) {
        QueryWrapper<SOPFileType> query = Wrappers.query();
        query.select("type2").eq("type1",type1);
        List<SOPFileType> sopFileTypes = mapper.selectList(query);
        return new Response().set(1,sopFileTypes);
    }
}