package com.ruoyi.web.modules.store.mapper;

import org.apache.ibatis.annotations.Param;
import com.ruoyi.web.modules.store.domain.BizMerchantAccount;
import com.ruoyi.web.modules.store.vo.MerchantAccountUserVO;
import com.ruoyi.web.modules.store.vo.ShopEmployeeCountRow;

/**
 * 商户经营账号 Mapper
 */
public interface BizMerchantAccountMapper
{
    BizMerchantAccount selectByMerchantId(@Param("merchantId") Long merchantId);

    BizMerchantAccount selectMerchantAdminByUserId(@Param("userId") Long userId);

    BizMerchantAccount selectByUserId(@Param("userId") Long userId);

    MerchantAccountUserVO selectMerchantAdminWithUser(@Param("merchantId") Long merchantId);

    int countByAccountId(@Param("accountId") Long accountId);

    int insert(BizMerchantAccount account);

    int update(BizMerchantAccount account);

    int updateSysUserProfile(@Param("userId") Long userId, @Param("userName") String userName,
            @Param("nickName") String nickName, @Param("email") String email,
            @Param("phonenumber") String phonenumber, @Param("password") String password,
            @Param("updateBy") String updateBy);

    int logicDeleteByUserId(@Param("userId") Long userId, @Param("updateBy") String updateBy);

    int countEmployeesByMerchantId(@Param("merchantId") Long merchantId);

    ShopEmployeeCountRow countEmployeesByShopId(@Param("merchantId") Long merchantId,
            @Param("shopId") Long shopId);

    BizMerchantAccount selectEmployeeByUserIdAndMerchant(@Param("userId") Long userId,
            @Param("merchantId") Long merchantId);

    int logicDeleteEmployeeByUserId(@Param("userId") Long userId, @Param("updateBy") String updateBy);
}
