郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?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.gkhy.safePlatform.specialWork.repository.WorkApprovalStepInfoRepository" >
 
    <resultMap id="WorkApprovalStepInfo" type="com.gkhy.safePlatform.specialWork.entity.WorkApprovalStepInfo">
        <result column="id" property="id"/>
        <result column="work_apply_id" property="workApplyId"/>
        <result column="type" property="type"/>
        <result column="approval_result" property="approvalResult"/>
        <result column="step_serial" property="stepSerial"/>
        <result column="start_approval_time" property="startApprovalTime"/>
        <result column="exp_finish_approval_time" property="expFinishApprovalTime"/>
        <result column="finish_approval_time" property="finishApprovalTime"/>
        <result column="pre_step_id" property="preStepId"/>
        <result column="next_step_id" property="nextStepId"/>
        <result column="is_contain_item" property="containItem"/>
        <result column="continue_time" property="continueTime"/>
        <result column="continue_time_unit" property="continueTimeUnit"/>
        <result column="step_name" property="stepName"/>
        <result column="audit_type" property="auditType"/>
        <result column="person_type" property="personType"/>
        <result column="approval_type" property="approvalType"/>
        <result column="content_type" property="contentType"/>
 
 
    </resultMap>
 
 
    <insert id="insertBatch"
            parameterType="com.gkhy.safePlatform.specialWork.entity.WorkApprovalStepInfo">
        insert
        into work_approval_step
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,
            work_apply_id,
            type,
            approval_result,
            step_serial,
            start_approval_time,
            exp_finish_approval_time,
            finish_approval_time,
            pre_step_id,
            next_step_id,
            is_contain_item,
            continue_time,
            continue_time_unit,
            step_name,
            audit_type,
            person_type,
            approval_type,
            content_type
        </trim>
        <foreach collection="list" item="item"  separator=",">
            <trim prefix="(" suffix=")" suffixOverrides=",">
                #{item.id},
                #{item.workApplyId},
                #{item.type},
                #{item.approvalResult},
                #{item.stepSerial},
                #{item.startApprovalTime},
                #{item.expFinishApprovalTime},
                #{item.finishApprovalTime},
                #{item.preStepId},
                #{item.nextStepId},
                #{item.containItem},
                #{item.continueTime},
                #{item.continueTimeUnit},
                #{item.stepName},
                #{item.auditType},
                #{item.personType},
                #{item.approvalType},
                #{item.contentType},
            </trim>
 
        </foreach>
 
    </insert>
    <update id="updateStatusById">
        update
        work_approval_step
        set approval_result = #{result}
        where id = #{stepId}
 
    </update>
    <update id="updateFinishApprovalTimeById">
        update
        work_approval_step
        set finish_approval_time = #{finishTime}
        where id = #{stepId}
 
    </update>
    <update id="updateStartApprovalTimeById">
        update
        work_approval_step
        set start_approval_time = #{startTime}
        where id = #{stepId}
 
    </update>
    <select id="listApprovalRuleStepByWorkApplyId"
            parameterType="long"
            resultMap="WorkApprovalStepInfo">
        select
        apprvoalStep.id,
        apprvoalStep.work_apply_id,
        apprvoalStep.type,
        apprvoalStep.approval_result,
        apprvoalStep.step_serial,
        apprvoalStep.start_approval_time,
        apprvoalStep.exp_finish_approval_time,
        apprvoalStep.finish_approval_time,
        apprvoalStep.pre_step_id,
        apprvoalStep.next_step_id,
        apprvoalStep.is_contain_item,
        apprvoalStep.continue_time,
        apprvoalStep.continue_time_unit,
        apprvoalStep.step_name,
        apprvoalStep.audit_type,
        apprvoalStep.person_type,
        apprvoalStep.approval_type,
        apprvoalStep.content_type
        from work_approval_step apprvoalStep
        where work_apply_id = #{workApplyId}
 
    </select>
</mapper>