新增状态查询
parent
9a05a1265a
commit
c7b4cf0346
|
@ -42,5 +42,14 @@ public class CompanyController {
|
|||
return Result.success(companyService.selectList(companyListReq));
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业审核状态
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(path = "/companystatus")
|
||||
@Operation(summary = "企业审核状态",description = "查询企业审核的全部状态")
|
||||
public Result companystatus(){
|
||||
return Result.success(companyService.selectcompanystatus());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@ package com.muyu.cloud.background.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.cloud.background.domin.Company;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
|
@ -13,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface CompanyMapper extends BaseMapper<Company> {
|
||||
|
||||
@Select("SELECT review_status from company GROUP BY review_status")
|
||||
List<Integer> selectcompanystatus();
|
||||
}
|
||||
|
|
|
@ -23,4 +23,10 @@ public interface CompanyService extends IService<Company> {
|
|||
* @return
|
||||
*/
|
||||
CompanyListResp selectList(CompanyListReq companyListReq);
|
||||
|
||||
/**
|
||||
* 企业审核状态
|
||||
* @return
|
||||
*/
|
||||
List<Integer> selectcompanystatus();
|
||||
}
|
||||
|
|
|
@ -37,10 +37,21 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|||
Integer pageNum = companyListReq.getPageNum();
|
||||
Integer pageSize = companyListReq.getPageSize();
|
||||
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);
|
||||
queryWrapper.last("LIMIT " + ((pageNum - 1) * pageSize) + ", " + pageSize);
|
||||
List<Company> companyList = this.list(queryWrapper);
|
||||
return CompanyListResp.of(companyList, count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业审核状态
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Integer> selectcompanystatus() {
|
||||
return companyMapper.selectcompanystatus();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue