zhanghua
2023-09-08 7ef4892f9f24f941aca37e6b3991b808a0aca619
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?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.ycl.mapper.caseHandler.WorkflowConfigStepMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.caseHandler.WorkflowConfigStep">
        <id column="id" property="id" />
        <result column="workflow_config_id" property="workflowConfigId" />
        <result column="name" property="name" />
        <result column="role_id" property="roleId" />
        <result column="seq" property="seq" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, workflow_config_id "workflowConfigId", name "name",role_id "roleId",seq "seq"
    </sql>
    <resultMap type="com.ycl.entity.caseHandler.WorkflowConfigStep" id="RecordResultMap" extends="BaseResultMap">
        <collection property="disposeRecords" javaType="ArrayList" ofType="com.ycl.entity.caseHandler.DisposeRecord">
            <id column="record_id" property="id" />
            <result column="base_case_id" property="baseCaseId" />
            <result column="workflow_config_step_id" property="workflowConfigStepId" />
            <result column="step_name" property="stepName" />
            <result column="start_time" property="startTime" />
            <result column="handler_role_id" property="handlerRoleId" />
            <result column="end_time" property="endTime" />
            <result column="state" property="state" />
            <result column="handler_id" property="handlerId" />
            <result column="create_user" property="createUser" />
            <result column="create_time" property="createTime" />
            <result column="handler_text" property="handlerText" />
            <result column="result" property="result" />
            <result column="limit_time" property="limitTime" />
        </collection>
    </resultMap>
 
    <select id="selectRecordByWorkflowConfigStepId" parameterType="map" resultMap="RecordResultMap">
        SELECT
            uwcs.*,udr.*,udr.id record_id,ua.nick_name handler_text
        FROM
            ums_workflow_config_step uwcs
                LEFT JOIN ums_dispose_record udr ON uwcs.id = udr.workflow_config_step_id AND udr.base_case_id = #{baseCaseId}
                LEFT JOIN ums_admin ua ON udr.handler_id = ua.id
        WHERE
            uwcs.workflow_config_id = #{workflowConfigId}
    </select>
</mapper>