KuaidiWeightServiceImpl.java
1.6 KB
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
package com.huaheng.pc.config.weight.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.pc.config.wcsscanbarcode.domain.Wcsscanbarcode;
import com.huaheng.pc.config.wcsscanbarcode.mapper.WcsscanbarcodeMapper;
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 extends ServiceImpl<KuaidiWeightMapper, KuaidiWeight> implements KuaidiWeightService {
@Override
public int insertWeight(KuaidiWeight kuaidiWeight) {
boolean tag=this.save(kuaidiWeight);
if(tag){
return 0;
}
return 1;
}
@Override
public KuaidiWeight selectEntity(KuaidiWeight kuaidiWeight) {
return this.getOne(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())
.last("limit 1"));
}
}