/*
 *    Copyright (c) 2018-2025, hnqz All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: hnqz
 */

package com.qunzhixinxi.hnqz.admin.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageApiOutput;
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageSettleInput;
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageSettleOutput;
import com.qunzhixinxi.hnqz.common.data.datascope.DataScope;
import com.qunzhixinxi.hnqz.common.data.datascope.DataScopeMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * 积分包
 *
 * @author gaoyanng
 * @date 2020-06-25 23:35:42
 */
@Mapper
public interface WmScorePackageMapper extends DataScopeMapper<WmScorePackage> {

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTask(@Param("query") WmScorePackage wmScorePackage, DataScope dataScope);

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTaskExt(@Param("query") WmScorePackage wmScorePackage);

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTaskExtOld(@Param("query") WmScorePackage wmScorePackage);

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTaskExt2(@Param("query") WmScorePackage wmScorePackage);

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTaskExt2Old(@Param("query") WmScorePackage wmScorePackage);

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTaskLevel1(@Param("query") WmScorePackage wmScorePackage, DataScope dataScope);

	@SqlParser(filter=true)
	public List<WmScorePackage> listWmScorePackageAndTaskLevel3(@Param("query") WmScorePackage wmScorePackage, DataScope dataScope);

	public IPage<WmScorePackage> getExportPackageTotalList(Page page, @Param("query") WmScorePackage wmScorePackage);

	public IPage<WmScorePackage> getExportPackageTotalList1(Page page, @Param("query") WmScorePackage wmScorePackage);


	public IPage<Map<String,Object>> getPlatTotalData(Page page,@Param("query") WmScorePackage wmScorePackage);

	public IPage<Map<String,Object>> selectWmScorePackageList(Page page,@Param("query") WmScorePackage wmScorePackage);

	WmScorePackage selectByPackage(String id);

	public List<WmScorePackage> selectLists(@Param("query") WmScorePackage wmScorePackage);

	public List<Map<String, Object>> selectListById(@Param("query") WmScorePackage wmScorePackage);

	WmScorePackage finishRate(@Param("query") WmScorePackage wmScorePackage);

	WmScorePackage newFinishRate(@Param("query") WmScorePackage wmScorePackage);

	WmScorePackage selectkfpjf(String scoreId);

	List<WmScorePackage> listWmScorePackages(WmScorePackage wmScorePackage);

	WmScorePackage selectBywmId(String id);

	boolean insertWmScorePackage(WmScorePackage record);

	int updateByPrimaryKeySelective(WmScorePackage record);

	WmScorePackage selectByScoreId(String scoreId);

	WmScorePackage selectByScoreIds(String scoreName);

	WmScorePackage selectByName(WmScorePackage wmScorePackage);

	List<WmScorePackage> selectWmScorePackageByCode(Map<String, Object> map);

	IPage<WmScorePackage> selectWmScorePackageLists(Page page,@Param("query") WmScorePackage wmScorePackage);

	Page<WmScorePackage> newSelectWmScorePackageLists(Page<WmScorePackage> page,
													  @Param(value = "sendDeptId") String sendDeptId,
													  @Param(value = "scorePackageName") String scorePackageName,
													  @Param(value = "acceptSug") String acceptSug,
													  @Param(value = "allocationDate") LocalDate allocationDate,
													  @Param(value = "endLabelDate") LocalDate endLabelDate);

	WmScorePackage selectByRelationScoreId(String relationScoreId);

    List<WmScorePackage> selectRelationScoreId(String relationScoreId);

    List<WmScorePackage> selectByReRelatedService(WmScorePackage wmScorePackage);

    List<WmScorePackage> selectByRelationScoreIdList(String relationScoreId);

	public List<WmScorePackage> getScorePackagekfpjf(@Param("query") WmScorePackage wmScorePackage);

	IPage<WmScorePackage> getScorePackageList(Page page,@Param("query") WmScorePackage wmScorePackage);

	IPage<WmScorePackage> newGetScorePackageList(Page<WmScorePackage> page,
											  @Param(value = "packageType1") Integer packageType1,
											  @Param(value = "packageType2") Integer packageType2,
											  @Param(value = "scorePackageName") String scorePackageName,
											  @Param(value = "scorePackageStatus") Integer scorePackageStatus,
											  @Param(value = "sendDeptId") Integer sendDeptId);

    WmScorePackage selectRelationScoreIdList(String id);

	WmScorePackage getScorePackagePageById(@Param("id")String id);

	IPage<WmScorePackageApiOutput> getPackageListForReceive(Page page,@Param("query")WmScorePackage wmScorePackage);

	IPage<WmScorePackageSettleOutput> listPackageSettleList(Page page, @Param("query")WmScorePackageSettleInput input);

	/**
	 * 结算包结算列表
	 *
	 * @param input
	 * @return
	 */
	List<WmScorePackageSettleOutput> listAllPackageSettle(@Param("query")WmScorePackageSettleInput input);
}
