Pārlūkot izejas kodu

显示操作日志姓名

lamphua 10 mēnešus atpakaļ
vecāks
revīzija
97c7a83487

+ 12
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java Parādīt failu

43
     private Integer operatorType;
43
     private Integer operatorType;
44
 
44
 
45
     /** 操作人员 */
45
     /** 操作人员 */
46
-    @Excel(name = "操作人员")
47
     private String operName;
46
     private String operName;
47
+    @Excel(name = "操作人员")
48
+    private String nickName;
48
 
49
 
49
     /** 部门名称 */
50
     /** 部门名称 */
50
     @Excel(name = "部门名称")
51
     @Excel(name = "部门名称")
172
         return deptName;
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
     public void setDeptName(String deptName)
186
     public void setDeptName(String deptName)
176
     {
187
     {
177
         this.deptName = deptName;
188
         this.deptName = deptName;

+ 13
- 11
oa-back/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml Parādīt failu

12
 		<result property="requestMethod"  column="request_method" />
12
 		<result property="requestMethod"  column="request_method" />
13
 		<result property="operatorType"   column="operator_type"  />
13
 		<result property="operatorType"   column="operator_type"  />
14
 		<result property="operName"       column="oper_name"      />
14
 		<result property="operName"       column="oper_name"      />
15
+		<result property="nickName"       column="nick_name"         />
15
 		<result property="deptName"       column="dept_name"      />
16
 		<result property="deptName"       column="dept_name"      />
16
 		<result property="operUrl"        column="oper_url"       />
17
 		<result property="operUrl"        column="oper_url"       />
17
 		<result property="operIp"         column="oper_ip"        />
18
 		<result property="operIp"         column="oper_ip"        />
25
 	</resultMap>
26
 	</resultMap>
26
 
27
 
27
 	<sql id="selectOperLogVo">
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
     </sql>
32
     </sql>
31
     
33
     
32
 	<insert id="insertOperlog" parameterType="SysOperLog">
34
 	<insert id="insertOperlog" parameterType="SysOperLog">
38
 		<include refid="selectOperLogVo"/>
40
 		<include refid="selectOperLogVo"/>
39
 		<where>
41
 		<where>
40
 			<if test="operIp != null and operIp != ''">
42
 			<if test="operIp != null and operIp != ''">
41
-				AND oper_ip like concat('%', #{operIp}, '%')
43
+				AND o.oper_ip like concat('%', #{operIp}, '%')
42
 			</if>
44
 			</if>
43
 			<if test="title != null and title != ''">
45
 			<if test="title != null and title != ''">
44
-				AND title like concat('%', #{title}, '%')
46
+				AND o.title like concat('%', #{title}, '%')
45
 			</if>
47
 			</if>
46
 			<if test="businessType != null">
48
 			<if test="businessType != null">
47
-				AND business_type = #{businessType}
49
+				AND o.business_type = #{businessType}
48
 			</if>
50
 			</if>
49
 			<if test="businessTypes != null and businessTypes.length > 0">
51
 			<if test="businessTypes != null and businessTypes.length > 0">
50
-			    AND business_type in
52
+			    AND o.business_type in
51
 			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
53
 			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
52
 		 			#{businessType}
54
 		 			#{businessType}
53
 		        </foreach> 
55
 		        </foreach> 
54
 			</if>
56
 			</if>
55
 			<if test="status != null">
57
 			<if test="status != null">
56
-				AND status = #{status}
58
+				AND o.status = #{status}
57
 			</if>
59
 			</if>
58
 			<if test="operName != null and operName != ''">
60
 			<if test="operName != null and operName != ''">
59
-				AND oper_name like concat('%', #{operName}, '%')
61
+				AND o.oper_name like concat('%', #{operName}, '%')
60
 			</if>
62
 			</if>
61
 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
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
 			</if>
65
 			</if>
64
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
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
 			</if>
68
 			</if>
67
 		</where>
69
 		</where>
68
-		order by oper_id desc
70
+		order by o.oper_id desc
69
 	</select>
71
 	</select>
70
 	
72
 	
71
 	<delete id="deleteOperLogByIds" parameterType="Long">
73
 	<delete id="deleteOperLogByIds" parameterType="Long">

Notiek ielāde…
Atcelt
Saglabāt