package com.ruoyi.project.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.project.domain.BaseTravelcity;
|
import com.ruoyi.project.mapper.BaseTravelcityMapper;
|
import com.ruoyi.project.service.IBaseTravelcityService;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* 差旅城市和补贴标准Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2023-04-23
|
*/
|
@Service
|
public class BaseTravelcityServiceImpl extends ServiceImpl<BaseTravelcityMapper, BaseTravelcity> implements IBaseTravelcityService
|
{
|
|
|
/**
|
* 查询差旅城市和补贴标准列表
|
*
|
* @param baseTravelcity 差旅城市和补贴标准
|
* @return 差旅城市和补贴标准
|
*/
|
@Override
|
public List<BaseTravelcity> queryList(BaseTravelcity baseTravelcity) {
|
LambdaQueryWrapper<BaseTravelcity> wrappers = Wrappers.lambdaQuery();
|
if (StringUtils.isNotBlank(baseTravelcity.getCitycode())){
|
wrappers.eq(BaseTravelcity::getCitycode ,baseTravelcity.getCitycode());
|
}
|
if (StringUtils.isNotBlank(baseTravelcity.getCityname())){
|
wrappers.like(BaseTravelcity::getCityname ,baseTravelcity.getCityname());
|
}
|
if (StringUtils.isNotBlank(baseTravelcity.getProvince())){
|
wrappers.eq(BaseTravelcity::getProvince ,baseTravelcity.getProvince());
|
}
|
if (baseTravelcity.getTransport() != null){
|
wrappers.eq(BaseTravelcity::getTransport ,baseTravelcity.getTransport());
|
}
|
if (baseTravelcity.getHotel() != null){
|
wrappers.eq(BaseTravelcity::getHotel ,baseTravelcity.getHotel());
|
}
|
if (baseTravelcity.getOthers() != null){
|
wrappers.eq(BaseTravelcity::getOthers ,baseTravelcity.getOthers());
|
}
|
if (baseTravelcity.getFood() != null){
|
wrappers.eq(BaseTravelcity::getFood ,baseTravelcity.getFood());
|
}
|
return this.list(wrappers);
|
}
|
|
@Override
|
public BaseTravelcity getSubsidy(String cityCode) {
|
LambdaQueryWrapper<BaseTravelcity> wrappers = Wrappers.lambdaQuery();
|
if (StringUtils.isNotBlank(cityCode)){
|
wrappers.eq(BaseTravelcity::getCitycode ,cityCode);
|
}
|
BaseTravelcity baseTravelcity = this.getOne(wrappers);
|
return baseTravelcity;
|
}
|
|
}
|