gunshi-project-ss/src/main/java/com/gunshi/project/xyt/service/OsmoticWarnRuleService.java

40 lines
1.6 KiB
Java
Raw Normal View History

2024-07-08 17:47:02 +08:00
package com.gunshi.project.xyt.service;
2024-07-09 14:54:21 +08:00
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
2024-07-08 17:47:02 +08:00
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
2024-07-09 14:54:21 +08:00
import com.gunshi.project.xyt.entity.so.WarnRulePageSo;
2024-07-08 17:47:02 +08:00
import com.gunshi.project.xyt.mapper.OsmoticWarnRuleMapper;
import com.gunshi.project.xyt.model.OsmoticWarnRule;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* :
* author: xusan
* date: 2024-07-08 17:30:37
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class OsmoticWarnRuleService extends ServiceImpl<OsmoticWarnRuleMapper, OsmoticWarnRule>
{
2024-07-09 14:54:21 +08:00
public Page<OsmoticWarnRule> queryPage(WarnRulePageSo warnRulePageSo) {
LambdaQueryWrapper<OsmoticWarnRule> queryWrapper = Wrappers.lambdaQuery();
if(warnRulePageSo.getType() != null){
queryWrapper.eq(OsmoticWarnRule::getType,warnRulePageSo.getType());
}
if(StringUtils.isNotEmpty(warnRulePageSo.getStationCode())){
queryWrapper.like(OsmoticWarnRule::getStationCode,warnRulePageSo.getStationCode());
}
queryWrapper.orderByDesc(OsmoticWarnRule::getStatus).orderByDesc(OsmoticWarnRule::getCreateTime);
2024-07-09 14:54:21 +08:00
return this.page(warnRulePageSo.getPageSo().toPage(),queryWrapper);
}
2024-07-08 17:47:02 +08:00
}