|
|
@ -1011,24 +1011,6 @@ |
|
|
|
LIMIT 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--开通社区数统计--> |
|
|
|
<select id="getUsingCommunityStats" resultType="java.lang.Integer"> |
|
|
|
select count(1) |
|
|
|
from (select ca.ID |
|
|
|
, ca.ORGANIZATION_NAME |
|
|
|
, count(csa.ID) community_count |
|
|
|
from customer_agency ca |
|
|
|
inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0) |
|
|
|
where ca.DEL_FLAG = 0 |
|
|
|
and ca.LEVEL = 'community' |
|
|
|
<if test="endDate != null"> |
|
|
|
and csa.CREATED_TIME <![CDATA[<]]> #{endDate} |
|
|
|
</if> |
|
|
|
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%')) |
|
|
|
group by ca.ID, ca.ORGANIZATION_NAME |
|
|
|
having community_count > 0) t |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getCommunitysByOrgIdPath" resultType="string"> |
|
|
|
select ca.ID |
|
|
|
from customer_agency ca |
|
|
@ -1038,4 +1020,21 @@ |
|
|
|
and (ca.ID = #{orgId} or ca.PIDS like CONCAT(#{orgIdPath},'%')) |
|
|
|
order by ca.CREATED_TIME asc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--开通社区列表--> |
|
|
|
<select id="getUsingCommunityList" resultType="string"> |
|
|
|
select ca.ID |
|
|
|
, ca.ORGANIZATION_NAME |
|
|
|
, count(csa.ID) community_count |
|
|
|
from customer_agency ca |
|
|
|
inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0) |
|
|
|
where ca.DEL_FLAG = 0 |
|
|
|
and ca.LEVEL = 'community' |
|
|
|
<if test="endDate != null"> |
|
|
|
and csa.CREATED_TIME <![CDATA[<]]> #{endDate} |
|
|
|
</if> |
|
|
|
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%')) |
|
|
|
group by ca.ID, ca.ORGANIZATION_NAME |
|
|
|
having community_count > 0 |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|