|
|
@ -52,22 +52,32 @@
|
|
|
|
<select id="selectBPlanEnterPriseTreeRequestRequestList"
|
|
|
|
<select id="selectBPlanEnterPriseTreeRequestRequestList"
|
|
|
|
resultType="com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse">
|
|
|
|
resultType="com.ruoyi.programManagement.entity.request.BPlanEnterPriseTreeResponse">
|
|
|
|
|
|
|
|
|
|
|
|
SELECT a.subdistrict AS subdistrict,a.county,c.id,a.institution_name as institutionName,
|
|
|
|
-- SELECT a.subdistrict AS subdistrict,a.county,c.id,a.institution_name as institutionName,
|
|
|
|
COUNT(b.subdistrict) AS enterpriseCount,
|
|
|
|
-- COUNT(b.subdistrict) AS enterpriseCount,
|
|
|
|
COUNT(DISTINCT k.ent_code) - COUNT(DISTINCT c.enterprise_id) AS remainingKeyEnterpriseCount,
|
|
|
|
-- COUNT(DISTINCT k.ent_code) - COUNT(DISTINCT c.enterprise_id) AS remainingKeyEnterpriseCount,
|
|
|
|
COUNT(DISTINCT c.enterprise_id) AS plannedEnterpriseCount,
|
|
|
|
-- COUNT(DISTINCT c.enterprise_id) AS plannedEnterpriseCount,
|
|
|
|
COUNT(DISTINCT CASE WHEN k.ent_code IS NOT NULL THEN c.enterprise_id END) AS planneKeyEnterpriseCount
|
|
|
|
-- COUNT(DISTINCT CASE WHEN k.ent_code IS NOT NULL THEN c.enterprise_id END) AS planneKeyEnterpriseCount
|
|
|
|
FROM b_administrative a
|
|
|
|
-- FROM b_administrative a
|
|
|
|
LEFT JOIN sz_ent_basic_info b ON a.subdistrict = LPAD(b.subdistrict, LENGTH(a.subdistrict), '0')
|
|
|
|
-- LEFT JOIN sz_ent_basic_info b ON a.subdistrict = LPAD(b.subdistrict, LENGTH(a.subdistrict), '0')
|
|
|
|
LEFT JOIN b_key_enterprise k ON a.subdistrict = k.district
|
|
|
|
-- LEFT JOIN b_key_enterprise k ON a.subdistrict = k.district
|
|
|
|
LEFT JOIN b_plan_enterprise c ON k.ent_code = c.enterprise_id
|
|
|
|
-- LEFT JOIN b_plan_enterprise c ON k.ent_code = c.enterprise_id
|
|
|
|
WHERE a.SUBDISTRICT LIKE '%13205%'
|
|
|
|
-- WHERE a.SUBDISTRICT LIKE '%13205%'
|
|
|
|
|
|
|
|
select s.institutionName ,s.plannedEnterpriseCount,s.checkEnterpriseCount,s.pt from (SELECT
|
|
|
|
|
|
|
|
a. institution_name AS institutionName,
|
|
|
|
|
|
|
|
COUNT(DISTINCT b.enterprise_id) AS plannedEnterpriseCount,
|
|
|
|
|
|
|
|
COUNT(DISTINCT c.USC_CODE) AS checkEnterpriseCount,
|
|
|
|
|
|
|
|
COUNT(DISTINCT c.USC_CODE) / COUNT(DISTINCT b.enterprise_id) AS pt
|
|
|
|
|
|
|
|
FROM
|
|
|
|
|
|
|
|
b_administrative a
|
|
|
|
|
|
|
|
LEFT JOIN b_plan_enterprise b ON SUBSTRING(a.county, 1, 8) = SUBSTRING(b.district, 1, 8)
|
|
|
|
|
|
|
|
LEFT JOIN sz_enfor_examine c ON b.enterprise_id = c.USC_CODE
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="req.plannedYear!=null and req.plannedYear!=''">
|
|
|
|
<if test="req.plannedYear!=null and req.plannedYear!=''">
|
|
|
|
c.planned_year#{req.plannedYear}
|
|
|
|
b.planned_year#{req.plannedYear}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
GROUP BY a.subdistrict,a.county;
|
|
|
|
GROUP BY SUBSTRING(a.county, 1, 8) )s
|
|
|
|
|
|
|
|
where s. institutionName!='苏州市'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|