双重预防项目-国泰新华二开定制版
heheng
2025-06-19 af6d33f7c16b121538a6cdd417728e03c4ad0ef1
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
<?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.doublePrevention.repository.PreventCJReportRiskAnaUnitRepository">
 
    <resultMap id="BaseResultMap" type="com.ruoyi.doublePrevention.entity.CJReport.PreventCJReportRiskAnaUnit">
        <id column="index_id"  property="indexId"/>
        <result column="id" property="id"/>
        <result column="company_code" property="companyCode"/>
        <result column="deleted" property="deleted"/>
        <result column="create_date" property="createDate"/>
        <result column="create_by" property="createBy"/>
        <result column="update_date" property="updateDate"/>
        <result column="update_by" property="updateBy"/>
        <result column="report_status" property="reportStatus"/>
        <result column="report_time" property="reportTime"/>
        <result column="data_source" property="dataSource"/>
        <result column="risk_unit_name" property="riskUnitName"/>
        <result column="hazard_code" property="hazardCode"/>
        <result column="hazard_dep" property="hazardDep"/>
        <result column="hazard_liable_person" property="hazardLiablePerson"/>
        <result column="risk_unit_id" property="riskUnitId"/>
        <result column="zhun_report_status" property="zhunReportStatus"/>
    </resultMap>
 
    <!--IPage<PreventRiskAnaUnit> getReportRiskUnitPage(Page<Object> page, PreReportRiskUnitQueryReqDTO queryReqDTO);-->
    <select id="getReportRiskUnitPage" resultMap="BaseResultMap">
        select * from
        prevent_cj_report_risk_ana_unit
        <where>
            1 = 1
            <if test="queryReqDTO.riskUnitName != null">
                and liable_person_id = #{queryReqDTO.riskUnitName}
            </if>
            <if test="queryReqDTO.hazardDep != null">
                and liable_dep_id = #{queryReqDTO.hazardDep}
            </if>
            <if test="queryReqDTO.hazardLiablePerson != null">
                and risk_unit_name = #{queryReqDTO.hazardLiablePerson}
            </if>
        </where>
    </select>
 
    <!--List<PreventReportRiskAnaUnit> listReportUnitDate();-->
    <select id="listReportUnitDate" resultMap="BaseResultMap">
        select * from prevent_cj_report_risk_ana_unit
        where report_status = 1
        limit 200
    </select>
 
 
    <select id="listReportUnitDateHuaiDong" resultMap="BaseResultMap">
        select * from prevent_cj_report_risk_ana_unit
        where zhun_report_status = 1 and deleted = 0 and hazard_code is not null  and hazard_code LIKE '6523%'
            limit 50
    </select>
 
    <!--int updateReportStatus();-->
    <update id="updateReportStatus">
        update prevent_cj_report_risk_ana_unit set
            report_status =  #{reportStatus},
            report_time = #{reportTime}
        where risk_unit_id = #{id}
    </update>
 
    <!--int updateCJReportStatusById(HandlerCJReportParam handlerCJReportParam);-->
    <update id="updateCJReportStatusById">
        update prevent_cj_report_risk_ana_unit set
        report_status =  #{reportStatus},
        report_time = #{reportTime}
        where id = #{id}
    </update>
 
 
    <update id="updateHDReportStatusById">
        update prevent_cj_report_risk_ana_unit set
                                                   zhun_report_status =  #{zhunReportStatus},
                                                   zhun_report_time = #{zhunReportTime}
        where id = #{id}
    </update>
 
<!--    int insertUnitList(PreventCJReportRiskAnaUnit unit);-->
    <insert id="insertUnitList">
        insert into prevent_cj_report_risk_ana_unit
        values(null, #{id}, #{companyCode}, #{deleted}, #{createDate}, #{createBy}, #{updateDate}, #{updateBy}
        , #{riskUnitName}, #{hazardCode}, #{hazardDep}, #{hazardLiablePerson}
        , #{reportStatus}, #{reportTime}, #{dataSource}, #{riskUnitId})
    </insert>
 
</mapper>