mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-1123: Add RecordMapper support for searching history limited by the identifier of a record.
This commit is contained in:
@@ -106,28 +106,35 @@
|
||||
FROM guacamole_connection_history
|
||||
|
||||
<!-- Search terms -->
|
||||
<foreach collection="terms" item="term"
|
||||
open="WHERE " separator=" AND ">
|
||||
(
|
||||
<where>
|
||||
|
||||
<if test="identifier != null">
|
||||
guacamole_connection_history.connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
</if>
|
||||
|
||||
<foreach collection="terms" item="term" open=" AND " separator=" AND ">
|
||||
(
|
||||
|
||||
guacamole_connection_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||
)
|
||||
|
||||
OR guacamole_connection_history.connection_id IN (
|
||||
SELECT connection_id
|
||||
FROM guacamole_connection
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
guacamole_connection_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0
|
||||
)
|
||||
|
||||
OR guacamole_connection_history.connection_id IN (
|
||||
SELECT connection_id
|
||||
FROM guacamole_connection
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</foreach>
|
||||
|
||||
</where>
|
||||
|
||||
<!-- Bind sort property enum values for sake of readability -->
|
||||
<bind name="START_DATE" value="@org.apache.guacamole.net.auth.ActivityRecordSet$SortableProperty@START_DATE"/>
|
||||
@@ -184,31 +191,38 @@
|
||||
AND guacamole_user_permission.permission = 'READ'
|
||||
|
||||
<!-- Search terms -->
|
||||
<foreach collection="terms" item="term"
|
||||
open="WHERE " separator=" AND ">
|
||||
(
|
||||
<where>
|
||||
|
||||
<if test="identifier != null">
|
||||
guacamole_connection_history.connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
</if>
|
||||
|
||||
<foreach collection="terms" item="term" open=" AND " separator=" AND ">
|
||||
(
|
||||
|
||||
guacamole_connection_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
AND guacamole_entity.type = 'USER'::guacamole_entity_type
|
||||
)
|
||||
|
||||
OR guacamole_connection_history.connection_id IN (
|
||||
SELECT connection_id
|
||||
FROM guacamole_connection
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
guacamole_connection_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
AND guacamole_entity.type = 'USER'::guacamole_entity_type
|
||||
)
|
||||
</foreach>
|
||||
|
||||
OR guacamole_connection_history.connection_id IN (
|
||||
SELECT connection_id
|
||||
FROM guacamole_connection
|
||||
WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</where>
|
||||
|
||||
<!-- Bind sort property enum values for sake of readability -->
|
||||
<bind name="START_DATE" value="@org.apache.guacamole.net.auth.ActivityRecordSet$SortableProperty@START_DATE"/>
|
||||
|
@@ -105,25 +105,32 @@
|
||||
FROM guacamole_user_history
|
||||
|
||||
<!-- Search terms -->
|
||||
<foreach collection="terms" item="term"
|
||||
open="WHERE " separator=" AND ">
|
||||
(
|
||||
<where>
|
||||
|
||||
<if test="username != null">
|
||||
guacamole_user_history.username = #{username,jdbcType=VARCHAR}
|
||||
</if>
|
||||
|
||||
<foreach collection="terms" item="term" open=" AND " separator=" AND ">
|
||||
(
|
||||
|
||||
guacamole_user_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
AND guacamole_entity.type = 'USER'::guacamole_entity_type),
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
guacamole_user_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
AND guacamole_entity.type = 'USER'::guacamole_entity_type),
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</foreach>
|
||||
|
||||
</where>
|
||||
|
||||
<!-- Bind sort property enum values for sake of readability -->
|
||||
<bind name="START_DATE" value="@org.apache.guacamole.net.auth.ActivityRecordSet$SortableProperty@START_DATE"/>
|
||||
@@ -164,25 +171,31 @@
|
||||
AND guacamole_user_permission.permission = 'READ'
|
||||
|
||||
<!-- Search terms -->
|
||||
<foreach collection="terms" item="term"
|
||||
open="WHERE " separator=" AND ">
|
||||
(
|
||||
<where>
|
||||
<if test="username != null">
|
||||
guacamole_entity.name = #{username,jdbcType=VARCHAR}
|
||||
</if>
|
||||
|
||||
<foreach collection="terms" item="term" open=" AND " separator=" AND ">
|
||||
(
|
||||
|
||||
guacamole_user_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
AND guacamole_entity.type = 'USER'::guacamole_entity_type
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
guacamole_user_history.user_id IN (
|
||||
SELECT user_id
|
||||
FROM guacamole_user
|
||||
JOIN guacamole_entity ON guacamole_user.entity_id = guacamole_entity.entity_id
|
||||
WHERE
|
||||
POSITION(#{term.term,jdbcType=VARCHAR} IN guacamole_entity.name) > 0
|
||||
AND guacamole_entity.type = 'USER'::guacamole_entity_type
|
||||
)
|
||||
|
||||
<if test="term.startDate != null and term.endDate != null">
|
||||
OR start_date BETWEEN #{term.startDate,jdbcType=TIMESTAMP} AND #{term.endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</foreach>
|
||||
|
||||
</where>
|
||||
|
||||
<!-- Bind sort property enum values for sake of readability -->
|
||||
<bind name="START_DATE" value="@org.apache.guacamole.net.auth.ActivityRecordSet$SortableProperty@START_DATE"/>
|
||||
|
Reference in New Issue
Block a user