package com.gree.mall.manager.commonmapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.manager.bean.user.UserApplyBean;
import com.gree.mall.manager.bean.user.UserWxCustomerBean;
import com.gree.mall.manager.bean.wxCustomer.WxCustomerBean;
import com.gree.mall.manager.plus.entity.CouponTag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface WxCustomerMapper {
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<WxCustomerBean> queryCustomerList(@Param("keyword") String keyword,
                                            @Param("startTime") Date startTime,
                                            @Param("endTime") Date endTime,
                                            @Param("tagIds") String[] tagIds,
                                            @Param("pageNum") Integer pageNum,
                                            @Param("pageSize") Integer pageSize);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    Integer queryCustomerCount(@Param("keyword") String keyword,
                               @Param("startTime") Date startTime,
                               @Param("endTime") Date endTime,
                               @Param("tagIds") String[] tagIds);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    WxCustomerBean queryCustomerDetail(@Param("externalUserId")String externalUserId);

    /**
     * 查询指定企业下 与 指定标签绑定的 用户id
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<String> queryTagUserIdList(@Param("companyWechatId")String companyWechatId, @Param("couponTags")List<CouponTag> couponTags);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<UserWxCustomerBean> queryCustomerByUser(@Param("workUserId")String workUserId,@Param("corpId")String corpId);

    IPage<UserApplyBean> queryServiceApplyList(Page<Object> objectPage,
                                               @Param("companyWechatIds") List<String> companyWechatIds,
                                               @Param("keyword") String keyword,
                                               @Param("status") String status,
                                               @Param("adminWebsitIds") List<String> adminWebsitIds
                                               );
}
