1
13693261870
2024-11-22 54e0b93cde8a5358ae57aee2d3b3ff1c68c1a86c
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
<?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.se.system.mapper.SysCtrlLogMapper">
    
    <resultMap type="SysCtrlLog" id="SysCtrlLogResult">
        <result property="logId"    column="log_id"    />
        <result property="title"    column="title"    />
        <result property="type"    column="type"    />
        <result property="ip"    column="ip"    />
        <result property="url"    column="url"    />
        <result property="method"    column="method"    />
        <result property="args"    column="args"    />
        <result property="msg"    column="msg"    />
        <result property="oper"    column="oper"    />
        <result property="time"    column="time"    />
        <result property="remark"    column="remark"    />
    </resultMap>
 
    <sql id="selectSysCtrlLogVo">
        select log_id, title, type, ip, url, method, args, msg, oper, time, remark from sys_ctrl_log
    </sql>
 
    <select id="selectSysCtrlLogList" parameterType="SysCtrlLog" resultMap="SysCtrlLogResult">
        <include refid="selectSysCtrlLogVo"/>
        <where>  
            <if test="title != null  and title != ''"> and title = #{title}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="ip != null  and ip != ''"> and ip = #{ip}</if>
            <if test="url != null  and url != ''"> and url = #{url}</if>
            <if test="method != null  and method != ''"> and method = #{method}</if>
            <if test="args != null  and args != ''"> and args = #{args}</if>
            <if test="msg != null  and msg != ''"> and msg = #{msg}</if>
            <if test="oper != null  and oper != ''"> and oper = #{oper}</if>
            <if test="time != null "> and time = #{time}</if>
        </where>
    </select>
    
    <select id="selectSysCtrlLogByLogId" parameterType="Long" resultMap="SysCtrlLogResult">
        <include refid="selectSysCtrlLogVo"/>
        where log_id = #{logId}
    </select>
 
    <insert id="insertSysCtrlLog" parameterType="SysCtrlLog" useGeneratedKeys="true" keyProperty="logId">
        insert into sys_ctrl_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="title != null and title != ''">title,</if>
            <if test="type != null">type,</if>
            <if test="ip != null">ip,</if>
            <if test="url != null">url,</if>
            <if test="method != null">method,</if>
            <if test="args != null">args,</if>
            <if test="msg != null">msg,</if>
            <if test="oper != null">oper,</if>
            <if test="time != null">time,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="title != null and title != ''">#{title},</if>
            <if test="type != null">#{type},</if>
            <if test="ip != null">#{ip},</if>
            <if test="url != null">#{url},</if>
            <if test="method != null">#{method},</if>
            <if test="args != null">#{args},</if>
            <if test="msg != null">#{msg},</if>
            <if test="oper != null">#{oper},</if>
            <if test="time != null">#{time},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>
 
    <update id="updateSysCtrlLog" parameterType="SysCtrlLog">
        update sys_ctrl_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="type != null">type = #{type},</if>
            <if test="ip != null">ip = #{ip},</if>
            <if test="url != null">url = #{url},</if>
            <if test="method != null">method = #{method},</if>
            <if test="args != null">args = #{args},</if>
            <if test="msg != null">msg = #{msg},</if>
            <if test="oper != null">oper = #{oper},</if>
            <if test="time != null">time = #{time},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where log_id = #{logId}
    </update>
 
    <delete id="deleteSysCtrlLogByLogId" parameterType="Long">
        delete from sys_ctrl_log where log_id = #{logId}
    </delete>
 
    <delete id="deleteSysCtrlLogByLogIds" parameterType="String">
        delete from sys_ctrl_log where log_id in 
        <foreach item="logId" collection="array" open="(" separator="," close=")">
            #{logId}
        </foreach>
    </delete>
</mapper>