Pu Zhibing
7 天以前 6e0bccef16f74b5aa80eb51d7792a36ed7e20c38
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
package com.stylefeng.guns.modular.system.service.impl;
 
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.SystemPriceCityMapper;
import com.stylefeng.guns.modular.system.model.SystemPriceCity;
import com.stylefeng.guns.modular.system.service.ISystemPriceCityService;
import org.springframework.stereotype.Service;
 
/**
 * @author zhibing.pu
 * @Date 2025/7/26 9:25
 */
@Service
public class SystemPriceCityServiceImpl extends ServiceImpl<SystemPriceCityMapper, SystemPriceCity> implements ISystemPriceCityService {
    
    
    /**
     * 查询匹配数据
     * @param provinceCode
     * @param cityCode
     * @param districtCode
     * @return
     */
    @Override
    public SystemPriceCity queryOne(String provinceCode, String cityCode, String districtCode) {
        SystemPriceCity systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode).eq("cityCode", cityCode).eq("provinceCode", districtCode));
        if(null == systemPriceCity){
            systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode).eq("cityCode", cityCode));
            if(null == systemPriceCity){
                systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode));
            }
        }
        return systemPriceCity;
    }}