给日志模块增加按租户查询的参数

This commit is contained in:
季圣华
2023-12-14 22:56:36 +08:00
parent c4075704b1
commit 899c75ef1c
4 changed files with 28 additions and 16 deletions

View File

@@ -10,6 +10,7 @@
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'
left join jsh_tenant t on l.tenant_id=t.tenant_id
where 1=1
<if test="operation != null">
<bind name="bindOperation" value="'%'+operation+'%'"/>
@@ -23,8 +24,11 @@
<bind name="bindClientIp" value="'%'+clientIp+'%'"/>
and l.client_ip like #{bindClientIp}
</if>
<if test="status != null">
and l.status=#{status}
<if test="tenantLoginName != null">
and t.login_name = #{tenantLoginName}
</if>
<if test="tenantType != null">
and t.type = #{tenantType}
</if>
<if test="beginTime != null">
and l.create_time &gt;= #{beginTime}
@@ -46,6 +50,7 @@
COUNT(1)
FROM jsh_log l
left join jsh_user u on l.user_id = u.id and ifnull(u.Status,'0') !='1'
left join jsh_tenant t on l.tenant_id=t.tenant_id
WHERE 1=1
<if test="operation != null">
<bind name="bindOperation" value="'%'+operation+'%'"/>
@@ -59,8 +64,11 @@
<bind name="bindClientIp" value="'%'+clientIp+'%'"/>
and l.client_ip like #{bindClientIp}
</if>
<if test="status != null">
and l.status = #{status}
<if test="tenantLoginName != null">
and t.login_name = #{tenantLoginName}
</if>
<if test="tenantType != null">
and t.type = #{tenantType}
</if>
<if test="beginTime != null">
and l.create_time &gt;= #{beginTime}