package com.pusong.business.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pusong.business.domain.PsCustomInfo;
import com.pusong.business.domain.vo.PsCustomInfoVo;
import com.pusong.business.domain.vo.PsCustomerRecordVo;
import com.pusong.common.mybatis.annotation.DataColumn;
import com.pusong.common.mybatis.annotation.DataPermission;
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 客户基本信息Mapper接口
 *
 * @author Lion Li
 * @date 2024-07-25
 */
public interface PsCustomInfoMapper extends BaseMapperPlus<PsCustomInfo, PsCustomInfoVo> {

    @DataPermission({
            @DataColumn(key = "deptName", value = "create_dept"),
            @DataColumn(key = "userName", value = "custom_manager")
    })
    List<PsCustomInfo> selectList(@Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);

    @DataPermission({
            @DataColumn(key = "deptName", value = "info.create_dept"),
            @DataColumn(key = "userName", value = "info.custom_manager")
    })
    Page<PsCustomInfoVo> selectPageCustomerList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);

    Page<PsCustomInfoVo> selectPagePublicCustomerList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);

    @DataPermission({
            @DataColumn(key = "deptName", value = "info.create_dept"),
            @DataColumn(key = "userName", value = "info.custom_manager")
    })
    List<PsCustomInfoVo> selectCustomerList( @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
//
//    @DataPermission({
//            @DataColumn(key = "deptName", value = "u.dept_id"),
//            @DataColumn(key = "userName", value = "u.user_id")
//    })
//    Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);

    @DataPermission({
            @DataColumn(key = "deptName", value = "custom.create_dept"),
            @DataColumn(key = "userName", value = "custom.create_by")
    })
    Page<PsCustomerRecordVo> selectPageCustomerRecordList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);

}
