This commit is contained in:
mash 2024-11-13 13:36:48 +08:00
parent 3a57956696
commit b17e8991e2
2 changed files with 33 additions and 11 deletions

View File

@ -89,8 +89,8 @@ public class Organization extends BaseEntity{
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date lastTime;
@ApiModelProperty(value = "修改人")
@ApiModelProperty(value = "招聘名额")
@TableField(exist = false)
private String updatedName;
private Long sum;
}

View File

@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.ydool.common.cache.ConfigCache;
import com.ydool.common.constant.ArgsConst;
import com.ydool.common.data.dto.AjaxResult;
@ -66,20 +67,41 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Override
public AjaxResult selectOrganizationList(Page<Organization> page, OrganizationSearch organizationSearch) {
LambdaQueryWrapper<Organization> organizationLambdaQueryWrapper = new LambdaQueryWrapper<>();
organizationLambdaQueryWrapper.exists(StrUtil.isNotBlank(organizationSearch.getCompanyName()), "select t2.id from t_lc_company_name t2 where t_lc_organization.company_id = t2.id and t2.company_name like '%" + organizationSearch.getCompanyName() + "%'");
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(organizationSearch.getApprovalNumber()), Organization::getApprovalNumber, organizationSearch.getApprovalNumber());
organizationLambdaQueryWrapper.eq(StrUtil.isNotBlank(organizationSearch.getDocumentStatus()), Organization::getDocumentStatus, organizationSearch.getDocumentStatus());
organizationLambdaQueryWrapper.ge(StrUtil.isNotBlank(organizationSearch.getCreatedAt()), Organization::getCreatedAt, organizationSearch.getCreatedAt());
organizationLambdaQueryWrapper.le(StrUtil.isNotBlank(organizationSearch.getUpdatedAt()), Organization::getUpdatedAt, organizationSearch.getUpdatedAt());
organizationLambdaQueryWrapper.eq(Organization::getType, organizationSearch.getType());
organizationLambdaQueryWrapper.orderByDesc(Organization::getCreatedAt);
Page<Organization> selectPage = organizationMapper.selectPage(page, organizationLambdaQueryWrapper);
MPJLambdaWrapper<Organization> wrapper = new MPJLambdaWrapper<>();
wrapper.select(Organization::getId);
wrapper.select(Organization::getCompanyId);
wrapper.select(Organization::getApprovalNumber);
wrapper.select(Organization::getDocumentStatus);
wrapper.select(Organization::getActiveStaff);
wrapper.select(Organization::getResidualNumber);
wrapper.select(Organization::getAuditState);
wrapper.select(Organization::getThisApprovalNumber);
wrapper.select(Organization::getLastTime);
wrapper.select(Organization::getLastInstance);
wrapper.select(Organization::getUpdatedId);
wrapper.select(Organization::getUpdatedAt);
wrapper.select(Organization::getCreatedAt);
wrapper.select(CompanyName::getCheckNumber);
wrapper.select(Places::getSum);
wrapper.leftJoin(CompanyName.class, CompanyName::getId, Organization::getCompanyId);
wrapper.leftJoin(Places.class, Places::getOrganizationId, Organization::getId);
wrapper.eq(StrUtil.isNotBlank(organizationSearch.getApprovalNumber()), Organization::getApprovalNumber, organizationSearch.getApprovalNumber());
wrapper.eq(StrUtil.isNotBlank(organizationSearch.getDocumentStatus()), Organization::getDocumentStatus, organizationSearch.getDocumentStatus());
wrapper.ge(StrUtil.isNotBlank(organizationSearch.getCreatedAt()), Organization::getCreatedAt, organizationSearch.getCreatedAt());
wrapper.le(StrUtil.isNotBlank(organizationSearch.getUpdatedAt()), Organization::getUpdatedAt, organizationSearch.getUpdatedAt());
wrapper.like(StrUtil.isNotBlank(organizationSearch.getCompanyName()), CompanyName::getCompanyName, organizationSearch.getCompanyName());
wrapper.eq(Organization::getType, organizationSearch.getType());
wrapper.orderByDesc(Organization::getCreatedAt);
Page<Organization> selectPage = organizationMapper.selectPage(page, wrapper);
for (Organization record : selectPage.getRecords()) {
CompanyName companyName = companyNameMapper.selectById(record.getCompanyId());
if (ObjectUtil.isNotNull(companyName)) {
record.setCompanyId(companyName.getCompanyName());
}
User user = userMapper.selectById(record.getUpdatedId());
if (ObjectUtil.isNotNull(user)) {
record.setLastId(user.getUserName());
}
}
return AjaxResult.ok().data(selectPage);
}