dcs před 7 měsíci
rodič
revize
df69632ced

+ 1 - 1
virgo.api/src/main/java/com/bosshand/virgo/api/operate/model/OperateFlowData.java

@@ -44,7 +44,7 @@ public class OperateFlowData {
 
     private String createdByUserName;
 
-    private String createdByUserPortrait;;
+    private String createdByUserPortrait;
 
     private String document;
 

+ 20 - 0
virgo.core/src/main/java/com/bosshand/virgo/core/model/OperationLog.java

@@ -29,6 +29,10 @@ public class OperationLog {
      */
     private long userId;
 
+    private String userName;
+
+    private String userPortrait;
+
     /**
      * 模块
      */
@@ -89,6 +93,22 @@ public class OperationLog {
         this.userId = userId;
     }
 
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getUserPortrait() {
+        return userPortrait;
+    }
+
+    public void setUserPortrait(String userPortrait) {
+        this.userPortrait = userPortrait;
+    }
+
     public String getModule() {
         return module;
     }

+ 15 - 6
virgo.core/src/main/resources/mapper/OperationLogMapper.xml

@@ -10,6 +10,8 @@
         <result column="organizationId" property="organizationId"/>
         <result column="projectId" property="projectId"/>
         <result column="userId" property="userId"/>
+        <result column="userName" property="userName"/>
+        <result column="userPortrait" property="userPortrait"/>
         <result column="url" property="url"/>
         <result column="module" property="module"/>
         <result column="operation" property="operation"/>
@@ -21,8 +23,13 @@
         VALUES (now(), #{organizationId}, #{projectId}, #{userId}, #{url}, #{module}, #{operation}, #{data})
     </insert>
 
+    <sql id="query">
+        select a.*, b.name as userName, b.portrait as userPortrait from operation_log a left join mgr_user b on a.userId = b.id
+    </sql>
+
     <select id="get" resultMap="result">
-        select * from operation_log where id = #{id}
+        <include refid="query"/>
+        where a.id = #{id}
     </select>
 
     <select id="getTotalCount" parameterType="com.bosshand.virgo.core.model.OperationLog" resultType="Integer">
@@ -31,17 +38,19 @@
             <if test="organizationId!=0">and organizationId=#{organizationId}</if>
             <if test="projectId!=0">and projectId=#{projectId}</if>
             <if test="userId!=0">and userId=#{userId}</if>
+            <if test="module!=null">and module=#{module}</if>
         </where>
     </select>
 
     <select id="getLimit" resultMap="result">
-        SELECT * FROM operation_log
+        <include refid="query"/>
         <where>
-            <if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
-            <if test="p.projectId!=0">and projectId=#{p.projectId}</if>
-            <if test="p.userId!=0">and userId=#{p.userId}</if>
+            <if test="p.organizationId!=0">and a.organizationId=#{p.organizationId}</if>
+            <if test="p.projectId!=0">and a.projectId=#{p.projectId}</if>
+            <if test="p.userId!=0">and a.userId=#{p.userId}</if>
+            <if test="p.module!=null">and a.module=#{p.module}</if>
         </where>
-        order by date desc
+        order by a.date desc
         limit #{currIndex} , #{pageSize}
     </select>