forked from luyan/epmet-cloud-lingshan
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
5.1 KiB
135 lines
5.1 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.epmet.dao.indexcoll.FactIndexServiceAblityGridMonthlyDao">
|
|
|
|
<resultMap type="com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity" id="factIndexServiceAblityGridMonthlyMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="agencyId" column="AGENCY_ID"/>
|
|
<result property="gridId" column="GRID_ID"/>
|
|
<result property="monthId" column="MONTH_ID"/>
|
|
<result property="quarterId" column="QUARTER_ID"/>
|
|
<result property="yearId" column="YEAR_ID"/>
|
|
<result property="activityCount" column="ACTIVITY_COUNT"/>
|
|
<result property="volunteerRatio" column="VOLUNTEER_RATIO"/>
|
|
<result property="partyVolunteerRatio" column="PARTY_VOLUNTEER_RATIO"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<delete id="deleteFactIndexServiceAblityGridMonthly">
|
|
delete from fact_index_service_ablity_grid_monthly
|
|
where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId}
|
|
AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId}
|
|
</delete>
|
|
|
|
<insert id="batchInsertFactIndexServiceAblityGridMonthly" parameterType="map">
|
|
insert into fact_index_service_ablity_grid_monthly
|
|
(
|
|
ID,
|
|
CUSTOMER_ID,
|
|
AGENCY_ID,
|
|
GRID_ID,
|
|
MONTH_ID,
|
|
QUARTER_ID,
|
|
YEAR_ID,
|
|
ACTIVITY_COUNT,
|
|
VOLUNTEER_RATIO,
|
|
PARTY_VOLUNTEER_RATIO,
|
|
DEL_FLAG,
|
|
REVISION,
|
|
CREATED_BY,
|
|
CREATED_TIME,
|
|
UPDATED_BY,
|
|
UPDATED_TIME
|
|
) values
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
(
|
|
(SELECT REPLACE(UUID(), '-', '') AS id),
|
|
#{customerId},
|
|
#{item.agencyId},
|
|
#{item.gridId},
|
|
#{item.monthId},
|
|
#{item.quarterId},
|
|
#{item.yearId},
|
|
#{item.activityCount},
|
|
#{item.volunteerRatio},
|
|
#{item.partyVolunteerRatio},
|
|
0,
|
|
0,
|
|
'APP_USER',
|
|
now(),
|
|
'APP_USER',
|
|
now()
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<!-- 当前客户下,所有网格的治理能力相关五级指标 -->
|
|
<select id="selectListServiceAblityGrid" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO" resultType="java.util.HashMap">
|
|
SELECT
|
|
m.CUSTOMER_ID,
|
|
m.GRID_ID,
|
|
m.MONTH_ID,
|
|
m.ACTIVITY_COUNT,
|
|
m.VOLUNTEER_RATIO,
|
|
m.PARTY_VOLUNTEER_RATIO
|
|
FROM
|
|
fact_index_service_ablity_grid_monthly m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
and m.CUSTOMER_ID=#{customerId}
|
|
and m.MONTH_ID=#{monthId}
|
|
order by m.GRID_ID asc
|
|
LIMIT #{pageIndex}, #{pageSize}
|
|
</select>
|
|
|
|
<!-- 查询 服务能力,网格相关,各五级指标最大值,最小值 -->
|
|
<select id="selectServiceAblityGridMinAndMax" parameterType="map" resultType="java.util.Map">
|
|
SELECT
|
|
m.CUSTOMER_ID,
|
|
m.GRID_ID,
|
|
m.MONTH_ID,
|
|
MIN(m.ACTIVITY_COUNT) AS ACTIVITY_COUNT_MIN,
|
|
MAX(m.ACTIVITY_COUNT) AS ACTIVITY_COUNT_MAX,
|
|
MIN(m.VOLUNTEER_RATIO) AS VOLUNTEER_RATIO_MIN,
|
|
MAX(m.VOLUNTEER_RATIO) AS VOLUNTEER_RATIO_MAX,
|
|
MIN(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MIN,
|
|
MAX(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MAX
|
|
FROM
|
|
fact_index_service_ablity_grid_monthly m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
and m.CUSTOMER_ID=#{customerId}
|
|
and m.MONTH_ID=#{monthId}
|
|
</select>
|
|
|
|
<!-- 查询(服务能力-网格相关事实表)共上传记录数 -->
|
|
<select id="selectCount" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(1) as total
|
|
FROM
|
|
fact_index_service_ablity_grid_monthly m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
AND m.CUSTOMER_ID =#{customerId}
|
|
AND m.MONTH_ID =#{monthId}
|
|
</select>
|
|
|
|
<!-- 场景:客户这个月只上传了一个网格的事实记录 -->
|
|
<select id="selectTheOneGrid" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.lang.String">
|
|
select
|
|
GRID_ID
|
|
FROM
|
|
fact_index_service_ablity_grid_monthly m
|
|
WHERE
|
|
m.DEL_FLAG = '0'
|
|
AND m.CUSTOMER_ID =#{customerId}
|
|
AND m.MONTH_ID =#{monthId}
|
|
</select>
|
|
</mapper>
|
|
|