Browse Source

Merge branch 'yantai_zhengwu_master' into dev

master
lichao 2 years ago
parent
commit
674fba43c7
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  2. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  3. 36
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -436,6 +436,8 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<AgencyCountCensusResultDTO> agencyCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
Integer communityCount(@Param("pids") String pids);
Integer agencyGridCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);
Integer agencyStaffCount(@Param("pids") String pids,@Param("timeStart")Date timeStart,@Param("timeEnd")Date timeEnd);

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -1147,12 +1147,15 @@ public class AgencyServiceImpl implements AgencyService {
calendar.set(Calendar.MILLISECOND, 0);
Date endTime = calendar.getTime();
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
/* AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
agencyOrgIdPath = getOrgIdPath(agencyInfo.getPids(), agencyInfo.getId());
List<String> currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null);
List<String> currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null);*/
// List<String> preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime);
// return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size());
return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), 0);
CustomerAgencyEntity customerAgency = customerAgencyDao.selectById(orgId);
String pids = PidUtils.convertPid2OrgIdPath(customerAgency.getId(),customerAgency.getPids());
return new UsingCommunityStatsResultDTO(customerAgencyDao.communityCount(pids), 0);
} else if ("grid".equals(orgType)) {
// 网格下不会有该数据,给个0
return new UsingCommunityStatsResultDTO(0, 0);

36
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -899,6 +899,16 @@
</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 count(*)
@ -1112,21 +1122,21 @@
select t.ID
from (select ca.ID
, ca.CREATED_TIME created_time
, count(csa.ID) community_count
, count(ca.ID) community_count
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
and ca.CUSTOMER_ID=#{customerId}
and ca.LEVEL = 'community'
<if test="endDate != null">
and csa.CREATED_TIME <![CDATA[<]]> #{endDate}
and ca.CREATED_TIME <![CDATA[<]]> #{endDate}
</if>
and (ca.ID = #{agencyId} or ca.PIDS like CONCAT(#{agencyOrgIdPath}, '%'))
group by ca.ID, ca.CREATED_TIME
having community_count > 0
order by created_time desc) t
</select>
<select id="getCurrentUserCommunityInfo"
</select>
<select id="getCurrentUserCommunityInfo"
resultType="com.epmet.dto.result.CurrentUserCommunityInfoResultDTO">
select
ID AS orgId,
@ -1140,9 +1150,9 @@
</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
ca.ID as id,
ca.ORGANIZATION_NAME as label,
@ -1156,9 +1166,9 @@
WHERE
ca.ID = #{agencyId}
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,
ca.ORGANIZATION_NAME as label,
ca.LONGITUDE as longitude,
@ -1182,9 +1192,9 @@
WHERE cg.DEL_FLAG = '0'
AND cg.PID = #{agencyId}
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
sum( t.total )
FROM
@ -1205,9 +1215,9 @@
g.PID = #{agencyId}
AND g.DEL_FLAG = '0'
) t
</select>
</select>
<!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName -->
<!-- 获取当前客户下所有的社区组织,只返回id,orgIdPath,agencyName -->
<select id="getAllCommunity" parameterType="java.lang.String" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT
ca.id agencyId,

Loading…
Cancel
Save