chenhj
8 小时以前 455b965c6435b5359bb5c25f2b6810dbc06f5481
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
package com.ruoyi.procurementrecord.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.procurementrecord.mapper.GasTankWarningMapper;
import com.ruoyi.procurementrecord.pojo.GasTankWarning;
import com.ruoyi.procurementrecord.service.GasTankWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
@Service
public class GasTankWarningServiceImpl extends ServiceImpl<GasTankWarningMapper, GasTankWarning> implements GasTankWarningService {
    @Autowired
    private GasTankWarningMapper gasTankWarningMapper;
    @Override
    public IPage listPage(Page page, GasTankWarning gasTankWarning) {
        return gasTankWarningMapper.listPage(page,gasTankWarning);
    }
 
    @Override
    public void export(HttpServletResponse response, List<Long> ids) {
        LambdaQueryWrapper<GasTankWarning> objectLambdaQueryWrapper = new LambdaQueryWrapper<GasTankWarning>();
        if (CollectionUtils.isNotEmpty(ids)) {
            objectLambdaQueryWrapper.in(GasTankWarning::getId, ids);
        }
        List<GasTankWarning> list = gasTankWarningMapper.selectList(objectLambdaQueryWrapper);
        ExcelUtil<GasTankWarning> util = new ExcelUtil<>(GasTankWarning.class);
        util.exportExcel(response, list, "储气罐预警.xlsx");
    }
}