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.activity.PromotionActivityVO;
import com.gree.mall.manager.bean.admin.AdminCompanyPayConfigVO;
import com.gree.mall.manager.bean.charging.ChargingStandardBean;
import com.gree.mall.manager.bean.common.AmityUrlVO;
import com.gree.mall.manager.bean.engin.OrderEnginBaseVO;
import com.gree.mall.manager.bean.engin.ProjectRepairVO;
import com.gree.mall.manager.bean.es.ESGoodsVO;
import com.gree.mall.manager.bean.es.EsGoodsMessageVO;
import com.gree.mall.manager.bean.goods.*;
import com.gree.mall.manager.bean.listvo.*;
import com.gree.mall.manager.bean.listvo.goods.GoodsLibraryVO;
import com.gree.mall.manager.bean.listvo.goods.GoodsMaterialStockAccVO;
import com.gree.mall.manager.bean.listvo.material.*;
import com.gree.mall.manager.bean.listvo.order.PunishOrderVO;
import com.gree.mall.manager.bean.listvo.param.ExamineZfireParamBean;
import com.gree.mall.manager.bean.listvo.param.WorkOrderZfireParam;
import com.gree.mall.manager.bean.listvo.workorder.*;
import com.gree.mall.manager.bean.order.LeaseOrderVO;
import com.gree.mall.manager.bean.order.refund.OrderOfflineRefundVO;
import com.gree.mall.manager.bean.serivce.BuyServiceRecordVO;
import com.gree.mall.manager.bean.settle.SettleExpenseItemVO;
import com.gree.mall.manager.bean.settle.SettleExpenseVO;
import com.gree.mall.manager.bean.settle.SettleMonthWagesVO;
import com.gree.mall.manager.bean.settle.SettleMonthWagesWorkerVO;
import com.gree.mall.manager.bean.settle.repair.*;
import com.gree.mall.manager.bean.workorder.*;
import com.gree.mall.manager.enums.UserTypeEnum;
import com.gree.mall.manager.zfire.bean.WorkerParamBean;
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface CommonMapper {

    /**
     * 分类
     * @param page
     * @param zfireParamBean
     * @return
     */
    public IPage<ChargingStandardTypeVO> chargingStandardTypeList(IPage page, @Param("ex")ZfireParamBean zfireParamBean);

    /**
     * 收费标准
     * @param page
     * @param zfireParamBean
     * @Param
     * @return
     */
    public IPage<ChargingStandardVO> chargingStandardList(IPage page,@Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 故障排查
     * @param page
     * @param zfireParamBean
     * @return
     */
    public IPage<ChargingStandard2VO> chargingStandardList2(IPage page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 师傅列表
     * @param page
     * @param zfireParamBean
     * @param isOK
     * @return
     */
    public IPage<UserVO> userList(IPage page, @Param("ex") WorkerParamBean zfireParamBean, @Param("type") UserTypeEnum type, @Param("isOK") Boolean isOK);


    /**
     * 分销员列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    public IPage<User2VO> userServiceList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 客户列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    public IPage<UserCustomerVO> userCustomerList(IPage page,@Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 收费标准brandId,oneCategoryId,twoCategoryId,content1
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<ChargingStandardBean> queryChargingStandrdList(IPage page,
                                                                @Param("type") Integer type,
                                                                @Param("status") Boolean status,
                                                                @Param("brandId") String brandId,
                                                                @Param("oneCategoryId") String oneCategoryId,
                                                                @Param("twoCategoryId") String twoCategoryId,
                                                                @Param("content1") String content1,
                                                                @Param("id") String id,
                                                                @Param("companyWechatId") String companyWechatId);

//    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
//    @Update("update admin_websit a join enterprise_wechat_worker b on a.websit_id=b.main_department\n" +
//            "set b.department_name = a.name")
//    public void reloadEnterpriseWebsitName();

    /**
     * 辅材网点库存列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WebsitStockVO> websitStockList(IPage page,@Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 配件网点库存列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WebsitStockPVO> websitStockPList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 辅材网点库存明细
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WebsitStockAccVO> websitStockAccList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 配件网点库存明细
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WebsitStockAccPVO> websitStockAccPList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 辅材师傅库存列表
     * @param page
     * @param zfireParamBean
     * @param workers
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WorkerStockVO> workerStockList(IPage page, @Param("ex") ZfireParamBean zfireParamBean, @Param("workers") List<String> workers);

    /**
     * 辅材师傅库存明细
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WorkerStockAccVO> workerStockAccList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 配件师傅库存列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WorkerStockPVO> workerStockPList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 配件师傅库存明细
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<WorkerStockAccPVO> workerStockAccPList(IPage page, @Param("ex") ZfireParamBean zfireParamBean);

    IPage<AmityUrlVO> amityList(Page page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 工单类型
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<OrderSmallTypeVO> orderSmallTypeList(IPage page,@Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 工单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<OrderBaseVO> orderBaseList(IPage page, @Param("ex") WorkOrderZfireParam zfireParamBean,@Param("adminUserType") Integer adminUserType);

    /**
     * 考核项目配件列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<ExamineProjectConfigVO> examineProjectConfigList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 考核项目列表
     * @param page
     * @param zfireParamBean
     * @param adminUserType
     * @return
     */
    IPage<ExamineProjectVO> examineProjectList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("adminUserType") Integer adminUserType);


    /**
     * 安装结算标准列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<OrderBaseAppraiseVO> orderBaseAppraiseList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 考核项目列表
     */
    IPage<InstallSettleNormVO> installNormList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 维修结算标准列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<RepairSettleNormVO> repairNormList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 其它结算标准列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<OtherSettleNormVO> otherNormList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 结算单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<SettleOrderVO> settleOrderList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("websitIds") List<String> websitId);

    /**
     * 汇总结算单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<SettlePoolVO> settlePoolList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("websitIds") List<String> websitId);

    /**
     * 汇总结算单明细
     * @param id
     * @param workerName
     * @param mobile
     * @param idcard
     * @param orderBaseId
     * @param customerName
     * @param customerMobile
     * @param orderSmallType
     * @param settleOrderType
     * @return
     */
    List<SettlePoolWorkerVO> poolDetailList(@Param("id") String id,
                                            @Param("workerName") String workerName,
                                            @Param("mobile") String mobile,
                                            @Param("idcard") String idcard,
                                            @Param("orderBaseId") String orderBaseId,
                                            @Param("customerName") String customerName,
                                            @Param("customerMobile") String customerMobile,
                                            @Param("orderSmallType") String orderSmallType,
                                            @Param("settleOrderType") String settleOrderType);



    /**
     * 待入驻用户列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<UserWaitVO> userWaitList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 购买服务记录
     * @param page
     * @param zfireParamBean
     * @param companyName
     * @return
     */
    IPage<BuyServiceRecordVO> buyServiceRecordList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("companyName") String companyName);

    /**
     * 订单结算管理列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<IncreOrderVO> increOrderSettleList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("isSettleList") Boolean isSettleList);

    /**
     * 订单网点分账统计列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitOrderSettleCountVO> websitOrderSettleCountList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 工程维保列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<ProjectRepairVO> projectRepairList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 工单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<OrderBase2VO> orderBaseList2(Page page, @Param("ex") WorkOrderZfireParam zfireParamBean, @Param("adminUserType") Integer adminUserType);

    /**
     * 订单网点分账统计列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WorkerOrderSettleCountVO> workerOrderSettleCountList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品物料列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsMaterialVO> goodsMaterialList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品采购入库列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsPurchaseVO> goodsPurchaseList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品采购入库商品列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsPurchaseItemVO> goodsPurchaseItemList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品采购入库条码列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsPurchaseCodeVO> goodsPurchaseCodeList(Page page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 线下销售订单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<OrderInfoVO> queryOrderInfoList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品采购退货列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsPurchaseRetVO> goodsPurchaseRetList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品采购退货商品列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsPurchaseRetItemVO> goodsPurchaseRetItemList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 商品采购退货商品列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsPurchaseRetCodeVO> goodsPurchaseRetCodeList(Page page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 商品物料库存三级帐列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsMaterialStockAccVO> goodsMaterialStockAccList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 工程基础资料列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<OrderEnginBaseVO> orderEnginBaseList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 处罚单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<PunishOrderVO> punishOrderList(Page page,@Param("ex") ExamineZfireParamBean zfireParamBean);


    /**
     * 线下销售退货单
     */
    IPage<OrderOfflineRefundVO> orderOfflineRefundList(Page page, @Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 师傅费用结算汇总列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<SettleExpenseVO> workerSettleExpenseGatherList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 师傅费用结算列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<SettleExpenseItemVO> workerSettleExpenseList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("workerId") String workerId);

    /**
     * 月度工资汇总列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<SettleMonthWagesVO> settleMonthWagesGatherList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 月度工资师傅列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<SettleMonthWagesWorkerVO> settleMonthWagesList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 租赁产品列表
     * @param objectPage
     * @param keyword
     * @param categoryIds
     * @param startPrice
     * @param endPrice
     * @param startDeposit
     * @param endDeposit
     * @param sortStr
     * @param status
     * @param companyWechatIds
     * @return
     */
    IPage<GoodsLeaseBean> goodsLeaseList(Page<Object> objectPage, @Param("keyword") String keyword,
                                         @Param("categoryIds") List<String> categoryIds,
                                         @Param("startPrice") BigDecimal startPrice,
                                         @Param("endPrice") BigDecimal endPrice,
                                         @Param("startDeposit") BigDecimal startDeposit,
                                         @Param("endDeposit") BigDecimal endDeposit,
                                         @Param("sortStr") String sortStr,
                                         @Param("status") Boolean status,
                                         @Param("companyWechatIds") List<String> companyWechatIds);

    /**
     * 租赁订单列表
     * @param objectPage
     * @param orderId
     * @param goodsName
     * @param userName
     * @param userMobile
     * @param status
     * @param startDate
     * @param endDate
     * @param startPayDate
     * @param endPayDate
     * @param companyWechatIds
     * @return
     */
    IPage<LeaseOrderVO> leaseOrderList(Page<Object> objectPage,
                                       @Param("orderId") String orderId,
                                       @Param("goodsName") String goodsName,
                                       @Param("userName") String userName,
                                       @Param("userMobile") String userMobile,
                                       @Param("status") String status,
                                       @Param("startDate") Date startDate,
                                       @Param("endDate") Date endDate,
                                       @Param("startPayDate") Date startPayDate,
                                       @Param("endPayDate") Date endPayDate,
                                       @Param("companyWechatIds") List<String> companyWechatIds);

    /**
     * 商品库列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<GoodsLibraryVO> goodsLibraryList(Page page,@Param("ex") ZfireParamBean zfireParamBean);


    /**
     * 问卷活动列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<PromotionQuestionnairVO> promotionQuestionnairList(Page page,@Param("ex") ZfireParamBean zfireParamBean,@Param("status") Integer status);

    /**
     * 扫码活动单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<PromotionActivityVO> promotionActivityList(Page page, @Param("ex") ZfireParamBean zfireParamBean, @Param("websitId") String websitId);

    /**
     * 二手商城商品列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<ESGoodsVO> esGoodsList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 二手商城商品留言列表
     * @param id
     * @return
     */
    List<EsGoodsMessageVO> esGoodsMessageList(@Param("id") String id);

    /**
     * 商户支付配置
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<AdminCompanyPayConfigVO> adminCompanyPayConfigList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 维修日结银行账户列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyBankAccountVO> repairSettleBankAccountList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 维修日结算扣款配置列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyWithholdVO> repairSettleDailyWithholdList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 维修日结算扣款配置列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyImportSummaryVO> repairSettleDailyImportSummaryList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 结算数据导入明细列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyImportSummaryItemVO> repairDetailList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 增减费用管理列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyIncrDecrCostCountVO> reduceCountList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 增减费用明细列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyIncrDecrCostVO> repairSettleDailyincrDecrCostList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 需扣回工单费用管理列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyReduceCostGatherVO> reduceTotalList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 需扣回工单费用明细列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<DailyReduceCostVO> reduceList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 师傅待扣费用列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WorkerWaitBuckleVO> buckleList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 银行接口返回查询列表
     * @param page
     * @param zfireParamBean
     * @param companyWechatIds
     * @return
     */
    IPage<SettleDailyBankTransferRecordVO> transferList(Page page,
                                                        @Param("ex") ZfireParamBean zfireParamBean,
                                                        @Param("companyWechatIds") List<String> companyWechatIds);

    /**
     * 维修工单结算清单列表
     * @param page
     * @param zfireParamBean
     * @param companyWechatIds
     * @return
     */
    IPage<AllDailyImportSummaryItemVO> repairAllList(Page page,
                                                  @Param("ex") ZfireParamBean zfireParamBean,
                                                  @Param("companyWechatIds") List<String> companyWechatIds);

    /**
     * 维修工单结算清单列表
     * @param companyWechatIds
     * @param adminWebsitIds
     * @return
     */
    Integer repairAllCount(@Param("companyWechatIds") List<String> companyWechatIds,
                           @Param("adminWebsitIds") List<String> adminWebsitIds,
                           @Param("status") Integer status);
}
