package com.ruoyi.ai.mapper;

import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.AiUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * ai-用户信息Mapper接口
 *
 * @author shi
 * @date 2025-11-12
 */
public interface AiUserMapper extends BaseMapper<AiUser> {
    List<AiUser> selectAiUserList(AiUser aiUser);

    String selectPasswordById(@Param("id") Long aiUserId);

    void updateUserBalance(@Param("id") Long userId, @Param("amount") BigDecimal amount);

    AiUser selectAiUserById(Long id);
    AiUser getUserInfo(Long id);

    int countAiUserByDeptId(@Param("deptId") Long deptId);

    @Update("update ai_user set dept_id = #{deptId}, update_time = sysdate() where id = #{userId}")
    int updateAiUserDeptId(@Param("userId") Long userId, @Param("deptId") Long deptId);
}
