双重预防项目-国泰新华二开定制版
16639036659
2024-06-12 a178e841dce630b39e6fada786df51b50b4c9506
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
<?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.specialCheck.mapper.TbSpecialCheckItemDangerLogMapper">
 
    <resultMap id="BaseResultMap" type="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog">
        <id property="indexId" column="index_id"/>
        <result property="id" column="id"/>
        <result property="companyCode" column="company_code"/>
 
        <result property="dangerId" column="danger_id"/>
        <result property="taskId" column="task_id"/>
        <result property="checkType" column="check_type"/>
        <result property="checkItemId" column="check_item_id"/>
        <result property="checkScoreId" column="check_score_id"/>
        <result property="checkDate" column="check_date"/>
        <result property="checkPay" column="check_pay"/>
        <result property="harmType" column="harm_type"/>
        <result property="checkName" column="check_name"/>
        <result property="checkContent" column="check_content"/>
        <result property="checkWay" column="check_way"/>
        <result property="checkBasis" column="check_basis"/>
        <result property="applicablePlace" column="applicable_place"/>
        <result property="isReject" column="is_reject"/>
        <result property="deductPoint" column="deduct_point"/>
        <result property="deductIllustrate" column="deduct_illustrate"/>
 
        <result property="deleted" column="deleted"/>
        <result property="createBy" column="create_by"/>
        <result property="createDate" column="create_date"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateDate" column="update_date"/>
        <result property="reportTime" column="report_time"/>
        <result property="reportStatus" column="report_status"/>
    </resultMap>
 
 
<!--    List<TbSpecialCheckItemDangerLog> selectSpecialCheckItemDangerLogPage(TbSpecialCheckItemDangerLogBO itemDangerLogBO);-->
    <select id="selectSpecialCheckItemDangerLogPage" resultMap="BaseResultMap">
        select * from tb_special_check_item_danger_log
        <where>
            deleted = 0
            <if test="checkWay != null">
                and check_way like concat('%',#{checkWay},'%')
            </if>
            <if test="reportStatus != null">
            and report_status = #{reportStatus}
            </if>
            order by  create_date desc
        </where>
    </select>
<!--    TbSpecialCheckItemDangerLog getSpecialCheckItemDangerLogByIndexId(Long indexId);;-->
    <select id="getSpecialCheckItemDangerLogByIndexId" resultMap="BaseResultMap">
        select * from tb_special_check_item_danger_log
        where deleted = 0 and index_id = #{indexId}
    </select>
 
<!--    TbSpecialCheckTaskLog save(TbSpecialCheckTaskLog tbSpecialCheckTaskLog);-->
    <insert id="save" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog">
        insert into tb_special_check_item_danger_log
<!--        (index_id,company_code)values(null,#{companyCode},#{hazardCode})-->
        <trim prefix="(" suffix=")" suffixOverrides=",">
            index_id,
            <if test="id != null ">id,</if>
            <if test="companyCode != null ">company_code,</if>
 
            <if test="dangerId != null ">danger_id,</if>
            <if test="taskId != null ">task_id,</if>
            <if test="checkType != null ">check_type,</if>
            <if test="checkItemId != null ">check_item_id,</if>
            <if test="checkScoreId != null ">check_score_id,</if>
            <if test="checkDate != null ">check_date,</if>
 
            <if test="checkPay != null ">check_pay,</if>
            <if test="harmType != null ">harm_type,</if>
            <if test="checkName != null ">check_name,</if>
            <if test="checkContent != null ">check_content,</if>
            <if test="checkWay != null ">check_way,</if>
            <if test="checkBasis != null ">check_basis,</if>
            <if test="applicablePlace != null ">applicable_place,</if>
            <if test="isReject != null ">is_reject,</if>
            <if test="deductPoint != null ">deduct_point,</if>
            <if test="deductIllustrate != null ">deduct_illustrate,</if>
 
            <if test="deleted != null">deleted,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createDate != null">create_date,</if>
            <if test="updateBy != null ">update_by,</if>
            <if test="updateDate != null ">update_date,</if>
            report_time,
            <if test="reportStatus != null ">report_status,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            null,
            <if test="id != null ">#{id},</if>
            <if test="companyCode != null ">#{companyCode},</if>
 
            <if test="dangerId != null ">#{dangerId},</if>
            <if test="taskId != null ">#{taskId},</if>
            <if test="checkType != null ">#{checkType},</if>
            <if test="checkItemId != null ">#{checkItemId},</if>
            <if test="checkScoreId != null ">#{checkScoreId},</if>
            <if test="checkDate != null">#{checkDate},</if>
 
            <if test="checkPay != null ">#{checkPay},</if>
            <if test="harmType != null ">#{harmType},</if>
            <if test="checkName != null ">#{checkName},</if>
            <if test="checkContent != null ">#{checkContent},</if>
            <if test="checkWay != null ">#{checkWay},</if>
            <if test="checkBasis != null">#{checkBasis},</if>
            <if test="applicablePlace != null ">#{applicablePlace},</if>
            <if test="isReject != null ">#{isReject},</if>
            <if test="deductPoint != null ">#{deductPoint},</if>
            <if test="deductIllustrate != null ">#{deductIllustrate},</if>
 
 
            <if test="deleted != null ">#{deleted},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createDate != null">#{createDate},</if>
            <if test="updateBy != null ">#{updateBy},</if>
            <if test="updateDate != null ">#{updateDate},</if>
            null,
            <if test="reportStatus != null ">#{reportStatus},</if>
        </trim>
    </insert>
 
<!-- int updateSpecialCheckItemDangerLogById(TbSpecialCheckItemDangerLogUpdateBO updateBO);-->
    <update id="updateSpecialCheckItemDangerLogById" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog">
        update tb_special_check_item_danger_log
        <set>
            <if test="dangerId != null ">
                danger_id = #{dangerId},
            </if>
            <if test="taskId != null">
                task_id = #{taskId},
            </if>
            <if test="checkType != null">
                check_type = #{checkType},
            </if>
            <if test="checkItemId != null">
                check_item_id = #{checkItemId},
            </if>
            <if test="checkScoreId != null">
                check_score_id = #{checkScoreId},
            </if>
            <if test="checkPay != null">
                check_pay = #{checkPay},
            </if>
            <if test="harmType != null">
                harm_type = #{harmType},
            </if>
            <if test="checkName != null">
                check_name = #{checkName},
            </if>
            <if test="checkContent != null">
                check_content = #{checkContent},
            </if>
            <if test="checkWay != null">
                check_way = #{checkWay},
            </if>
            <if test="checkBasis != null">
                check_basis = #{checkBasis},
            </if>
            <if test="applicablePlace != null">
                applicable_place = #{applicablePlace},
            </if>
            <if test="isReject != null">
                is_reject = #{isReject},
            </if>
            <if test="deductPoint != null">
                deduct_point = #{deductPoint},
            </if>
            <if test="deductIllustrate != null">
                deduct_illustrate = #{deductIllustrate},
            </if>
 
            <if test="checkDate != null">
                check_date = #{checkDate},
            </if>
            <if test="resultStatus != null">
                result_status = #{resultStatus},
            </if>
            <if test="reportStatus != null">
                report_status = #{reportStatus},
            </if>
            <if test="updateBy != null">
                update_by  = #{updateBy},
            </if>
            <if test="updateDate != null">
                update_date = #{updateDate},
            </if>
        </set>
        where index_id = #{indexId} and deleted = 0
    </update>
 
<!--    int deleteTbSpecialCheckItemDangerLog(TbSpecialCheckItemDangerLog tbSpecialCheckItemDangerLog);-->
    <update id="deleteTbSpecialCheckItemDangerLog" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog">
        update tb_special_check_item_danger_log
        <set>
            <if test="deleted != null ">
                deleted = #{deleted},
            </if>
            <if test="reportStatus != null">
                report_status = #{reportStatus},
            </if>
            <if test="updateBy != null">
                update_by  = #{updateBy},
            </if>
            <if test="updateDate != null">
                update_date = #{updateDate},
            </if>
        </set>
        where index_id = #{indexId}  and deleted = 0
    </update>
<!--    List<TbSpecialCheckItemDangerLog> listItemDangerReportTask();-->
    <select id="listItemDangerReportTask" resultMap="BaseResultMap">
        select * from tb_special_check_item_danger_log
        where deleted = 0 and report_status = 1
    </select>
<!--    void updateItemDangerReportStatusById(HandlerSpecialCheckReportParam handlerCJReportParam);-->
    <update id="updateCheckTaskReportStatusById" parameterType="com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog">
        update tb_special_check_item_danger_log
            report_status =  #{reportStatus},
            report_time = #{reportTime}
        where id = #{indexId}  and deleted = 0
    </update>
</mapper>