/*
 *    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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qunzhixinxi.hnqz.admin.entity.WmDaAgent;
import com.qunzhixinxi.hnqz.common.data.datascope.DataScopeMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 档案-代理商
 *
 * @author gaoyanng
 * @date 2020-06-25 23:35:42
 */
@Mapper
public interface WmDaAgentMapper extends DataScopeMapper<WmDaAgent> {
	WmDaAgent selectByDeptId(WmDaAgent wmDaAgent);

	List selectByUserDeptId(Integer deptId);

	WmDaAgent selectByDeptIds(Integer deptId);

	List selectByDrugIds(Integer id);

	List selectByDrugId(Integer id);

    List selectByRelationId(Integer id);

	List selectByRelationIds(Integer id);

	List selectEntNameByDrugId(Integer id);

	IPage<WmDaAgent> selectWmManagementPage(Page page, @Param("query")WmDaAgent wmDaAgent);

	List<WmDaAgent> selectWmManagementList(@Param("query")WmDaAgent wmDaAgent);

	int insert1(WmDaAgent wmDaAgent);

	List<WmDaAgent> selectExtDrugEntList(@Param("query") WmDaAgent wmDaAgent);

	WmDaAgent selectDeptId(WmDaAgent wmDaAgent);

	List<Map<String,String>> selectDeptId1(WmDaAgent wmDaAgent);

	WmDaAgent selectExtDrugEnt(WmDaAgent wmDaAgent);

	List<WmDaAgent> selectByGsmcList(@Param("query")WmDaAgent wmDaAgent);

	WmDaAgent selectByGsmc(@Param("query")WmDaAgent wmDaAgent);

	List selectEntNameByDrugIds(Integer id);

    List selectByCsoIds(Integer id);

    List selectWmDaDrugEntByDeptId(Integer deptId);

	List selectWmDaDrugEntByDeptIds(Integer deptId);

	List selectWmDaAgentByRelationId(Integer deptId);

    List selectWmDaAgentByRelationIds(Integer deptId);

	List selectWmDaAgentByDeptId(String deptId);

	List selectWmDaAgentByDeptIds(String deptId);

	/**
	 * 根据sys_dept表的level字段查询
	 *
	 * @param deptLevel
	 * @return
	 */
	List<WmDaAgent> listAgentByDeptLevel(@Param("deptLevel") String deptLevel);

	/**
	 * 根据deptRelation查询
	 *
	 * @param deptId
	 * @return
	 */
	List<WmDaAgent> listAgentByDeptRelation(@Param("deptId") Integer deptId);
}
