双重预防项目-国泰新华二开定制版
heheng
2025-06-24 e98eeaaa5766511fdb8e6d5e412eb1c59d1f07ce
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
<?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.riskLevel.mapper.RiskLevelMapper">
    
    <resultMap type="RiskLevel" id="RiskLevelResult">
        <result property="levelId"    column="level_id"    />
        <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="companyId"    column="company_id"    />
        <result property="methodId"    column="method_id"    />
        <result property="criterionId"    column="criterion_id"    />
        <result property="riskLevel"    column="risk_level"    />
        <result property="levelColor"    column="level_color"    />
        <result property="levelControlLevel"    column="level_control_level"    />
        <result property="levelBeginNum"    column="level_begin_num"    />
        <result property="levelEndNum"    column="level_end_num"    />
        <result property="levelOrder"    column="level_order"    />
    </resultMap>
 
    <sql id="selectRiskLevelVo">
        select level_id, create_by, create_time, update_by, update_time, remark,
        company_id, method_id, criterion_id, risk_level, level_color, level_begin_num,
        level_end_num, level_order ,level_control_level
        from tr_risk_level
    </sql>
 
    <select id="selectRiskLevelList" parameterType="RiskLevel" resultMap="RiskLevelResult">
        <include refid="selectRiskLevelVo"/>
        <where>  
            <if test="levelId != null "> and level_id = #{levelId}</if>
            <if test="createBy != null  and createBy != ''"> and create_by = #{createBy}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="companyId != null "> and company_id = #{companyId}</if>
            <if test="methodId != null "> and method_id = #{methodId}</if>
            <if test="criterionId != null "> and criterion_id = #{criterionId}</if>
            <if test="riskLevel != null  and riskLevel != ''"> and risk_level = #{riskLevel}</if>
            <if test="levelColor != null  and levelColor != ''"> and level_color = #{levelColor}</if>
            <if test="levelBeginNum != null "> and level_begin_num = #{levelBeginNum}</if>
            <if test="levelEndNum != null "> and level_end_num = #{levelEndNum}</if>
            <if test="levelOrder != null "> and level_order = #{levelOrder}</if>
        </where>
    </select>
    
    <select id="selectRiskLevelById" parameterType="Long" resultMap="RiskLevelResult">
        <include refid="selectRiskLevelVo"/>
        where level_id = #{levelId}
    </select>
        
    <insert id="insertRiskLevel" parameterType="RiskLevel">
        insert into tr_risk_level
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="levelId != null ">level_id,</if>
            <if test="createBy != null  and createBy != ''">create_by,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="updateBy != null  and updateBy != ''">update_by,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="remark != null  and remark != ''">remark,</if>
            <if test="companyId != null ">company_id,</if>
            <if test="methodId != null ">method_id,</if>
            <if test="criterionId != null ">criterion_id,</if>
            <if test="riskLevel != null  and riskLevel != ''">risk_level,</if>
            <if test="levelColor != null  and levelColor != ''">level_color,</if>
            <if test="levelBeginNum != null ">level_begin_num,</if>
            <if test="levelEndNum != null ">level_end_num,</if>
            <if test="levelOrder != null ">level_order,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="levelId != null ">#{levelId},</if>
            <if test="createBy != null  and createBy != ''">#{createBy},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="remark != null  and remark != ''">#{remark},</if>
            <if test="companyId != null ">#{companyId},</if>
            <if test="methodId != null ">#{methodId},</if>
            <if test="criterionId != null ">#{criterionId},</if>
            <if test="riskLevel != null  and riskLevel != ''">#{riskLevel},</if>
            <if test="levelColor != null  and levelColor != ''">#{levelColor},</if>
            <if test="levelBeginNum != null ">#{levelBeginNum},</if>
            <if test="levelEndNum != null ">#{levelEndNum},</if>
            <if test="levelOrder != null ">#{levelOrder},</if>
         </trim>
    </insert>
 
    <update id="updateRiskLevel" parameterType="RiskLevel">
        update tr_risk_level
        <trim prefix="SET" suffixOverrides=",">
            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
            <if test="updateTime != null ">update_time = #{updateTime},</if>
            <if test="remark != null  and remark != ''">remark = #{remark},</if>
            <if test="companyId != null ">company_id = #{companyId},</if>
            <if test="methodId != null ">method_id = #{methodId},</if>
            <if test="criterionId != null ">criterion_id = #{criterionId},</if>
            <if test="riskLevel != null  and riskLevel != ''">risk_level = #{riskLevel},</if>
            <if test="levelColor != null  and levelColor != ''">level_color = #{levelColor},</if>
            <if test="levelBeginNum != null ">level_begin_num = #{levelBeginNum},</if>
            <if test="levelEndNum != null ">level_end_num = #{levelEndNum},</if>
            <if test="levelOrder != null ">level_order = #{levelOrder},</if>
        </trim>
        where level_id = #{levelId}
    </update>
 
    <delete id="deleteRiskLevelById" parameterType="Long">
        delete from tr_risk_level where level_id = #{levelId}
    </delete>
 
    <delete id="deleteRiskLevelByIds" parameterType="String">
        delete from tr_risk_level where level_id in 
        <foreach item="levelId" collection="array" open="(" separator="," close=")">
            #{levelId}
        </foreach>
    </delete>
    
</mapper>