package com.zfire.mall.manager.commonmapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zfire.mall.manager.bean.OrderExecBean;
import com.zfire.mall.manager.bean.admin.respDto.AdminUserDto;
import com.zfire.mall.manager.plus.entity.AdminCompany;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CountMapper {


    /**
     * 查询零售单的执行明细
     * @return
     */
    @SqlParser(filter = true)
    public IPage<OrderExecBean> queryRetailOrderExec(
            IPage page,
            @Param("isCost") String isCost,
            @Param("materialOldNumber") String materialOldNumber,
            @Param("id") String id,
            @Param("customerName") String customerName,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("orderStartTime") String orderStartTime,
            @Param("orderEndTime") String orderEndTime,
            @Param("serviceName") String serviceName,
            @Param("itemServiceName") String itemServiceName,
            @Param("newServiceName") String newServiceName,
            @Param("type") String type,
            @Param("k3CategoryNumber") List<String> k3CategoryNumber,
            @Param("customerId") String customerId,
            @Param("serviceIds") List<String> serviceIds,
            @Param("policyCode") String policyCode,
            @Param("policyRemark") String policyRemark,
            @Param("isOver") Boolean isOver,
            @Param("isDisplaceOrder") Boolean isDisplaceOrder,
            @Param("k3CategoryIds") List<String> k3CategoryIds,
            @Param("walletIds1") List<String> walletIds1,
            @Param("walletIds2") List<String> walletIds2,
            @Param("priceType") String priceType
    );


    /**
     * 查询销售执行明细的总条数
     * @return
     */
    @SqlParser(filter = true)
    public Integer queryRetailOrderExecCount(
            @Param("costStartTime") String costStartTime,
            @Param("costEndTime") String costEndTime,
            @Param("refUseUnit") String refUseUnit,
            @Param("isCost") String isCost,
            @Param("materialOldNumber") String materialOldNumber,
            @Param("id") String id,
            @Param("customerName") String customerName,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("orderStartTime") String orderStartTime,
            @Param("orderEndTime") String orderEndTime,
            @Param("serviceName") String serviceName,
            @Param("itemServiceName") String itemServiceName,
            @Param("newServiceName") String newServiceName,
            @Param("type") String type,
            @Param("k3CategoryNumber") List<String> k3CategoryNumber,
            @Param("customerId") String customerId,
            @Param("serviceIds") List<String> serviceIds,
            @Param("policyCode") String policyCode,
            @Param("policyRemark") String policyRemark,
            @Param("isOver") Boolean isOver,
            @Param("isDisplaceOrder") Boolean isDisplaceOrder,
            @Param("k3CategoryIds") List<String> k3CategoryIds,
            @Param("walletIds1") List<String> walletIds1,
            @Param("walletIds2") List<String> walletIds2,
            @Param("priceType") String priceType
    );



    /**
     * 查询工程的执行明细
     * @return
     */
    @SqlParser(filter = true)
    public IPage<OrderExecBean> queryEnginOrderExec(
            IPage page,
            @Param("isCost") String isCost,
            @Param("materialOldNumber") String materialOldNumber,
            @Param("id") String id,
            @Param("customerName") String customerName,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("orderStartTime") String orderStartTime,
            @Param("orderEndTime") String orderEndTime,
            @Param("serviceName") String serviceName,
            @Param("itemServiceName") String itemServiceName,
            @Param("newServiceName") String newServiceName,
            @Param("type") String type,
            @Param("k3CategoryNumber") List<String> k3CategoryNumber,
            @Param("customerId") String customerId,
            @Param("projectName") String projectName,
            @Param("enginRecordNo") String enginRecordNo,
            @Param("serviceIds") List<String> serviceIds,
            @Param("isOver") Boolean isOver,
            @Param("isDisplaceOrder") Boolean isDisplaceOrder,
            @Param("k3CategoryIds") List<String> k3CategoryIds,
            @Param("walletIds1") List<String> walletIds1,
            @Param("walletIds2") List<String> walletIds2,
            @Param("priceType") String priceType
    );
    /**
     * 查询工程的执行明细总条数
     * @return
     */
    @SqlParser(filter = true)
    public Integer queryEnginOrderExecCount(
            @Param("costStartTime") String costStartTime,
            @Param("costEndTime") String costEndTime,
            @Param("refUseUnit") String refUseUnit,
            @Param("isCost") String isCost,
            @Param("materialOldNumber") String materialOldNumber,
            @Param("id") String id,
            @Param("customerName") String customerName,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("orderStartTime") String orderStartTime,
            @Param("orderEndTime") String orderEndTime,
            @Param("serviceName") String serviceName,
            @Param("itemServiceName") String itemServiceName,
            @Param("newServiceName") String newServiceName,
            @Param("type") String type,
            @Param("k3CategoryNumber") List<String> k3CategoryNumber,
            @Param("customerId") String customerId,
            @Param("projectName") String projectName,
            @Param("enginRecordNo") String enginRecordNo,
            @Param("serviceIds") List<String> serviceIds,
            @Param("isOver") Boolean isOver,
            @Param("isDisplaceOrder") Boolean isDisplaceOrder,
            @Param("k3CategoryIds") List<String> k3CategoryIds,
            @Param("walletIds1") List<String> walletIds1,
            @Param("walletIds2") List<String> walletIds2,
            @Param("priceType") String priceType
    );







    /**
     * 查询执行明细汇总
     * @return
     */
    @SqlParser(filter = true)
    public IPage<OrderExecBean> queryOrderExecTotal(
            IPage page,
            @Param("costStartTime") String costStartTime,
            @Param("costEndTime") String costEndTime,
            @Param("refUseUnit") String refUseUnit,
            @Param("isCost") String isCost,
            @Param("materialOldNumber") String materialOldNumber,
            @Param("id") String id,
            @Param("customerName") String customerName,
            @Param("materialName") String materialName,
            @Param("specification") String specification,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("orderStartTime") String orderStartTime,
            @Param("orderEndTime") String orderEndTime,
            @Param("serviceName") String serviceName,
            @Param("itemServiceName") String itemServiceName,
            @Param("newServiceName") String newServiceName,
            @Param("type") String type,
            @Param("k3CategoryNumber") List<String> k3CategoryNumber,
            @Param("customerId") String customerId,
            @Param("projectName") String projectName,
            @Param("enginRecordNo") String enginRecordNo,
            @Param("serviceIds") List<String> serviceIds,
            @Param("policyCode") String policyCode,
            @Param("policyRemark") String policyRemark,
            @Param("isOver") Boolean isOver,
            @Param("isDisplaceOrder") Boolean isDisplaceOrder,
            @Param("k3CategoryIds") List<String> k3CategoryIds,
            @Param("walletIds1") List<String> walletIds1,
            @Param("walletIds2") List<String> walletIds2,
            @Param("priceType") String priceType,
            @Param("total2") Integer total2,
            @Param("total") Integer total
    );


}
