前台
export function fetchList(query?: Object) {
return request({
url: '/bs/bsCompanyFinancial/page',
method: 'get',
params: query
})
}
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
})
后台
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('bs_bsCompanyFinancial_view')" )
public R getBsCompanyFinancialPage(@ParameterObject Page page, @ParameterObject BsCompanyFinancialEntity bsCompanyFinancial , @RequestParam Map map) {
LambdaQueryWrapper<BsCompanyFinancialEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(StrUtil.isNotBlank(bsCompanyFinancial.getCompanyName()),BsCompanyFinancialEntity::getCompanyName,bsCompanyFinancial.getCompanyName());
wrapper.eq(StrUtil.isNotBlank(bsCompanyFinancial.getReportType()),BsCompanyFinancialEntity::getReportType,bsCompanyFinancial.getReportType());
wrapper.eq(Objects.nonNull(bsCompanyFinancial.getStatusValue()),BsCompanyFinancialEntity::getStatusValue,bsCompanyFinancial.getStatusValue());
wrapper.eq(StrUtil.isNotBlank(bsCompanyFinancial.getYears()),BsCompanyFinancialEntity::getYears,bsCompanyFinancial.getYears());
if(map.get("quarter") != null){
wrapper.apply("JSON_CONTAINS( quarters , '\"" + map.get("quarter") + "\"')");
}
wrapper.orderByDesc(BsCompanyFinancialEntity::getCreateTime);
return R.ok(bsCompanyFinancialService.page(page, wrapper));
}
标签:分页,get,对象,bsCompanyFinancial,BsCompanyFinancialEntity,wrapper,eq,page
From: https://www.cnblogs.com/linhan8888/p/17932131.html