43 lines
1.4 KiB
Java
43 lines
1.4 KiB
Java
|
|
package com.gunshi.project.ss.service;
|
||
|
|
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||
|
|
import com.gunshi.project.ss.common.model.so.JcskByBDPageSo;
|
||
|
|
import com.gunshi.project.ss.mapper.JcskByBDMapper;
|
||
|
|
import com.gunshi.project.ss.common.model.JcskByBD;
|
||
|
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
import org.springframework.transaction.annotation.Transactional;
|
||
|
|
|
||
|
|
import java.util.Date;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
@Slf4j
|
||
|
|
@Transactional(rollbackFor = Exception.class)
|
||
|
|
public class JcskByBDService extends ServiceImpl<JcskByBDMapper, JcskByBD> {
|
||
|
|
|
||
|
|
public Page<JcskByBD> pageQuery(JcskByBDPageSo page) {
|
||
|
|
LambdaQueryWrapper<JcskByBD> queryWrapper = new LambdaQueryWrapper<>();
|
||
|
|
if(page.getDeviceId() != null){
|
||
|
|
queryWrapper.eq(JcskByBD::getDeviceId, page.getDeviceId());
|
||
|
|
}
|
||
|
|
if(page.getOrder() != null){
|
||
|
|
queryWrapper.eq(JcskByBD::getOrder, page.getOrder());
|
||
|
|
}
|
||
|
|
Page<JcskByBD> jcskByBDPage = this.baseMapper.selectPage(page.getPageSo().toPage(), queryWrapper);
|
||
|
|
return jcskByBDPage;
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<String> listDevices() {
|
||
|
|
|
||
|
|
return this.baseMapper.listDevices();
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<JcskByBD> listAll(Date date) {
|
||
|
|
return this.baseMapper.listAll(date);
|
||
|
|
}
|
||
|
|
}
|