|
|
|
<?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.IssueDao">
|
|
|
|
|
|
|
|
<resultMap type="com.epmet.entity.IssueEntity" id="issueMap">
|
|
|
|
<result property="id" column="ID"/>
|
|
|
|
<result property="issueStatus" column="ISSUE_STATUS"/>
|
|
|
|
<result property="sourceType" column="SOURCE_TYPE"/>
|
|
|
|
<result property="sourceId" column="SOURCE_ID"/>
|
|
|
|
<result property="closeReason" column="CLOSE_REASON"/>
|
|
|
|
<result property="resolveType" column="RESOLVE_TYPE"/>
|
|
|
|
<result property="issueTitle" column="ISSUE_TITLE"/>
|
|
|
|
<result property="suggestion" column="SUGGESTION"/>
|
|
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
|
|
<result property="gridId" column="GRID_ID"/>
|
|
|
|
<result property="orgIdPath" column="ORG_ID_PATH"/>
|
|
|
|
<result property="orgId" column="ORG_ID"/>
|
|
|
|
<result property="votingDeadline" column="VOTING_DEADLINE"/>
|
|
|
|
<result property="decidedTime" column="DECIDED_TIME"/>
|
|
|
|
<result property="shiftedTime" column="SHIFTED_TIME"/>
|
|
|
|
<result property="closedTime" column="CLOSED_TIME"/>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<!-- 议题详情 -->
|
|
|
|
<select id="issueDetail" parameterType="com.epmet.dto.form.IssueDetailFormDTO" resultType="com.epmet.dto.result.IssueResultDTO">
|
|
|
|
SELECT
|
|
|
|
source_id AS topicId,
|
|
|
|
issue_title AS issueTitle,
|
|
|
|
issue_status AS issueStatus,
|
|
|
|
suggestion AS issueSuggestion,
|
|
|
|
grid_id AS gridId,
|
|
|
|
created_by AS userId
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
id = #{issueId}
|
|
|
|
AND del_flag = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectIssueListByGridId" parameterType="com.epmet.dto.form.ShiftProjectListFromDTO" resultType="com.epmet.entity.IssueEntity">
|
|
|
|
SELECT
|
|
|
|
*
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND GRID_ID = #{gridId}
|
|
|
|
AND ISSUE_STATUS = 'shift_project'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 新增议题 -->
|
|
|
|
<insert id="insertOne" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.epmet.dto.IssueDTO">
|
|
|
|
|
|
|
|
<selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
|
|
|
|
SELECT replace(uuid(),'-','') AS ID
|
|
|
|
</selectKey>
|
|
|
|
|
|
|
|
INSERT INTO issue
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
id,
|
|
|
|
<if test ='null != issueStatus'>
|
|
|
|
issue_status,
|
|
|
|
</if>
|
|
|
|
<if test ='null != sourceType'>
|
|
|
|
source_type,
|
|
|
|
</if>
|
|
|
|
<if test ='null != sourceId'>
|
|
|
|
source_id,
|
|
|
|
</if>
|
|
|
|
<if test ='null != closeReason'>
|
|
|
|
close_reason,
|
|
|
|
</if>
|
|
|
|
<if test ='null != resolveType'>
|
|
|
|
resolve_type,
|
|
|
|
</if>
|
|
|
|
<if test ='null != issueTitle'>
|
|
|
|
issue_title,
|
|
|
|
</if>
|
|
|
|
<if test ='null != suggestion'>
|
|
|
|
suggestion,
|
|
|
|
</if>
|
|
|
|
<if test ='null != customerId'>
|
|
|
|
customer_id,
|
|
|
|
</if>
|
|
|
|
<if test ='null != gridId'>
|
|
|
|
grid_id,
|
|
|
|
</if>
|
|
|
|
<if test ='null != orgIdPath'>
|
|
|
|
org_id_path,
|
|
|
|
</if>
|
|
|
|
<if test ='null != orgId'>
|
|
|
|
org_id,
|
|
|
|
</if>
|
|
|
|
<if test ='null != votingDeadline'>
|
|
|
|
voting_deadline,
|
|
|
|
</if>
|
|
|
|
<if test ='null != decidedTime'>
|
|
|
|
decided_time,
|
|
|
|
</if>
|
|
|
|
<if test ='null != shiftedTime'>
|
|
|
|
shifted_time,
|
|
|
|
</if>
|
|
|
|
<if test ='null != closedTime'>
|
|
|
|
closed_time,
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdBy'>
|
|
|
|
created_by,
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdTime'>
|
|
|
|
created_time,
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdBy'>
|
|
|
|
updated_by,
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdTime'>
|
|
|
|
updated_time,
|
|
|
|
</if>
|
|
|
|
del_flag,
|
|
|
|
revision
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
#{id},
|
|
|
|
<if test ='null != issueStatus'>
|
|
|
|
#{issueStatus},
|
|
|
|
</if>
|
|
|
|
<if test ='null != sourceType'>
|
|
|
|
#{sourceType},
|
|
|
|
</if>
|
|
|
|
<if test ='null != sourceId'>
|
|
|
|
#{sourceId},
|
|
|
|
</if>
|
|
|
|
<if test ='null != closeReason'>
|
|
|
|
#{closeReason},
|
|
|
|
</if>
|
|
|
|
<if test ='null != resolveType'>
|
|
|
|
#{resolveType},
|
|
|
|
</if>
|
|
|
|
<if test ='null != issueTitle'>
|
|
|
|
#{issueTitle},
|
|
|
|
</if>
|
|
|
|
<if test ='null != suggestion'>
|
|
|
|
#{suggestion},
|
|
|
|
</if>
|
|
|
|
<if test ='null != customerId'>
|
|
|
|
#{customerId},
|
|
|
|
</if>
|
|
|
|
<if test ='null != gridId'>
|
|
|
|
#{gridId},
|
|
|
|
</if>
|
|
|
|
<if test ='null != orgIdPath'>
|
|
|
|
#{orgIdPath},
|
|
|
|
</if>
|
|
|
|
<if test ='null != orgId'>
|
|
|
|
#{orgId},
|
|
|
|
</if>
|
|
|
|
<if test ='null != votingDeadline'>
|
|
|
|
#{votingDeadline},
|
|
|
|
</if>
|
|
|
|
<if test ='null != decidedTime'>
|
|
|
|
#{decidedTime},
|
|
|
|
</if>
|
|
|
|
<if test ='null != shiftedTime'>
|
|
|
|
#{shiftedTime},
|
|
|
|
</if>
|
|
|
|
<if test ='null != closedTime'>
|
|
|
|
#{closedTime},
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdBy'>
|
|
|
|
#{createdBy},
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdTime'>
|
|
|
|
#{createdTime},
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdBy'>
|
|
|
|
#{createdBy},
|
|
|
|
</if>
|
|
|
|
<if test ='null != createdTime'>
|
|
|
|
#{createdTime},
|
|
|
|
</if>
|
|
|
|
'0',
|
|
|
|
0
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<!-- 查询表决中议题列表 -->
|
|
|
|
<select id="selectVotingList" parameterType="com.epmet.dto.form.CommonIssueListFormDTO" resultType="com.epmet.dto.result.VotingIssueListResultDTO">
|
|
|
|
SELECT
|
|
|
|
ID AS issueId,
|
|
|
|
IFNULL(ISSUE_TITLE,'') AS issueTitle,
|
|
|
|
IFNULL(SUGGESTION,'')AS suggestion,
|
|
|
|
UNIX_TIMESTAMP( created_time ) AS issuePublishTime
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND GRID_ID = #{gridId}
|
|
|
|
AND ISSUE_STATUS = 'voting'
|
|
|
|
ORDER BY
|
|
|
|
created_time DESC
|
|
|
|
LIMIT #{pageNo},
|
|
|
|
#{pageSize}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 查询已关闭议题列表 -->
|
|
|
|
<select id="selectClosedList" parameterType="com.epmet.dto.form.CommonIssueListFormDTO" resultType="com.epmet.dto.result.ClosedIssueListResultDTO">
|
|
|
|
SELECT
|
|
|
|
ID AS issueId,
|
|
|
|
IFNULL(ISSUE_TITLE,'') AS issueTitle,
|
|
|
|
IFNULL(CLOSE_REASON,'') AS solution,
|
|
|
|
UNIX_TIMESTAMP( created_time ) AS issueClosedTime
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND GRID_ID = #{gridId}
|
|
|
|
AND ISSUE_STATUS = 'closed'
|
|
|
|
ORDER BY
|
|
|
|
created_time DESC
|
|
|
|
LIMIT #{pageNo},
|
|
|
|
#{pageSize}
|
|
|
|
</select>
|
|
|
|
<!-- 查询已关闭议题列表 政府端 -->
|
|
|
|
<select id="selectClosedListGov" parameterType="com.epmet.dto.form.CommonIssueListFormDTO" resultType="com.epmet.dto.result.ClosedIssueListGovResultDTO">
|
|
|
|
SELECT
|
|
|
|
ID AS issueId,
|
|
|
|
IFNULL(ISSUE_TITLE,'') AS issueTitle,
|
|
|
|
IFNULL(CLOSE_REASON,'') AS closeReason,
|
|
|
|
UNIX_TIMESTAMP( created_time ) AS closedTime
|
|
|
|
FROM
|
|
|
|
issue
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND GRID_ID = #{gridId}
|
|
|
|
AND ISSUE_STATUS = 'closed'
|
|
|
|
ORDER BY
|
|
|
|
created_time DESC
|
|
|
|
LIMIT #{pageNo},
|
|
|
|
#{pageSize}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|