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.
 
 
 
 
 

112 lines
3.7 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.FactIndexPartyAblityOrgMonthlyDao">
<resultMap type="com.epmet.entity.indexcoll.FactIndexPartyAblityOrgMonthlyEntity" id="factIndexPartyAblityOrgMonthlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="publishArticleCount" column="PUBLISH_ARTICLE_COUNT"/>
<result property="dataType" column="DATA_TYPE"/>
<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="deleteFactIndexPartyAblityOrgMonthly">
delete from fact_index_party_ablity_org_monthly
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId}
AND AGENCY_ID IN
<foreach item="item" collection="agencyIds" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<insert id="batchInsertFactIndexPartyAblityOrgMonthly" parameterType="map">
insert into fact_index_party_ablity_org_monthly
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
PUBLISH_ARTICLE_COUNT,
DATA_TYPE,
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.parentId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.publishArticleCount},
#{item.dataType},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<!-- 查询社区下的发文数 -->
<select id="selectPublishArticleCount" resultType="com.epmet.dto.screen.result.CommunityPublishArticleCountResultDTO">
SELECT
agency_id,
parent_id,
month_id,
quarter_id,
year_id,
publish_article_count,
customer_id
FROM
fact_index_party_ablity_org_monthly
WHERE
del_flag = '0'
AND data_type = 'community'
AND customer_id = #{customerId}
AND month_id = #{monthId}
</select>
<!-- 查询社区下的发文数 Map -->
<select id="selectPublishArticleCountMap" resultType="java.util.Map">
SELECT
AGENCY_ID,
PARENT_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
PUBLISH_ARTICLE_COUNT,
CUSTOMER_ID
FROM
fact_index_party_ablity_org_monthly
WHERE
del_flag = '0'
AND data_type = #{level}
AND customer_id = #{customerId}
AND month_id = #{monthId}
</select>
</mapper>