Explorar o código

企业列表接口—查询企业服务商配置sql重写子查询

ZhangWenQiang %!s(int64=3) %!d(string=hai) anos
pai
achega
aaf4df51ae

+ 1 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/mapper/xml/HlwCompanyMapper.xml

@@ -181,7 +181,7 @@
 		count(hp.id) as "countPayment",
 		count(hcsc.id) as "countSubContract",
 		count(hccc.id) as "countCpContract",
-		case when count(hcs.id) > 0 then 2 else 1 end as "companySettingStatus"
+		case when (select count(hcs2.id) from hlw_company_subcontractor hcs2 where hcs2.company_id = a.id) > 0 then 2 else 1 end as "companySettingStatus"
 		FROM hlw_company a
 		left join hlw_payment hp on hp.company_id=a.id and hp.status=3
 		left join hlw_company_subcontractor hcs on hp.company_id=hcs.company_id and hcs.subcontractor_id=hp.subcontractor_id and hp.is_through_platform=0