|
|
|
@ -1011,10 +1011,19 @@ |
|
|
|
LIMIT 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--开通社区数统计--> |
|
|
|
<select id="getUsingCommunityStats" resultType="java.lang.Integer"> |
|
|
|
select count(1) |
|
|
|
from (select ca.ID |
|
|
|
<select id="getCommunitysByOrgIdPath" resultType="string"> |
|
|
|
select ca.ID |
|
|
|
from customer_agency ca |
|
|
|
where ca.CUSTOMER_ID=#{customerId} |
|
|
|
and ca.LEVEL = 'community' |
|
|
|
and ca.DEL_FLAG = 0 |
|
|
|
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 |
|
|
|
@ -1026,16 +1035,6 @@ |
|
|
|
</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 |
|
|
|
where ca.CUSTOMER_ID=#{customerId} |
|
|
|
and ca.LEVEL = 'community' |
|
|
|
and ca.DEL_FLAG = 0 |
|
|
|
and (ca.ID = #{orgId} or ca.PIDS like CONCAT(#{orgIdPath},'%')) |
|
|
|
order by ca.CREATED_TIME asc |
|
|
|
having community_count > 0 |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|
|