郑永安
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
<?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.doublePrevention.repository.PreventCJReportRiskAnaUnitRepository">
 
    <resultMap id="BaseResultMap" type="com.gkhy.safePlatform.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"/>
    </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>
 
    <!--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>
 
</mapper>