优化日志查询接口

This commit is contained in:
季圣华
2021-11-17 00:02:58 +08:00
parent 6c92337f45
commit 6f2bcf7f08
5 changed files with 28 additions and 15 deletions

View File

@@ -3,10 +3,11 @@
<mapper namespace="com.jsh.erp.datasource.mappers.LogMapperEx">
<resultMap extends="com.jsh.erp.datasource.mappers.LogMapper.BaseResultMap" id="ResultExMap" type="com.jsh.erp.datasource.vo.LogVo4List">
<result column="userName" jdbcType="VARCHAR" property="userName" />
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
</resultMap>
<select id="selectByConditionLog" parameterType="com.jsh.erp.datasource.entities.LogExample" resultMap="ResultExMap">
select l.*,u.username userName
select l.*,u.login_name,u.username userName
FROM jsh_log l
left join jsh_user u on l.user_id = u.id and ifnull(u.Status,'0') !='1'
where 1=1
@@ -14,8 +15,9 @@
<bind name="bindOperation" value="'%'+operation+'%'"/>
and l.operation like #{bindOperation}
</if>
<if test="userId != null">
and l.user_id=#{userId}
<if test="userInfo != null">
<bind name="bindUserInfo" value="'%'+userInfo+'%'"/>
and (u.username like #{bindUserInfo} or u.login_name like #{bindUserInfo})
</if>
<if test="clientIp != null">
<bind name="bindClientIp" value="'%'+clientIp+'%'"/>
@@ -49,8 +51,9 @@
<bind name="bindOperation" value="'%'+operation+'%'"/>
and l.operation like #{bindOperation}
</if>
<if test="userId != null">
and l.user_id=#{userId}
<if test="userInfo != null">
<bind name="bindUserInfo" value="'%'+userInfo+'%'"/>
and (u.username like #{bindUserInfo} or u.login_name like #{bindUserInfo})
</if>
<if test="clientIp != null">
<bind name="bindClientIp" value="'%'+clientIp+'%'"/>