From bbdafffe734ed924834e5678a32c8a736cc76da8 Mon Sep 17 00:00:00 2001
From: tangzhaoqian <tangzhaoqian@youlingrc.com>
Date: Fri, 24 Apr 2020 18:06:25 +0800
Subject: [PATCH] Router优化,审批详情查询

---
 src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java         |   4 ++++
 src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java |   5 +++++
 src/main/java/cn/timer/api/dto/spmk/Relation.java                       |  13 +++++++++++++
 src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java           |   2 +-
 src/main/resources/mapping/spmk/SpmkApprovalGMapper.out.xml             |   0
 src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml      | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/main/resources/mapping/spmk/SpmkExecutorMapper.xml                  | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 308 insertions(+), 1 deletion(-)
 delete mode 100644 src/main/resources/mapping/spmk/SpmkApprovalGMapper.out.xml
 create mode 100644 src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
 create mode 100644 src/main/resources/mapping/spmk/SpmkExecutorMapper.xml

diff --git a/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java b/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java
index 4131a08..ec7fb1e 100644
--- a/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java
+++ b/src/main/java/cn/timer/api/controller/spmk/SpmkServiceImpl.java
@@ -35,6 +35,7 @@ import cn.timer.api.bean.spmk.SpmkApprovalG;
 import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
 import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
 import cn.timer.api.bean.spmk.SpmkApproveDetail;
+import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
 import cn.timer.api.bean.spmk.SpmkApproveSummary;
 import cn.timer.api.bean.spmk.SpmkCustomApproval;
 import cn.timer.api.bean.spmk.SpmkExecutor;
@@ -861,11 +862,14 @@ public class SpmkServiceImpl {
 		SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, id));
 		SpmkApproveDetailDto adD = SpmkApproveDetailDto.builder().build();
 		
+		List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectListByAsId(id);
+		
 		BeanUtil.copyProperties(ad, adD, "requestData","froms","router","spmkApproveExecuteRecord");
 		adD.setRequestData(ObjectUtil.unserialize(ad.getRequestData()));
 		adD.setFroms(ObjectUtil.unserialize(ad.getFroms()));
 		adD.setRouter((Router)ObjectUtil.unserialize(ad.getRouter()));
 		adD.setListFlowChildren((List<FlowChildren>)ObjectUtil.unserialize(ad.getFlowChildren()));
+		adD.setListSpmkApproveExecuteRecord(listAer);
 		
 		return ResultUtil.data(adD, "操作成功!");
 	}
diff --git a/src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java b/src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
index d83b92a..642f838 100644
--- a/src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
+++ b/src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
@@ -1,5 +1,8 @@
 package cn.timer.api.dao.spmk;
 
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -14,4 +17,6 @@ import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
 @Repository
 public interface SpmkApproveExecuteRecordMapper extends BaseMapper<SpmkApproveExecuteRecord> {
 
+	List<SpmkApproveExecuteRecord> selectListByAsId(@Param("id") Integer id);
+
 }
diff --git a/src/main/java/cn/timer/api/dto/spmk/Relation.java b/src/main/java/cn/timer/api/dto/spmk/Relation.java
index b56bc6f..b2c8ed3 100644
--- a/src/main/java/cn/timer/api/dto/spmk/Relation.java
+++ b/src/main/java/cn/timer/api/dto/spmk/Relation.java
@@ -19,6 +19,19 @@ public class Relation implements Serializable{
 	 */
 	private static final long serialVersionUID = 1L;
 	/**
+	 * 向上id
+	 */
+	private Integer upward;
+	/**
+	 * 向下id
+	 */
+	private Integer down;
+	/**
+	 * empty
+	 */
+	private Integer empty;
+	
+	/**
 	 * 类型
 	 */
 	private String type;
diff --git a/src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java b/src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java
index 1641a29..ee70cc1 100644
--- a/src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java
+++ b/src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java
@@ -41,6 +41,6 @@ public class SpmkApproveDetailDto {
 	private List<FlowChildren> listFlowChildren;
 
 	@ApiModelProperty(value = "审批执行记录 ", example = "审批执行记录")
-	private SpmkApproveExecuteRecord spmkApproveExecuteRecord;
+	private List<SpmkApproveExecuteRecord> listSpmkApproveExecuteRecord;
 
 }
diff --git a/src/main/resources/mapping/spmk/SpmkApprovalGMapper.out.xml b/src/main/resources/mapping/spmk/SpmkApprovalGMapper.out.xml
deleted file mode 100644
index e69de29..0000000
--- a/src/main/resources/mapping/spmk/SpmkApprovalGMapper.out.xml
+++ /dev/null
diff --git a/src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml b/src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
new file mode 100644
index 0000000..b326446
--- /dev/null
+++ b/src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
@@ -0,0 +1,155 @@
+<?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="cn.timer.api.dao.spmk.SpmkApproveExecuteRecordMapper">
+
+    <resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord" >
+                <id column="id" property="id" />
+                <result column="approve_summary_id" property="approveSummaryId" />
+                <result column="name" property="name" />
+                <result column="type" property="type" />
+                <result column="sts" property="sts" />
+                <result column="create_time" property="createTime" />
+    </resultMap>
+    
+    <resultMap id="BaseResultMapDto" type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord" >
+                <id column="id" property="id" />
+                <result column="approve_summary_id" property="approveSummaryId" />
+                <result column="name" property="name" />
+                <result column="type" property="type" />
+                <result column="sts" property="sts" />
+                <result column="create_time" property="createTime" />
+                <collection column="SpmkExecutor_id" property="spmkExecutors" ofType="cn.timer.api.bean.spmk.SpmkExecutor" 
+                resultMap="cn.timer.api.dao.spmk.SpmkExecutorMapper.BaseResultMap" columnPrefix="SpmkExecutor_">
+		        </collection>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+                id,
+                approve_summary_id,
+                name,
+                type,
+                sts,
+                create_time
+    </sql>
+    
+    <sql id="Base_Column_List_a">
+                a.id,
+                a.approve_summary_id,
+                a.name,
+                a.type,
+                a.sts,
+                a.create_time
+    </sql>
+    
+    <sql id="Base_Column_List_Alias_b">
+            b.id SpmkExecutor_id,
+            b.approve_execute_record_id SpmkExecutor_approve_execute_record_id,
+            b.emp_num SpmkExecutor_emp_num,
+            b.executor_name SpmkExecutor_executor_name,
+            b.operator_header_url SpmkExecutor_operator_header_url,
+            b.opinion SpmkExecutor_opinion,
+            b.sts SpmkExecutor_sts,
+            b.create_time SpmkExecutor_create_time
+    </sql>
+    
+    <sql id="Base_Column_List_Alias">
+                id SpmkApproveExecuteRecord_id,
+                approve_summary_id SpmkApproveExecuteRecord_approve_summary_id,
+                name SpmkApproveExecuteRecord_name,
+                type SpmkApproveExecuteRecord_type,
+                sts SpmkApproveExecuteRecord_sts,
+                create_time SpmkApproveExecuteRecord_create_time
+    </sql>
+    
+    
+    <select id="selectListByAsId" resultMap="BaseResultMapDto">
+        SELECT 
+        	<include refid="Base_Column_List_a" />,
+        	<include refid="Base_Column_List_Alias_b" />
+        FROM spmk_approve_execute_record a
+         
+        LEFT JOIN spmk_executor b ON a.id = b.approve_execute_record_id
+        
+        WHERE a.approve_summary_id = #{id}  
+        ORDER BY a.id, b.id
+    </select>
+
+	<!-- 
+
+    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
+        INSERT INTO spmk_approve_execute_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                        <if test ='null != approveSummaryId'>
+                        approve_summary_id,
+                        </if>
+                        <if test ='null != name'>
+                        name,
+                        </if>
+                        <if test ='null != type'>
+                        type,
+                        </if>
+                        <if test ='null != sts'>
+                        sts,
+                        </if>
+                        <if test ='null != createTime'>
+                        create_time
+                        </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                        <if test ='null != approveSummaryId'>
+                        #{approveSummaryId},
+                        </if>
+                        <if test ='null != name'>
+                        #{name},
+                        </if>
+                        <if test ='null != type'>
+                        #{type},
+                        </if>
+                        <if test ='null != sts'>
+                        #{sts},
+                        </if>
+                        <if test ='null != createTime'>
+                        #{createTime}
+                        </if>
+        </trim>
+    </insert>
+
+    <delete id="delete" >
+        DELETE FROM spmk_approve_execute_record
+        WHERE id = #{id}
+    </delete>
+
+    <update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
+        UPDATE spmk_approve_execute_record
+        <set>
+                    <if test ='null != approveSummaryId'>approve_summary_id = #{approveSummaryId},</if>
+                    <if test ='null != name'>name = #{name},</if>
+                    <if test ='null != type'>type = #{type},</if>
+                    <if test ='null != sts'>sts = #{sts},</if>
+                    <if test ='null != createTime'>create_time = #{createTime}</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+
+    <select id="load" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List" />
+        FROM spmk_approve_execute_record
+        WHERE id = #{id}
+    </select>
+
+    <select id="pageList" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List" />
+        FROM spmk_approve_execute_record
+        LIMIT #{offset}, #{pageSize}
+    </select>
+
+    <select id="pageListCount" resultType="java.lang.Integer">
+        SELECT count(1)
+        FROM spmk_approve_execute_record
+    </select>
+
+	 -->
+
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapping/spmk/SpmkExecutorMapper.xml b/src/main/resources/mapping/spmk/SpmkExecutorMapper.xml
new file mode 100644
index 0000000..5d9d140
--- /dev/null
+++ b/src/main/resources/mapping/spmk/SpmkExecutorMapper.xml
@@ -0,0 +1,130 @@
+<?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="cn.timer.api.dao.spmk.SpmkExecutorMapper">
+
+    <resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkExecutor" >
+                <id column="id" property="id" />
+                <result column="approve_execute_record_id" property="approveExecuteRecordId" />
+                <result column="emp_num" property="empNum" />
+                <result column="executor_name" property="executorName" />
+                <result column="operator_header_url" property="operatorHeaderUrl" />
+                <result column="opinion" property="opinion" />
+                <result column="sts" property="sts" />
+                <result column="create_time" property="createTime" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+                id,
+                approve_execute_record_id,
+                emp_num,
+                executor_name,
+                operator_header_url,
+                opinion,
+                sts,
+                create_time
+    </sql>
+    
+    <sql id="Base_Column_List_Alias">
+                id SpmkExecutor_id,
+                approve_execute_record_id SpmkExecutor_approve_execute_record_id,
+                emp_num SpmkExecutor_emp_num,
+                executor_name SpmkExecutor_executor_name,
+                operator_header_url SpmkExecutor_operator_header_url,
+                opinion SpmkExecutor_opinion,
+                sts SpmkExecutor_sts,
+                create_time SpmkExecutor_create_time
+    </sql>
+
+	<!-- 
+
+    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkExecutor">
+        INSERT INTO spmk_executor
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                        <if test ='null != approveExecuteRecordId'>
+                        approve_execute_record_id,
+                        </if>
+                        <if test ='null != empNum'>
+                        emp_num,
+                        </if>
+                        <if test ='null != executorName'>
+                        executor_name,
+                        </if>
+                        <if test ='null != operatorHeaderUrl'>
+                        operator_header_url,
+                        </if>
+                        <if test ='null != opinion'>
+                        opinion,
+                        </if>
+                        <if test ='null != sts'>
+                        sts,
+                        </if>
+                        <if test ='null != createTime'>
+                        create_time
+                        </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                        <if test ='null != approveExecuteRecordId'>
+                        #{approveExecuteRecordId},
+                        </if>
+                        <if test ='null != empNum'>
+                        #{empNum},
+                        </if>
+                        <if test ='null != executorName'>
+                        #{executorName},
+                        </if>
+                        <if test ='null != operatorHeaderUrl'>
+                        #{operatorHeaderUrl},
+                        </if>
+                        <if test ='null != opinion'>
+                        #{opinion},
+                        </if>
+                        <if test ='null != sts'>
+                        #{sts},
+                        </if>
+                        <if test ='null != createTime'>
+                        #{createTime}
+                        </if>
+        </trim>
+    </insert>
+
+    <delete id="delete" >
+        DELETE FROM spmk_executor
+        WHERE id = #{id}
+    </delete>
+
+    <update id="update" parameterType="cn.timer.api.bean.spmk.SpmkExecutor">
+        UPDATE spmk_executor
+        <set>
+                    <if test ='null != approveExecuteRecordId'>approve_execute_record_id = #{approveExecuteRecordId},</if>
+                    <if test ='null != empNum'>emp_num = #{empNum},</if>
+                    <if test ='null != executorName'>executor_name = #{executorName},</if>
+                    <if test ='null != operatorHeaderUrl'>operator_header_url = #{operatorHeaderUrl},</if>
+                    <if test ='null != opinion'>opinion = #{opinion},</if>
+                    <if test ='null != sts'>sts = #{sts},</if>
+                    <if test ='null != createTime'>create_time = #{createTime}</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+
+    <select id="load" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List" />
+        FROM spmk_executor
+        WHERE id = #{id}
+    </select>
+
+    <select id="pageList" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List" />
+        FROM spmk_executor
+        LIMIT #{offset}, #{pageSize}
+    </select>
+
+    <select id="pageListCount" resultType="java.lang.Integer">
+        SELECT count(1)
+        FROM spmk_executor
+    </select>
+
+	 -->
+
+</mapper>
\ No newline at end of file
--
libgit2 0.26.0