u.uuid as uuid,
u.login as login,
u.name as name,
u.email as email,
u.active as "active",
u.salt as "salt",
u.crypted_password as "cryptedPassword",
u.hash_method as "hashMethod",
u.external_id as "externalId",
u.external_login as "externalLogin",
u.external_identity_provider as "externalIdentityProvider",
u.user_local as "local",
u.reset_password as "resetPassword",
u.homepage_type as "homepageType",
u.homepage_parameter as "homepageParameter",
u.last_connection_date as "lastConnectionDate",
u.last_sonarlint_connection as "lastSonarlintConnectionDate",
u.created_at as "createdAt",
u.updated_at as "updatedAt"
sa.scm_account as "scm_account",
left outer join scm_accounts sa on
sa.user_uuid = u.uuid
SELECT
FROM users u
u.uuid,
u.login,
u.name,
u.email,
u.active,
u.salt,
u.crypted_password,
u.hash_method,
u.external_id,
u.external_login,
u.external_identity_provider,
u.user_local,
u.reset_password,
u.homepage_type,
u.homepage_parameter,
u.last_connection_date,
u.last_sonarlint_connection,
u.created_at,
u.updated_at
1=1
AND u.active=#{query.isActive, jdbcType=BOOLEAN}
AND u.uuid in
#{userUuid, jdbcType=VARCHAR}
AND (
(lower(u.login) LIKE lower(#{query.searchText, jdbcType=VARCHAR}) ESCAPE '/')
OR (lower(u.name) LIKE lower(#{query.searchText, jdbcType=VARCHAR}) ESCAPE '/')
OR (lower(u.email) LIKE lower(#{query.searchText, jdbcType=VARCHAR}) ESCAPE '/')
)
AND ${query.isManagedSqlClause}
AND u.last_connection_date >= #{query.lastConnectionDateFrom, jdbcType=BIGINT}
AND (u.last_connection_date is null or u.last_connection_date < #{query.lastConnectionDateTo, jdbcType=BIGINT})
AND u.last_sonarlint_connection >= #{query.sonarLintLastConnectionDateFrom, jdbcType=BIGINT}
AND (u.last_sonarlint_connection is null or u.last_sonarlint_connection < #{query.sonarLintLastConnectionDateTo, jdbcType=BIGINT})
AND (u.external_login = #{query.externalLogin, jdbcType=VARCHAR})
AND exists (select 1 from groups_users ug where ug.user_uuid = u.uuid AND ug.group_uuid=#{query.groupUuid, jdbcType=VARCHAR})
AND NOT exists (select 1 from groups_users ug where ug.user_uuid = u.uuid AND ug.group_uuid=#{query.excludedGroupUuid, jdbcType=VARCHAR})
active = ${_false},
email = null,
salt = null,
crypted_password = null,
last_connection_date = null,
last_sonarlint_connection = null,
updated_at = #{now, jdbcType=BIGINT}
update users set
last_sonarlint_connection = #{now, jdbcType=BIGINT}
where
login = #{login, jdbcType=VARCHAR}
update users set
where
login = #{login, jdbcType=VARCHAR}
update users set
homepage_type = null,
homepage_parameter = null,
updated_at = #{now, jdbcType=BIGINT}
where
homepage_type = #{homepageType, jdbcType=VARCHAR}
and homepage_parameter = #{homepageParameter, jdbcType=VARCHAR}
update users set
homepage_type = null,
homepage_parameter = null,
updated_at = #{now, jdbcType=BIGINT}
where
login = #{login, jdbcType=VARCHAR}
insert into users (
uuid,
login,
name,
email,
active,
external_id,
external_login,
external_identity_provider,
user_local,
salt,
crypted_password,
hash_method,
last_sonarlint_connection,
reset_password,
homepage_type,
homepage_parameter,
created_at,
updated_at
) values (
#{user.uuid,jdbcType=VARCHAR},
#{user.login,jdbcType=VARCHAR},
#{user.name,jdbcType=VARCHAR},
#{user.email,jdbcType=VARCHAR},
#{user.active,jdbcType=BOOLEAN},
#{user.externalId,jdbcType=VARCHAR},
#{user.externalLogin,jdbcType=VARCHAR},
#{user.externalIdentityProvider,jdbcType=VARCHAR},
#{user.local,jdbcType=BOOLEAN},
#{user.salt,jdbcType=VARCHAR},
#{user.cryptedPassword,jdbcType=VARCHAR},
#{user.hashMethod,jdbcType=VARCHAR},
#{user.lastSonarlintConnectionDate,jdbcType=BIGINT},
#{user.resetPassword,jdbcType=BOOLEAN},
#{user.homepageType,jdbcType=VARCHAR},
#{user.homepageParameter,jdbcType=VARCHAR},
#{user.createdAt,jdbcType=BIGINT},
#{user.updatedAt,jdbcType=BIGINT}
)
update users set
login = #{user.login, jdbcType=VARCHAR},
name = #{user.name, jdbcType=VARCHAR},
email = #{user.email, jdbcType=VARCHAR},
active = #{user.active, jdbcType=BOOLEAN},
external_id = #{user.externalId, jdbcType=VARCHAR},
external_login = #{user.externalLogin, jdbcType=VARCHAR},
external_identity_provider = #{user.externalIdentityProvider, jdbcType=VARCHAR},
user_local = #{user.local, jdbcType=BOOLEAN},
reset_password = #{user.resetPassword, jdbcType=BOOLEAN},
salt = #{user.salt, jdbcType=VARCHAR},
crypted_password = #{user.cryptedPassword, jdbcType=BIGINT},
hash_method = #{user.hashMethod, jdbcType=VARCHAR},
homepage_type = #{user.homepageType, jdbcType=VARCHAR},
homepage_parameter = #{user.homepageParameter, jdbcType=VARCHAR},
last_connection_date = #{user.lastConnectionDate,jdbcType=BIGINT},
last_sonarlint_connection = #{user.lastSonarlintConnectionDate,jdbcType=BIGINT},
updated_at = #{user.updatedAt,jdbcType=BIGINT}
where
uuid = #{user.uuid, jdbcType=VARCHAR}
insert into scm_accounts (
user_uuid,
scm_account
) values (
#{userUuid,jdbcType=VARCHAR},
#{scmAccount,jdbcType=VARCHAR}
)
delete from scm_accounts
where
user_uuid = #{userUuid,jdbcType=VARCHAR}