st.uuid as uuid,
st.user_uuid as "userUuid",
st.expiration_date as "expirationDate",
st.created_at as "createdAt",
st.updated_at as "updatedAt"
insert into session_tokens
(
uuid,
user_uuid,
expiration_date,
created_at,
updated_at
)
values (
#{dto.uuid, jdbcType=VARCHAR},
#{dto.userUuid, jdbcType=VARCHAR},
#{dto.expirationDate, jdbcType=BIGINT},
#{dto.createdAt, jdbcType=BIGINT},
#{dto.updatedAt, jdbcType=BIGINT}
)
update session_tokens set
expiration_date = #{dto.expirationDate, jdbcType=BIGINT},
updated_at = #{dto.updatedAt, jdbcType=BIGINT}
where
uuid = #{dto.uuid, jdbcType=VARCHAR}
delete from session_tokens where uuid = #{uuid, jdbcType=VARCHAR}
delete from session_tokens where user_uuid = #{userUuid, jdbcType=VARCHAR}
delete from session_tokens where expiration_date < #{now, jdbcType=BIGINT}