lamphua 10 месяцев назад
Родитель
Сommit
97c7a83487

+ 12
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java Просмотреть файл

@@ -43,8 +43,9 @@ public class SysOperLog extends BaseEntity
43 43
     private Integer operatorType;
44 44
 
45 45
     /** 操作人员 */
46
-    @Excel(name = "操作人员")
47 46
     private String operName;
47
+    @Excel(name = "操作人员")
48
+    private String nickName;
48 49
 
49 50
     /** 部门名称 */
50 51
     @Excel(name = "部门名称")
@@ -172,6 +173,16 @@ public class SysOperLog extends BaseEntity
172 173
         return deptName;
173 174
     }
174 175
 
176
+    public String getNickName()
177
+    {
178
+        return nickName;
179
+    }
180
+
181
+    public void setNickName(String nickName)
182
+    {
183
+        this.nickName = nickName;
184
+    }
185
+
175 186
     public void setDeptName(String deptName)
176 187
     {
177 188
         this.deptName = deptName;

+ 13
- 11
oa-back/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml Просмотреть файл

@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
12 12
 		<result property="requestMethod"  column="request_method" />
13 13
 		<result property="operatorType"   column="operator_type"  />
14 14
 		<result property="operName"       column="oper_name"      />
15
+		<result property="nickName"       column="nick_name"         />
15 16
 		<result property="deptName"       column="dept_name"      />
16 17
 		<result property="operUrl"        column="oper_url"       />
17 18
 		<result property="operIp"         column="oper_ip"        />
@@ -25,8 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
25 26
 	</resultMap>
26 27
 
27 28
 	<sql id="selectOperLogVo">
28
-        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time
29
-        from sys_oper_log
29
+        select o.oper_id, o.title, o.business_type, o.method, o.request_method, o.operator_type, o.oper_name, o.dept_name, o.oper_url, o.oper_ip, o.oper_location, o.oper_param, o.json_result, o.status, o.error_msg, o.oper_time, o.cost_time, u.nick_name
30
+        from sys_oper_log as o
31
+	 	left join sys_user as u on u.user_name = o.oper_name
30 32
     </sql>
31 33
     
32 34
 	<insert id="insertOperlog" parameterType="SysOperLog">
@@ -38,34 +40,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
38 40
 		<include refid="selectOperLogVo"/>
39 41
 		<where>
40 42
 			<if test="operIp != null and operIp != ''">
41
-				AND oper_ip like concat('%', #{operIp}, '%')
43
+				AND o.oper_ip like concat('%', #{operIp}, '%')
42 44
 			</if>
43 45
 			<if test="title != null and title != ''">
44
-				AND title like concat('%', #{title}, '%')
46
+				AND o.title like concat('%', #{title}, '%')
45 47
 			</if>
46 48
 			<if test="businessType != null">
47
-				AND business_type = #{businessType}
49
+				AND o.business_type = #{businessType}
48 50
 			</if>
49 51
 			<if test="businessTypes != null and businessTypes.length > 0">
50
-			    AND business_type in
52
+			    AND o.business_type in
51 53
 			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
52 54
 		 			#{businessType}
53 55
 		        </foreach> 
54 56
 			</if>
55 57
 			<if test="status != null">
56
-				AND status = #{status}
58
+				AND o.status = #{status}
57 59
 			</if>
58 60
 			<if test="operName != null and operName != ''">
59
-				AND oper_name like concat('%', #{operName}, '%')
61
+				AND o.oper_name like concat('%', #{operName}, '%')
60 62
 			</if>
61 63
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
62
-				AND oper_time &gt;= #{params.beginTime}
64
+				AND o.oper_time &gt;= #{params.beginTime}
63 65
 			</if>
64 66
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
65
-				AND oper_time &lt;= #{params.endTime}
67
+				AND o.oper_time &lt;= #{params.endTime}
66 68
 			</if>
67 69
 		</where>
68
-		order by oper_id desc
70
+		order by o.oper_id desc
69 71
 	</select>
70 72
 	
71 73
 	<delete id="deleteOperLogByIds" parameterType="Long">

Загрузка…
Отмена
Сохранить