Browse Source

党员先锋统计修改

master
zhaoqifeng 4 years ago
parent
commit
3d7acb2ac7
  1. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  2. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  3. 38
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml
  4. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  5. 38
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  6. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -1011,6 +1011,9 @@ public class DataStatsServiceImpl implements DataStatsService {
public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) {
//获取组织级别
DimAgencyEntity agency = dataStatsDao.getAgencyInfo(formDTO.getAgencyId());
if (null == agency) {
return new PartyMemberVanguardRankResultDTO();
}
//组织排行
List<PartyMemberVanguardDetailResultDTO> agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId());
//网格排行

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -352,16 +352,19 @@
</select>
<select id="selectPartyMemberGroupStaticByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
count( ID ) AS "sum",
sum(IF( IS_OWNER_PARTY = 1, 1, 0 )) AS "count"
a.ID AS AGENCY_ID,
count( b.ID ) AS "sum",
sum( IF( IS_OWNER_PARTY = 1, 1, 0 )) AS "count"
FROM
fact_origin_group_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
AND (GROUP_STATE = 'approved' OR GROUP_STATE = 'hidden')
dim_agency a
INNER JOIN
fact_origin_group_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
AND ( GROUP_STATE = 'approved' OR GROUP_STATE = 'hidden' )
GROUP BY
AGENCY_ID
a.ID
</select>
<select id="selectPartyMemberGroupStaticByGrid" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

38
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml

@ -29,25 +29,33 @@
</resultMap>
<select id="selectGroupPartyMemberStaticByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID,
da.ID AS AGENCY_ID,
COUNT( DISTINCT MEMBER_ID ) AS "sum",
IFNULL( b.partyCount, 0 ) AS "count"
FROM
fact_origin_group_member_daily a
LEFT JOIN
(SELECT
AGENCY_ID,
COUNT( DISTINCT MEMBER_ID ) AS partyCount
FROM fact_origin_group_member_daily
WHERE IS_PARTY = 1
AND CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY AGENCY_ID
) b ON a.AGENCY_ID = b.AGENCY_ID
WHERE a.CUSTOMER_ID = #{customerId}
AND a.DATE_ID &lt;= #{dateId}
dim_agency da
INNER JOIN fact_origin_group_member_daily a ON a.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND a.CUSTOMER_ID = #{customerId}
AND a.DATE_ID &lt;= #{dateId}
LEFT JOIN (
SELECT
agency.ID AS AGENCY_ID,
COUNT( DISTINCT MEMBER_ID ) AS partyCount
FROM
dim_agency agency
INNER JOIN fact_origin_group_member_daily member ON member.PIDS LIKE CONCAT( '%', agency.ID, '%' )
AND member.IS_PARTY = 1
AND member.CUSTOMER_ID = #{customerId}
AND member.DATE_ID &lt;= #{dateId}
WHERE
agency.CUSTOMER_ID = #{customerId}
GROUP BY
agency.ID
) b ON da.ID = b.AGENCY_ID
WHERE
da.CUSTOMER_ID = #{customerId}
GROUP BY
a.AGENCY_ID
da.ID
</select>
<select id="selectGroupPartyMemberStaticByGrid" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -293,13 +293,18 @@
</select>
<select id="selectPartyMemberIssueStaticByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) AS "sum",
SUM(IF(IS_PARTY = 1 ,1, 0)) AS "count"
FROM fact_origin_issue_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY AGENCY_ID
a.ID AS AGENCY_ID,
count( b.ID ) AS "sum",
sum( IF( IS_PARTY = 1, 1, 0 )) AS "count"
FROM
dim_agency a
INNER JOIN
fact_origin_issue_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
GROUP BY
a.ID
</select>
<select id="selectPartyMemberIssueStaticByGrid" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

38
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -763,14 +763,19 @@
</select>
<select id="selectPartyMemberProjectStaticByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) AS "sum",
SUM(IF(IS_PARTY = 1 ,1, 0)) AS "count"
FROM fact_origin_project_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
a.ID AS AGENCY_ID,
count( b.ID ) AS "sum",
sum( IF( IS_PARTY = 1, 1, 0 )) AS "count"
FROM
dim_agency a
INNER JOIN
fact_origin_project_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
AND ORIGIN = 'issue'
GROUP BY AGENCY_ID
GROUP BY
a.ID
</select>
<select id="selectPartyMemberProjectStaticByGrid" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
@ -785,15 +790,20 @@
</select>
<select id="selectPartyMemberClosedProjectStaticByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) AS "sum",
SUM(IF(IS_PARTY = 1 ,1, 0)) AS "count"
FROM fact_origin_project_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
a.ID AS AGENCY_ID,
count( b.ID ) AS "sum",
sum( IF( IS_PARTY = 1, 1, 0 )) AS "count"
FROM
dim_agency a
INNER JOIN
fact_origin_project_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
AND PROJECT_STATUS = 'closed'
AND ORIGIN = 'issue'
GROUP BY AGENCY_ID
GROUP BY
a.ID
</select>
<select id="selectPartyMemberClosedProjectStaticByGrid" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -192,13 +192,18 @@
</select>
<select id="selectPartyMemberTopicStaticByAgency" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) as "sum",
SUM(IF(CREATE_TOPIC_USER_IS_PARTY = 1 ,1, 0)) as "count"
FROM fact_origin_topic_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY AGENCY_ID
a.ID AS AGENCY_ID,
count( b.ID ) AS "sum",
sum( IF( CREATE_TOPIC_USER_IS_PARTY = 1, 1, 0 )) AS "count"
FROM
dim_agency a
INNER JOIN
fact_origin_topic_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
GROUP BY
a.ID
</select>
<select id="selectPartyMemberTopicStaticByGrid" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

Loading…
Cancel
Save