package com.dgtly.system.mapper;

import com.dgtly.system.domain.SysUserCustomerAuthorization;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 经销商用户授权Mapper接口
 *
 * @author njs
 * @date 2024-05-24
 */
public interface SysUserCustomerAuthorizationMapper
{
    /**
     * 查询经销商用户授权
     *
     * @param customerCode 经销商用户授权ID
     * @return 经销商用户授权
     */
    public SysUserCustomerAuthorization selectSysUserCustomerAuthorizationById(String customerCode);

    /**
     * @description: 查询根据经销商用户查询授权
     * @param: [customerCode, userId]
     * @return: com.dgtly.system.domain.SysUserCustomerAuthorization
     * @author: njs
     * @date: 2024/5/24 14:15
     */
    public SysUserCustomerAuthorization selectAuthorizationByUserIdAndCustomerCode(@Param("customerCode") String customerCode,@Param("userId")  String userId);

    /**
     * 查询经销商用户授权列表
     *
     * @param sysUserCustomerAuthorization 经销商用户授权
     * @return 经销商用户授权集合
     */
    public List<SysUserCustomerAuthorization> selectSysUserCustomerAuthorizationList(SysUserCustomerAuthorization sysUserCustomerAuthorization);

    /**
     * 新增经销商用户授权
     *
     * @param sysUserCustomerAuthorization 经销商用户授权
     * @return 结果
     */
    public int insertSysUserCustomerAuthorization(SysUserCustomerAuthorization sysUserCustomerAuthorization);

    /**
     * 修改经销商用户授权
     *
     * @param sysUserCustomerAuthorization 经销商用户授权
     * @return 结果
     */
    public int updateSysUserCustomerAuthorization(SysUserCustomerAuthorization sysUserCustomerAuthorization);

    /**
     * @description: 根据经销商编号和用户id修改授权标记
     * @param: [sysUserCustomerAuthorization]
     * @return: int
     * @author: njs
     * @date: 2024/5/24 13:58
     */
    public int  updateAuthorizationByCustomerCodeAndUserId(SysUserCustomerAuthorization sysUserCustomerAuthorization);

    /**
     * 删除经销商用户授权
     *
     * @param customerCode 经销商用户授权ID
     * @return 结果
     */
    public int deleteSysUserCustomerAuthorizationById(String customerCode);

    /**
     * 批量删除经销商用户授权
     *
     * @param customerCodes 需要删除的数据ID
     * @return 结果
     */
    public int deleteSysUserCustomerAuthorizationByIds(String[] customerCodes);
}
