forked from rongchao/epmet-cloud-rizhao
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.
70 lines
2.6 KiB
70 lines
2.6 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.heart.ActInfoDao">
|
|
<!-- 查询这个月,各个网格举办的活动次数 活动状态已结束并且实际结束时间在评价周期内的 -->
|
|
<select id="selectActGroupByGridId" parameterType="map" resultType="com.epmet.dto.indexcollect.result.GridIndexCommonDTO">
|
|
SELECT
|
|
ai.SPONSOR_ID as gridId,
|
|
count( 1 ) AS indexValue
|
|
FROM
|
|
act_info ai
|
|
WHERE
|
|
ai.DEL_FLAG = '0'
|
|
AND ai.ACT_STATUS = 'finished'
|
|
AND ai.SPONSOR_TYPE = 'grid'
|
|
and ai.CUSTOMER_ID=#{customerId}
|
|
AND DATE_FORMAT(ai.ACTUAL_END_TIME,'%Y%m') = #{monthId}
|
|
GROUP BY
|
|
ai.SPONSOR_ID
|
|
</select>
|
|
|
|
<!-- 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 -->
|
|
<select id="selectGridRegUserVolunteer" parameterType="map" resultType="java.lang.String">
|
|
SELECT
|
|
DISTINCT vi.USER_ID
|
|
FROM
|
|
volunteer_info vi
|
|
WHERE
|
|
vi.DEL_FLAG = '0'
|
|
AND
|
|
<foreach collection="list" item="userId" separator="or" open="(" close=")">
|
|
vi.USER_ID =#{userId}
|
|
</foreach>
|
|
</select>
|
|
|
|
<!-- 查询组织次数 -->
|
|
<select id="selectActInfo" resultType="com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO">
|
|
SELECT
|
|
CUSTOMER_ID,
|
|
SUBSTR( #{monthId}, 1, 4 ) AS yearId,
|
|
#{monthId} AS monthId,
|
|
SPONSOR_TYPE AS orgType,
|
|
SPONSOR_ID AS orgId,
|
|
SPONSOR_NAME AS orgName,
|
|
PID AS parentId ,
|
|
COUNT(ID) AS organizeCount
|
|
FROM
|
|
act_info
|
|
WHERE
|
|
DEL_FLAG = 0
|
|
AND ACT_STATUS = 'finished'
|
|
AND CUSTOMER_ID = #{customerId}
|
|
AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
|
|
GROUP BY SPONSOR_ID
|
|
</select>
|
|
<select id="selectAgencyActCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
|
|
SELECT
|
|
SPONSOR_ID AS "agencyId",
|
|
COUNT(ID) AS "count"
|
|
FROM
|
|
act_info
|
|
WHERE
|
|
DEL_FLAG = 0
|
|
AND ACT_STATUS = 'finished'
|
|
AND SPONSOR_TYPE = 'agency'
|
|
AND CUSTOMER_ID = #{customerId}
|
|
AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
|
|
GROUP BY SPONSOR_ID
|
|
</select>
|
|
</mapper>
|
|
|