双重预防项目-国泰新华二开定制版
heheng
2 天以前 8e3dd5851dcedef5b21858dc1cfd5d11f1965ce6
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
<?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.PreventRiskJobAndMeasureRepository" >
 
    <resultMap id="BaseResultMap" type="com.ruoyi.doublePrevention.entity.PreventRiskJobAndMeasure">
        <id column="id" property="id"/>
        <result column="job_id" property="jobId"/>
        <result column="job_uuid" property="jobUuid" />
        <result column="measure_id" property="measureId"/>
        <result column="measure_uuid" property="measureUuid" />
        <result column="report_time" property="reportTime"/>
        <result column="update_report_data_time" property="updateReportDataTime"/>
        <result column="report_status" property="reportStatus"/>
        <result column="report_switch" property="reportSwitch"/>
    </resultMap>
 
<!--    int insertJobAndMeasure(PreventRiskJobAndMeasure jobAndMeasure);-->
    <insert id="insertJobAndMeasure">
        insert into prevent_risk_job_and_measure
        values(null, #{jobId}, #{jobUuid}, #{measureId}, #{measureUuid}, #{reportTime}, #{updateReportDataTime}, #{reportStatus}, #{reportSwitch})
    </insert>
 
<!--    PreventRiskJobAndMeasure getJobAndMeasureByJobId(Long jobId);-->
    <select id="getJobAndMeasureByJobId" resultMap="BaseResultMap">
        select * from prevent_risk_job_and_measure
        where job_id = #{jobId}
        limit 1
    </select>
    <select id="getJobAndMeasureListByJobId" resultMap="BaseResultMap">
        select * from prevent_risk_job_and_measure
        where job_id = #{jobId}
    </select>
 
<!--    int deleteJobAndMeasure(Long jobId);-->
    <delete id="deleteJobAndMeasure">
        delete from prevent_risk_job_and_measure
        where job_id = #{jobId}
    </delete>
<!--    PreventRiskJobAndMeasure getJobAndMeasure(Long jobId);-->
 
 
<!--    List<PreventRiskJobAndMeasure> listReportWork();-->
    <select id="listReportWork" resultMap="BaseResultMap">
        select * from prevent_risk_job_and_measure
        where report_switch = 0 and (update_report_data_time > report_time or report_time is null)
    </select>
 
<!--    List<PreventRiskJobAndMeasure> getMeasureListByJobId(Long jobId);-->
    <select id="getMeasureListByJobId" resultMap="BaseResultMap">
        select * from prevent_risk_job_and_measure
        where job_id = #{jobId}
    </select>
 
<!--    int updateWorkReportStatus(HandlerReportParam handlerReportParam);-->
    <update id="updateWorkReportStatus">
        update prevent_risk_job_and_measure set
            report_status =  #{reportStatus},
            report_time = #{reportTime}
        where id = #{id}
    </update>
    <!--    List<PreventRiskJobAndMeasure> listReportWork();-->
    <select id="listReportWorkTest" resultMap="BaseResultMap">
        select * from prevent_risk_job_and_measure
<!--        where job_id in (43,47,50,53,56,59,63,65,68,71,75,77,81)-->
<!--        where job_id in (44,46,49,52,55,58,61,64,67,70,73,76,79)-->
        where job_id in (45,48,51,54,57,60,62,66,69,72,74,78,80)
    </select>
<!--    List<PreventRiskJobAndMeasure> getRectifyJobData(Long jobId);-->
    <select id="getRectifyJobData" resultMap="BaseResultMap">
        select * from prevent_risk_job_and_measure
        where job_id = #{jobId}
    </select>
</mapper>