Commit 05fd3c8c by 太阳与水

更改员工搜索为实川的员工搜索接口

parent 5241accb
......@@ -271,25 +271,34 @@ public class YgglController {
@ApiOperation(value = "员工搜索/分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 52)
public Result<Object> ygquery(@CurrentUser UserBean userBean, @RequestBody YgQueryDto ygQueryDto) {
Integer orgCode = userBean.getOrgCode();
Integer b = ygQueryDto.getBmgwid();
ArrayList<Integer> bList = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
ZzglBmgwM.getDepts(bList, b, zzglBmgwMs);
Integer j = ygQueryDto.getJobStatus();
Integer t = ygQueryDto.getJobType();
String q = ygQueryDto.getQuery();
Page<YgglMainEmp> page = new Page<YgglMainEmp>(
ygQueryDto.getCurrentPage() == null ? 1 : ygQueryDto.getCurrentPage(),
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", userBean.getOrgCode()).eq(t != null && t > -1, "job_type", t)
.eq(b != null && b > -1, "bmgw_id", b).eq(j != null && j > -1, "job_status", j)
.and(!StrUtil.hasBlank(q), wq -> wq.likeRight("name", q).or().likeRight("phone", q));
queryWrapper.
select("name","emp_num","bmgw_id","rz_time","job_type","phone","job_status")
.eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
.eq(j != null && j > -1, "job_status", j).in(!bList.isEmpty(), "id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q));
// List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper);
IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
// List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
ygglMainEmpPage.getCurrent();
ygglMainEmpPage.getPages();
ygglMainEmpPage.getTotal();
ygglMainEmpPage.getSize();
return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
return ResultUtil.data(ygglMainEmpPage, "员工搜索成功");
// return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
}
......
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