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.

137 lines
4.8 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.IssueProcessDao">
<resultMap type="com.epmet.entity.IssueProcessEntity" id="issueProcessMap">
<result property="id" column="ID"/>
<result property="issueId" column="ISSUE_ID"/>
<result property="issueStatus" column="ISSUE_STATUS"/>
<result property="orgType" column="ORG_TYPE"/>
<result property="orgId" column="ORG_ID"/>
<result property="orgName" column="ORG_NAME"/>
<result property="operationExplain" column="OPERATION_EXPLAIN"/>
<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>
<!-- 新增议题流程 议题发声状态变更,都要新增一条流程记录 -->
<insert id="insertOne" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.epmet.dto.IssueProcessDTO">
<selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
SELECT replace(uuid(),'-','') AS ID
</selectKey>
INSERT INTO issue_process
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test ='null != issueId'>
issue_id,
</if>
<if test ='null != issueStatus'>
issue_status,
</if>
<if test ='null != orgType'>
org_type,
</if>
<if test ='null != orgId'>
org_id,
</if>
<if test ='null != operationExplain'>
operation_explain,
</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>
<if test ='null != orgName'>
org_name,
</if>
del_flag,
revision
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id},
<if test ='null != issueId'>
#{issueId},
</if>
<if test ='null != issueStatus'>
#{issueStatus},
</if>
<if test ='null != orgType'>
#{orgType},
</if>
<if test ='null != orgId'>
#{orgId},
</if>
<if test ='null != operationExplain'>
#{operationExplain},
</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>
<if test ='null != orgName'>
#{orgName},
</if>
'0',
0
</trim>
</insert>
<!-- 议题处理进展——已关闭 -->
<select id="issueProcess" parameterType="com.epmet.dto.form.IssueIdFormDTO" resultType="com.epmet.dto.result.ProcessListResultDTO">
SELECT
CASE
WHEN issue_status = 'voting' THEN "转议题"
WHEN issue_status = 'closed' THEN "已关闭"
WHEN issue_status = 'shift_project' THEN "已转项目"
END AS processName,
UNIX_TIMESTAMP( created_time ) AS processTime,
operation_explain AS progressDesc,
org_name AS departmentName,
id AS processId
FROM
issue_process
WHERE
issue_id = #{issueId}
AND del_flag = 0
ORDER BY created_time DESC
</select>
<!-- 查询转议题信息 -->
<select id="issueBeginInfo" parameterType="com.epmet.dto.form.IssueIdFormDTO" resultType="com.epmet.dto.result.ProcessListResultDTO">
SELECT
'转议题' AS processName,
UNIX_TIMESTAMP( created_time ) AS processTime,
operation_explain AS progressDesc,
org_name AS departmentName,
id AS processId
FROM
issue_process
WHERE
issue_id = #{issueId}
AND issue_status = 'voting'
AND del_flag = 0
</select>
</mapper>