CompanyU8Service.java
2 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
44
45
package com.huaheng.pc.config.company.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.company.domain.CompanyU8;
import com.huaheng.pc.config.company.mapper.CompanyU8Mapper;
import org.springframework.stereotype.Service;
/**
* CompanyWuService
*/
@Service
public class CompanyU8Service extends ServiceImpl<CompanyU8Mapper, CompanyU8>{
public CompanyU8 getByCode(CompanyU8 companyU8){
LambdaQueryWrapper<CompanyU8> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(companyU8.getCompanyCode()),CompanyU8::getCompanyCode, companyU8.getCompanyCode());
lambdaQueryWrapper.like(StringUtils.isNotEmpty(companyU8.getUCompanyCode()),CompanyU8::getUCompanyCode, companyU8.getUCompanyCode());
lambdaQueryWrapper.last("limit 1");
return this.getOne(lambdaQueryWrapper);
}
public CompanyU8 getCompanyByU8CodeWarehouseCode(String u8Code,String warehouse){
LambdaQueryWrapper<CompanyU8> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(CompanyU8::getUCompanyCode,u8Code)
.eq(CompanyU8::getWarehouseCode,warehouse);
queryWrapper.last("limit 1");
CompanyU8 companyU8 = this.getOne(queryWrapper);
return companyU8;
}
public CompanyU8 getCompanyByU8CodeWarehouseCode(String u8Code){
return getCompanyByU8CodeWarehouseCode(u8Code, "CS0001");
}
public CompanyU8 getCompanyByU8CodeWarehouseCodeV(String u8Code,String warehouseCode){
return getCompanyByU8CodeWarehouseCode(u8Code, warehouseCode);
}
public CompanyU8 getCompanyU8ByCode(String code, String warehouCode) {
return this.getOne(new LambdaQueryWrapper<CompanyU8>()
.eq(CompanyU8::getCompanyCode,code)
.eq(CompanyU8::getWarehouseCode,warehouCode));
}
}