双重预防项目-国泰新华二开定制版
heheng
2025-06-25 f8606e6c37bbc815b59d0452fd7c3ecb0dcb6cef
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
<?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.hiddenTroubleType.mapper.HiddenTroubleTypeMapper">
    
    <resultMap type="HiddenTroubleType" id="HiddenTroubleTypeResult">
        <result property="hiddenTroubleTypeId"    column="hidden_trouble_type_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="hiddenTroubleName"    column="hidden_trouble_name"    />
        <result property="companyId"    column="company_id"    />
    </resultMap>
 
    <sql id="selectHiddenTroubleTypeVo">
        select hidden_trouble_type_id, create_by, create_time, update_by, update_time, remark, hidden_trouble_name, company_id from tr_hidden_trouble_type
    </sql>
 
    <select id="selectHiddenTroubleTypeList" parameterType="HiddenTroubleType" resultMap="HiddenTroubleTypeResult">
        <include refid="selectHiddenTroubleTypeVo"/>
        <where>  
            <if test="hiddenTroubleTypeId != null "> and hidden_trouble_type_id = #{hiddenTroubleTypeId}</if>
            <if test="createBy != null  and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
            <if test="beginCreateTime != null "> and create_time &gt;= #{beginCreateTime}</if>
            <if test="endCreateTime != null "> and create_time &lt;= #{endCreateTime}</if>
            <if test="hiddenTroubleName != null  and hiddenTroubleName != ''"> and hidden_trouble_name like concat('%', #{hiddenTroubleName}, '%')</if>
            <if test="companyId != null "> and company_id = #{companyId}</if>
        </where>
    </select>
    
    <select id="selectHiddenTroubleTypeById" parameterType="Long" resultMap="HiddenTroubleTypeResult">
        <include refid="selectHiddenTroubleTypeVo"/>
        where hidden_trouble_type_id = #{hiddenTroubleTypeId}
    </select>
        
    <insert id="insertHiddenTroubleType" parameterType="HiddenTroubleType">
        insert into tr_hidden_trouble_type
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="hiddenTroubleTypeId != null ">hidden_trouble_type_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="hiddenTroubleName != null  and hiddenTroubleName != ''">hidden_trouble_name,</if>
            <if test="companyId != null ">company_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="hiddenTroubleTypeId != null ">#{hiddenTroubleTypeId},</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="hiddenTroubleName != null  and hiddenTroubleName != ''">#{hiddenTroubleName},</if>
            <if test="companyId != null ">#{companyId},</if>
         </trim>
    </insert>
 
    <update id="updateHiddenTroubleType" parameterType="HiddenTroubleType">
        update tr_hidden_trouble_type
        <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="hiddenTroubleName != null  and hiddenTroubleName != ''">hidden_trouble_name = #{hiddenTroubleName},</if>
            <if test="companyId != null ">company_id = #{companyId},</if>
        </trim>
        where hidden_trouble_type_id = #{hiddenTroubleTypeId}
    </update>
 
    <delete id="deleteHiddenTroubleTypeById" parameterType="Long">
        delete from tr_hidden_trouble_type where hidden_trouble_type_id = #{hiddenTroubleTypeId}
    </delete>
 
    <delete id="deleteHiddenTroubleTypeByIds" parameterType="String">
        delete from tr_hidden_trouble_type where hidden_trouble_type_id in 
        <foreach item="hiddenTroubleTypeId" collection="array" open="(" separator="," close=")">
            #{hiddenTroubleTypeId}
        </foreach>
    </delete>
    
</mapper>