Commit 8e683c89 authored by hongguangwu's avatar hongguangwu

项目分页接口,添加客户id查询;

parent c143ecbe
......@@ -125,8 +125,9 @@ public class TEmpChangeInfoController {
*/
@Operation(description = "分页查询")
@GetMapping("/getAllDeptPage" )
public R<IPage<TSettleDomain>> getItemNamePage(Page page,String departName) {
return new R<>(tEmpChangeInfoService.getAllDeptPage(page, departName));
public R<IPage<TSettleDomain>> getItemNamePage(Page page,@RequestParam(required = false) String departName
, @RequestParam(required = false) String customerId) {
return new R<>(tEmpChangeInfoService.getAllDeptPage(page, departName, customerId));
}
/**
......
......@@ -68,5 +68,5 @@ public interface TEmpChangeInfoService extends IService<TEmpChangeInfo> {
*/
R<List<TCustomerInfo>> getAllUint();
IPage<TSettleDomain> getAllDeptPage(Page page, String deptName);
IPage<TSettleDomain> getAllDeptPage(Page page, String deptName, String customerId);
}
......@@ -304,16 +304,19 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
* @Date 2022-07-26
*/
@Override
public IPage<TSettleDomain> getAllDeptPage(Page page, String deptName) {
LambdaQueryWrapper<TSettleDomain> wrapper = buildQueryWrapper(deptName);
public IPage<TSettleDomain> getAllDeptPage(Page page, String deptName, String customerId) {
LambdaQueryWrapper<TSettleDomain> wrapper = buildQueryWrapper(deptName, customerId);
return tSettleDomainMapper.selectPage(page,wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(String deptName) {
private LambdaQueryWrapper buildQueryWrapper(String deptName, String customerId) {
LambdaQueryWrapper<TSettleDomain> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(deptName)) {
wrapper.like(TSettleDomain::getDepartName, deptName);
}
if (Common.isNotNull(customerId)) {
wrapper.eq(TSettleDomain::getCustomerId, customerId);
}
wrapper.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING);
wrapper.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING);
return wrapper;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment