id, company_id, phone, username, role, position, real_name, password_hash, must_change_password, status, session_version, created_at, updated_at insert into sys_user ( id, company_id, phone, username, role, position, real_name, password_hash, must_change_password, status, session_version, created_at, updated_at ) values ( #{id}, #{companyId}, #{phone}, #{username}, #{role}, #{position}, #{realName}, #{passwordHash}, #{mustChangePassword}, #{status}, #{sessionVersion}, current_timestamp, current_timestamp ) update sys_user set password_hash = #{passwordHash}, must_change_password = #{mustChangePassword}, updated_at = current_timestamp where id = #{id} and company_id = #{companyId} update sys_user set role = #{role}, position = #{position}, session_version = session_version + 1, updated_at = current_timestamp where id = #{id} and company_id = #{companyId} update sys_user set status = #{status}, session_version = session_version + 1, updated_at = current_timestamp where id = #{id} and company_id = #{companyId} update sys_user set session_version = session_version + 1, updated_at = current_timestamp where id = #{id} and company_id = #{companyId} delete from sys_user