|
@@ -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>
|
|
|
|