|
|
|
<?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.IssueVoteStatisticalDao">
|
|
|
|
|
|
|
|
<resultMap type="com.epmet.entity.IssueVoteStatisticalEntity" id="issueVoteStatisticalMap">
|
|
|
|
<result property="id" column="ID"/>
|
|
|
|
<result property="issueId" column="ISSUE_ID"/>
|
|
|
|
<result property="supportCount" column="SUPPORT_COUNT"/>
|
|
|
|
<result property="oppositionCount" column="OPPOSITION_COUNT"/>
|
|
|
|
<result property="votableCount" column="VOTABLE_COUNT"/>
|
|
|
|
<result property="revision" column="REVISION"/>
|
|
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<!-- 表决中议题详情——支持、反对数 -->
|
|
|
|
<select id="voteCount" parameterType="com.epmet.dto.form.IssueIdFormDTO" resultType="com.epmet.dto.result.VoteResultDTO">
|
|
|
|
SELECT
|
|
|
|
support_count AS supportCount,
|
|
|
|
opposition_count AS oppositionCount
|
|
|
|
FROM
|
|
|
|
issue_vote_statistical
|
|
|
|
WHERE
|
|
|
|
issue_id = #{issueId}
|
|
|
|
AND del_flag = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 校验是否投票(表决中详情——支持、反对) -->
|
|
|
|
<select id="checkVote" resultType="java.lang.String">
|
|
|
|
SELECT
|
|
|
|
attitude AS voteType
|
|
|
|
FROM
|
|
|
|
issue_vote_detail
|
|
|
|
WHERE
|
|
|
|
del_flag = 0
|
|
|
|
AND issue_id = #{issueId}
|
|
|
|
AND created_by = #{userId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 议题表决折线图 -->
|
|
|
|
<select id="votingTrend" resultType="com.epmet.dto.result.VotingTrendResultDTO">
|
|
|
|
SELECT
|
|
|
|
votable_count AS shouldVoteCount,
|
|
|
|
( support_count + opposition_count ) AS realityVoteCount,
|
|
|
|
support_count AS supportAmount,
|
|
|
|
opposition_count AS oppositionAmount
|
|
|
|
FROM
|
|
|
|
issue_vote_statistical
|
|
|
|
WHERE
|
|
|
|
del_flag = 0
|
|
|
|
AND issue_id = #{issueId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 获取折线每天的支持、反对数量 (按时间正序) -->
|
|
|
|
<select id="polyLineData" parameterType="com.epmet.dto.form.IssueIdFormDTO" resultType="com.epmet.dto.PolyLineDTO">
|
|
|
|
SELECT
|
|
|
|
UNIX_TIMESTAMP(statistical_date) AS voteDate,
|
|
|
|
support_increment AS supportIncrement,
|
|
|
|
opposition_increment AS oppositionIncrement
|
|
|
|
FROM
|
|
|
|
issue_vote_statistical_daily
|
|
|
|
WHERE
|
|
|
|
issue_id = #{issueId}
|
|
|
|
AND del_flag = 0
|
|
|
|
ORDER BY statistical_date ASC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|