新增状态查询

master
WeiRan 2024-08-27 11:05:12 +08:00
parent 9a05a1265a
commit c7b4cf0346
4 changed files with 33 additions and 1 deletions

View File

@ -42,5 +42,14 @@ public class CompanyController {
return Result.success(companyService.selectList(companyListReq)); return Result.success(companyService.selectList(companyListReq));
} }
/**
*
* @return
*/
@PostMapping(path = "/companystatus")
@Operation(summary = "企业审核状态",description = "查询企业审核的全部状态")
public Result companystatus(){
return Result.success(companyService.selectcompanystatus());
}
} }

View File

@ -3,6 +3,9 @@ package com.muyu.cloud.background.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.cloud.background.domin.Company; import com.muyu.cloud.background.domin.Company;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* @Authorweiran * @Authorweiran
@ -13,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface CompanyMapper extends BaseMapper<Company> { public interface CompanyMapper extends BaseMapper<Company> {
@Select("SELECT review_status from company GROUP BY review_status")
List<Integer> selectcompanystatus();
} }

View File

@ -23,4 +23,10 @@ public interface CompanyService extends IService<Company> {
* @return * @return
*/ */
CompanyListResp selectList(CompanyListReq companyListReq); CompanyListResp selectList(CompanyListReq companyListReq);
/**
*
* @return
*/
List<Integer> selectcompanystatus();
} }

View File

@ -37,10 +37,21 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
Integer pageNum = companyListReq.getPageNum(); Integer pageNum = companyListReq.getPageNum();
Integer pageSize = companyListReq.getPageSize(); Integer pageSize = companyListReq.getPageSize();
LambdaQueryWrapper<Company> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Company> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Company::getReviewStatus,companyListReq.getReviewStatus()); if (companyListReq.getReviewStatus()!=null){
queryWrapper.eq(Company::getReviewStatus,companyListReq.getReviewStatus());
}
long count = this.count(queryWrapper); long count = this.count(queryWrapper);
queryWrapper.last("LIMIT " + ((pageNum - 1) * pageSize) + ", " + pageSize); queryWrapper.last("LIMIT " + ((pageNum - 1) * pageSize) + ", " + pageSize);
List<Company> companyList = this.list(queryWrapper); List<Company> companyList = this.list(queryWrapper);
return CompanyListResp.of(companyList, count); return CompanyListResp.of(companyList, count);
} }
/**
*
* @return
*/
@Override
public List<Integer> selectcompanystatus() {
return companyMapper.selectcompanystatus();
}
} }