KuaidiWeightServiceImpl.java
1.26 KB
package com.huaheng.pc.config.weight.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.pc.config.weight.domain.KuaidiWeight;
import com.huaheng.pc.config.weight.mapper.KuaidiWeightMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @ClassName KuaidiWeightServiceImpl
* @Description TODO
* @Author Administrator
* @Date 2020/12/716:45
*/
@Service
public class KuaidiWeightServiceImpl implements KuaidiWeightService {
@Autowired
KuaidiWeightMapper mapper;
@Override
public int insertWeight(KuaidiWeight kuaidiWeight) {
return mapper.insert(kuaidiWeight);
}
@Override
public KuaidiWeight selectEntity(KuaidiWeight kuaidiWeight) {
return mapper.selectOne(new LambdaQueryWrapper<KuaidiWeight>()
.eq((StringUtils.isNotNull(kuaidiWeight.getId())),KuaidiWeight::getId,kuaidiWeight.getId())
.eq((StringUtils.isNotEmpty(kuaidiWeight.getTrackCode())),KuaidiWeight::getTrackCode,kuaidiWeight.getTrackCode())
.eq((StringUtils.isNotEmpty(kuaidiWeight.getWeight())),KuaidiWeight::getWeight,kuaidiWeight.getWeight())
);
}
}