双重预防项目-国泰新华二开定制版
16639036659
2022-09-27 7e7195766eb018b4ba00b2d0663f6dcb11adefc8
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?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.ruoyi.project.tr.HiddenDangerCheckJob.mapper.HiddenDangerCheckJobMapper">
 
    <resultMap type="HiddenDangerCheckJob" id="JobResult">
        <id     property="jobId"          column="job_id"          />
        <result property="jobName"        column="job_name"        />
        <result property="jobGroup"       column="job_group"       />
        <result property="invokeTarget"   column="invoke_target"   />
        <result property="cronExpression" column="cron_expression" />
        <result property="misfirePolicy"  column="misfire_policy"  />
        <result property="concurrent"     column="concurrent"      />
        <result property="status"         column="status"          />
        <result property="createBy"       column="create_by"       />
        <result property="createTime"     column="create_time"     />
        <result property="updateBy"       column="update_by"       />
        <result property="updateTime"     column="update_time"     />
        <result property="remark"         column="remark"          />
        <result property="troubleshootTypeId"    column="troubleshoot_type_id"    />
        <result property="troubleshootTypeName"    column="troubleshoot_type_name"    />
        <result property="troubleshootTypeCycleNum"    column="troubleshoot_type_cycle_num"    />
        <result property="troubleshootTypeCycleType"    column="troubleshoot_type_cycle_type"    />
        <result property="companyId"    column="company_id"    />
        <result property="riskType"    column="risk_type"    />
        <result property="riskId"    column="risk_id"    />
        <result property="riskName"    column="risk_name"    />
        <result property="riskPlaceId"    column="risk_place_id"    />
        <result property="riskPlaceName"    column="risk_place_name"    />
        <result property="riskDeptId"    column="risk_dept_id"    />
        <result property="riskDeptName"    column="risk_dept_name"    />
        <result property="executeUserId"    column="execute_user_id"    />
        <result property="executeUserName"    column="execute_user_name"    />
        <result property="createUserId"    column="create_user_id"    />
        <result property="createUserName"    column="create_user_name"    />
        <result property="startTime"    column="start_time"    />
 
 
        <result property="checkType"    column="check_type"    />
 
    </resultMap>
    
    <sql id="selectJobVo">
        select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent,
         status, create_by, create_time, remark,
         troubleshoot_type_id, troubleshoot_type_name,
        troubleshoot_type_cycle_num, troubleshoot_type_cycle_type,
        company_id, risk_type, risk_id, risk_name, risk_place_id,risk_place_name,
        risk_dept_id, risk_dept_name, execute_user_id,
        execute_user_name, start_time, create_user_id,
        create_user_name,
        check_type
        from tr_hidden_danger_check_job
    </sql>
    
    <select id="selectJobList" parameterType="Job" resultMap="JobResult">
        <include refid="selectJobVo"/>
        <where>
            <if test="jobName != null and jobName != ''">
                AND job_name like concat('%', #{jobName}, '%')
            </if>
            <if test="jobGroup != null and jobGroup != ''">
                AND job_group = #{jobGroup}
            </if>
            <if test="status != null and status != ''">
                AND status = #{status}
            </if>
            <if test="invokeTarget != null and invokeTarget != ''">
                AND invoke_target like concat('%', #{invokeTarget}, '%')
            </if>
 
            <if test="troubleshootTypeId != null "> and troubleshoot_type_id = #{troubleshootTypeId}</if>
            <if test="troubleshootTypeName != null  and troubleshootTypeName != ''"> and troubleshoot_type_name like concat('%', #{troubleshootTypeName}, '%')</if>
            <if test="troubleshootTypeCycleNum != null "> and troubleshoot_type_cycle_num = #{troubleshootTypeCycleNum}</if>
            <if test="troubleshootTypeCycleType != null "> and troubleshoot_type_cycle_type = #{troubleshootTypeCycleType}</if>
            <if test="companyId != null "> and company_id = #{companyId}</if>
            <if test="riskType != null  and riskType != ''"> and risk_type = #{riskType}</if>
            <if test="riskId != null "> and risk_id = #{riskId}</if>
            <if test="riskName != null  and riskName != ''"> and risk_name like concat('%', #{riskName}, '%')</if>
            <if test="riskPlaceId != null  and riskPlaceId != ''"> and risk_place_id = #{riskPlaceId}</if>
            <if test="riskPlaceName != null  and riskPlaceName != ''"> and risk_place_name = #{riskPlaceName}</if>
            <if test="riskDeptId != null "> and risk_dept_id = #{riskDeptId}</if>
            <if test="riskDeptName != null  and riskDeptName != ''"> and risk_dept_name like concat('%', #{riskDeptName}, '%')</if>
            <if test="executeUserId != null "> and execute_user_id = #{executeUserId}</if>
            <if test="executeUserName != null  and executeUserName != ''"> and execute_user_name like concat('%', #{executeUserName}, '%')</if>
 
            <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
            <if test="createUserName != null  and createUserName != ''"> and create_user_name like concat('%', #{createUserName}, '%')</if>
 
 
            <if test="startTime != null "> and start_time = #{startTime}</if>
 
 
            <if test="checkType != null  and checkType != ''"> and check_type = #{checkType}</if>
 
 
        </where>
    </select>
    
    <select id="selectJobAll" resultMap="JobResult">
        <include refid="selectJobVo"/>
    </select>
    
    <select id="selectJobById" parameterType="Long" resultMap="JobResult">
        <include refid="selectJobVo"/>
        where job_id = #{jobId}
    </select>
    
    <delete id="deleteJobById" parameterType="Long">
         delete from tr_hidden_danger_check_job where job_id = #{jobId}
     </delete>
     
     <delete id="deleteJobByIds" parameterType="Long">
         delete from tr_hidden_danger_check_job where job_id in
         <foreach collection="array" item="jobId" open="(" separator="," close=")">
             #{jobId}
        </foreach> 
     </delete>
     
     <update id="updateJob" parameterType="Job">
         update tr_hidden_danger_check_job
         <set>
             <if test="jobName != null and jobName != ''">job_name = #{jobName},</if>
             <if test="jobGroup != null and jobGroup != ''">job_group = #{jobGroup},</if>
             <if test="invokeTarget != null and invokeTarget != ''">invoke_target = #{invokeTarget},</if>
             <if test="cronExpression != null and cronExpression != ''">cron_expression = #{cronExpression},</if>
             <if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy = #{misfirePolicy},</if>
             <if test="concurrent != null and concurrent != ''">concurrent = #{concurrent},</if>
             <if test="status !=null">status = #{status},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            <if test="remark != null  and remark != ''">remark = #{remark},</if>
            <if test="troubleshootTypeId != null ">troubleshoot_type_id = #{troubleshootTypeId},</if>
            <if test="troubleshootTypeName != null  and troubleshootTypeName != ''">troubleshoot_type_name = #{troubleshootTypeName},</if>
            <if test="troubleshootTypeCycleNum != null ">troubleshoot_type_cycle_num = #{troubleshootTypeCycleNum},</if>
            <if test="troubleshootTypeCycleType != null ">troubleshoot_type_cycle_type = #{troubleshootTypeCycleType},</if>
            <if test="companyId != null ">company_id = #{companyId},</if>
            <if test="riskType != null  and riskType != ''">risk_type = #{riskType},</if>
            <if test="riskId != null ">risk_id = #{riskId},</if>
            <if test="riskName != null  and riskName != ''">risk_name = #{riskName},</if>
            <if test="riskPlaceId != null  and riskPlaceId != ''">risk_place_id = #{riskPlaceId},</if>
            <if test="riskPlaceName != null  and riskPlaceName != ''">risk_place_name = #{riskPlaceName},</if>
            <if test="riskDeptId != null ">risk_dept_id = #{riskDeptId},</if>
            <if test="riskDeptName != null  and riskDeptName != ''">risk_dept_name = #{riskDeptName},</if>
            <if test="executeUserId != null ">execute_user_id = #{executeUserId},</if>
            <if test="executeUserName != null  and executeUserName != ''">execute_user_name = #{executeUserName},</if>
 
            <if test="createUserId != null ">create_user_id = #{createUserId},</if>
            <if test="createUserName != null  and createUserName != ''">create_user_name = #{createUserName},</if>
 
            <if test="startTime != null ">start_time = #{startTime},</if>
 
            <if test="checkType != null  and checkType != ''">check_type = #{checkType},</if>
 
             update_time = sysdate()
         </set>
         where job_id = #{jobId}
    </update>
     
     <insert id="insertJob" parameterType="Job" useGeneratedKeys="true" keyProperty="jobId">
         insert into tr_hidden_danger_check_job(
             <if test="jobId != null and jobId != 0">job_id,</if>
             <if test="jobName != null and jobName != ''">job_name,</if>
             <if test="jobGroup != null and jobGroup != ''">job_group,</if>
             <if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
             <if test="cronExpression != null and cronExpression != ''">cron_expression,</if>
             <if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy,</if>
             <if test="concurrent != null and concurrent != ''">concurrent,</if>
             <if test="status != null and status != ''">status,</if>
             <if test="remark != null and remark != ''">remark,</if>
             <if test="createBy != null and createBy != ''">create_by,</if>
            <if test="troubleshootTypeId != null ">troubleshoot_type_id,</if>
            <if test="troubleshootTypeName != null  and troubleshootTypeName != ''">troubleshoot_type_name,</if>
            <if test="troubleshootTypeCycleNum != null ">troubleshoot_type_cycle_num,</if>
            <if test="troubleshootTypeCycleType != null ">troubleshoot_type_cycle_type,</if>
            <if test="companyId != null ">company_id,</if>
            <if test="riskType != null  and riskType != ''">risk_type,</if>
            <if test="riskId != null ">risk_id,</if>
            <if test="riskName != null  and riskName != ''">risk_name,</if>
            <if test="riskPlaceId != null  and riskPlaceId != ''">risk_place_id,</if>
            <if test="riskPlaceName != null  and riskPlaceName != ''">risk_place_name,</if>
            <if test="riskDeptId != null ">risk_dept_id,</if>
            <if test="riskDeptName != null  and riskDeptName != ''">risk_dept_name,</if>
            <if test="executeUserId != null ">execute_user_id,</if>
            <if test="executeUserName != null  and executeUserName != ''">execute_user_name,</if>
            <if test="createUserId != null ">create_user_id,</if>
            <if test="createUserName != null  and createUserName != ''">create_user_name,</if>
            <if test="startTime != null ">start_time,</if>
 
            <if test="checkType != null  and checkType != ''">check_type,</if>
             create_time
         )values(
             <if test="jobId != null and jobId != 0">#{jobId},</if>
             <if test="jobName != null and jobName != ''">#{jobName},</if>
             <if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
             <if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
             <if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if>
             <if test="misfirePolicy != null and misfirePolicy != ''">#{misfirePolicy},</if>
             <if test="concurrent != null and concurrent != ''">#{concurrent},</if>
             <if test="status != null and status != ''">#{status},</if>
             <if test="remark != null and remark != ''">#{remark},</if>
             <if test="createBy != null and createBy != ''">#{createBy},</if>
            <if test="troubleshootTypeId != null ">#{troubleshootTypeId},</if>
            <if test="troubleshootTypeName != null  and troubleshootTypeName != ''">#{troubleshootTypeName},</if>
            <if test="troubleshootTypeCycleNum != null ">#{troubleshootTypeCycleNum},</if>
            <if test="troubleshootTypeCycleType != null ">#{troubleshootTypeCycleType},</if>
            <if test="companyId != null ">#{companyId},</if>
            <if test="riskType != null  and riskType != ''">#{riskType},</if>
            <if test="riskId != null ">#{riskId},</if>
            <if test="riskName != null  and riskName != ''">#{riskName},</if>
            <if test="riskPlaceId != null  and riskPlaceId != ''">#{riskPlaceId},</if>
            <if test="riskPlaceName != null  and riskPlaceName != ''">#{riskPlaceName},</if>
            <if test="riskDeptId != null ">#{riskDeptId},</if>
            <if test="riskDeptName != null  and riskDeptName != ''">#{riskDeptName},</if>
            <if test="executeUserId != null ">#{executeUserId},</if>
            <if test="executeUserName != null  and executeUserName != ''">#{executeUserName},</if>
            <if test="createUserId != null ">#{createUserId},</if>
            <if test="createUserName != null  and createUserName != ''">#{createUserName},</if>
            <if test="startTime != null ">#{startTime},</if>
 
            <if test="checkType != null  and checkType != ''">#{checkType},</if>
             sysdate()
         )
    </insert>
 
 
    <!--HiddenDangerCheckJob getJobById(Long jobId);-->
    <select id="getJobById" resultType="com.ruoyi.project.tr.HiddenDangerCheckJob.domain.HiddenDangerCheckJob">
        select * from tr_hidden_danger_check_job
        where id = #{jobId}
    </select>
</mapper>