|
@ -899,6 +899,16 @@ |
|
|
|
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="communityCount" resultType="java.lang.Integer"> |
|
|
|
|
|
|
|
|
|
|
|
select count(1) |
|
|
|
|
|
from customer_agency agency |
|
|
|
|
|
where agency.DEL_FLAG = 0 |
|
|
|
|
|
and agency.LEVEL = 'community' |
|
|
|
|
|
and agency.PIDS like concat(#{pids},'%') |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="agencyGridCount" resultType="java.lang.Integer"> |
|
|
<select id="agencyGridCount" resultType="java.lang.Integer"> |
|
|
|
|
|
|
|
|
select count(*) |
|
|
select count(*) |
|
@ -1112,21 +1122,21 @@ |
|
|
select t.ID |
|
|
select t.ID |
|
|
from (select ca.ID |
|
|
from (select ca.ID |
|
|
, ca.CREATED_TIME created_time |
|
|
, ca.CREATED_TIME created_time |
|
|
, count(csa.ID) community_count |
|
|
, count(ca.ID) community_count |
|
|
from customer_agency ca |
|
|
from customer_agency ca |
|
|
inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0) |
|
|
<!--inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0)--> |
|
|
where ca.DEL_FLAG = 0 |
|
|
where ca.DEL_FLAG = 0 |
|
|
and ca.CUSTOMER_ID=#{customerId} |
|
|
and ca.CUSTOMER_ID=#{customerId} |
|
|
and ca.LEVEL = 'community' |
|
|
and ca.LEVEL = 'community' |
|
|
<if test="endDate != null"> |
|
|
<if test="endDate != null"> |
|
|
and csa.CREATED_TIME <![CDATA[<]]> #{endDate} |
|
|
and ca.CREATED_TIME <![CDATA[<]]> #{endDate} |
|
|
</if> |
|
|
</if> |
|
|
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%')) |
|
|
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%')) |
|
|
group by ca.ID, ca.CREATED_TIME |
|
|
group by ca.ID, ca.CREATED_TIME |
|
|
having community_count > 0 |
|
|
having community_count > 0 |
|
|
order by created_time desc) t |
|
|
order by created_time desc) t |
|
|
</select> |
|
|
</select> |
|
|
<select id="getCurrentUserCommunityInfo" |
|
|
<select id="getCurrentUserCommunityInfo" |
|
|
resultType="com.epmet.dto.result.CurrentUserCommunityInfoResultDTO"> |
|
|
resultType="com.epmet.dto.result.CurrentUserCommunityInfoResultDTO"> |
|
|
select |
|
|
select |
|
|
ID AS orgId, |
|
|
ID AS orgId, |
|
@ -1140,9 +1150,9 @@ |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectAgencyTree" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO"> |
|
|
<select id="selectAgencyTree" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
ca.ID as id, |
|
|
ca.ID as id, |
|
|
ca.ORGANIZATION_NAME as label, |
|
|
ca.ORGANIZATION_NAME as label, |
|
@ -1156,9 +1166,9 @@ |
|
|
WHERE |
|
|
WHERE |
|
|
ca.ID = #{agencyId} |
|
|
ca.ID = #{agencyId} |
|
|
AND ca.DEL_FLAG = '0' |
|
|
AND ca.DEL_FLAG = '0' |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectNextOrg" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO"> |
|
|
<select id="selectNextOrg" parameterType="java.lang.String" resultType="com.epmet.dto.BuildingTreeLevelDTO"> |
|
|
(SELECT ca.ID as id, |
|
|
(SELECT ca.ID as id, |
|
|
ca.ORGANIZATION_NAME as label, |
|
|
ca.ORGANIZATION_NAME as label, |
|
|
ca.LONGITUDE as longitude, |
|
|
ca.LONGITUDE as longitude, |
|
@ -1182,9 +1192,9 @@ |
|
|
WHERE cg.DEL_FLAG = '0' |
|
|
WHERE cg.DEL_FLAG = '0' |
|
|
AND cg.PID = #{agencyId} |
|
|
AND cg.PID = #{agencyId} |
|
|
ORDER BY cg.sort, CAST(cg.GRID_NAME AS SIGNED), CONVERT(cg.GRID_NAME using gbk)) |
|
|
ORDER BY cg.sort, CAST(cg.GRID_NAME AS SIGNED), CONVERT(cg.GRID_NAME using gbk)) |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectTotalNext" parameterType="java.lang.String" resultType="java.lang.Integer"> |
|
|
<select id="selectTotalNext" parameterType="java.lang.String" resultType="java.lang.Integer"> |
|
|
SELECT |
|
|
SELECT |
|
|
sum( t.total ) |
|
|
sum( t.total ) |
|
|
FROM |
|
|
FROM |
|
@ -1205,9 +1215,9 @@ |
|
|
g.PID = #{agencyId} |
|
|
g.PID = #{agencyId} |
|
|
AND g.DEL_FLAG = '0' |
|
|
AND g.DEL_FLAG = '0' |
|
|
) t |
|
|
) t |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName --> |
|
|
<!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName --> |
|
|
<select id="getAllCommunity" parameterType="java.lang.String" resultType="com.epmet.dto.result.AgencyResultDTO"> |
|
|
<select id="getAllCommunity" parameterType="java.lang.String" resultType="com.epmet.dto.result.AgencyResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
ca.id agencyId, |
|
|
ca.id agencyId, |
|
|