liusheng
2023-11-08 dc0ce40d1ae331a054017ae322da930f07094f52
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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;
    }
 
}