package com.blueland.dao;

/**
 * @author 代码自动生成工具
 * @version 1.0
 * @since
 */

import java.util.*;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blueland.bo.TreeEntity;
import com.blueland.model.TUcStaff;
import com.blueland.vo.StaffNumVO;
import com.blueland.vo.StaffPostVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.blueland.bo.RoleUserRest;
import com.blueland.bo.TucStaffEntity;


@Mapper
public interface TucStaffDao extends BaseMapper<TUcStaff> {

	List<TucStaffEntity> getStaffInfoByOrgTop(@Param("bo")TucStaffEntity staff);

	Page<TucStaffEntity> getStaffInfoByOrgTopPage(@Param("page") Page<TucStaffEntity> page, @Param("bo")TucStaffEntity staff);

	List<TucStaffEntity> getSubStaffs(@Param("bo")TucStaffEntity entity);

	Page<TucStaffEntity> getSubStaffsPage(@Param("page")Page<TucStaffEntity> page, @Param("bo")TucStaffEntity entity);

	void deleteByCode(String staffCode);

	void updateByCode(TucStaffEntity model);

	@InterceptorIgnore(tenantLine = "true")
	void updateByNum(TucStaffEntity model);

	List<RoleUserRest> getAppRoleUser(@Param("bo")Map<String, Object> params);

	Page<RoleUserRest> getAppRoleUserPage(@Param("page") Page<RoleUserRest> page, @Param("bo")Map<String, Object> params);

	Page<RoleUserRest> getAppRoleUserPage2(@Param("page") Page<RoleUserRest> page, @Param("bo")Map<String, Object> params);

	//20200728 add
	List<TucStaffEntity> getAppRoleUserList(@Param("bo")Map<String, Object> params);

	List<TreeEntity> searchUser(@Param("bo")TucStaffEntity tucStaffEntity);

	List<TreeEntity> searchUser4deptId(@Param("bo")TucStaffEntity tucStaffEntity);

	List<TucStaffEntity> getStaffByOrgs(@Param("bo")TucStaffEntity entity);

	Page<TucStaffEntity> getStaffByOrgsPage(@Param("page") Page<TucStaffEntity> page, @Param("bo")TucStaffEntity entity);

	/**
	 * 根据顶级orgId条件查询人员
	 * @param tucStaffEntity
	 * @return
	 */
	@InterceptorIgnore(tenantLine = "true")
	List<TucStaffEntity> findListByName(@Param("bo")TucStaffEntity tucStaffEntity);

	//20200907 add
	TucStaffEntity getByStaffCode(String staffCode);

	/**
	 * 根据
	 * @param
	 * @return
	 * @author hpp
	 * @Time 2020年10月27日 下午5:55:10
	 */
	List<TucStaffEntity> getByStaffcodes(@Param("staffcodes") List<String> staffcodes);

	@InterceptorIgnore(tenantLine = "true")
	void updateDeptnameByDeptid(@Param("deptname") String deptname, @Param("deptcode") String deptcode);

	/**
	 * 根据设备码来清空设备码
	 * @param staffPhoneBak
	 */
	void updateByStaffPhoneBak(@Param("staffPhoneBak") String staffPhoneBak);

	/**
	 * 根据直接上级员工号查询直接上级
	 * @param staffFax
	 * @return
	 */
	TucStaffEntity getByStaffFax(@Param("staffFax") String staffFax);


	List<TucStaffEntity> getStaffList(@Param("name") String name);

    List<TucStaffEntity> getListByCodes(@Param("codes") List<String> codes);

    List<TucStaffEntity> findListStaffCodeStaffNum();

	@InterceptorIgnore(tenantLine = "true")
    List<TucStaffEntity> findListQY(@Param("appId") String appId);

	@InterceptorIgnore(tenantLine = "true")
	List<TucStaffEntity> findList(@Param("bo") TucStaffEntity bo);

	@InterceptorIgnore(tenantLine = "true")
	List<TucStaffEntity> findListByRoleAndStaffCode(@Param("codes") List<String> codes);

	Page<TucStaffEntity> findPage(@Param("page")Page<TucStaffEntity> page, @Param("bo")TucStaffEntity bo);

	@InterceptorIgnore(tenantLine = "true")
	List<StaffPostVO> findStaffPostList(@Param("staffCode") String staffCode);

	@InterceptorIgnore(tenantLine = "true")
	List<StaffPostVO> findStaffPostList2(@Param("staffCode") String staffCode);

	@InterceptorIgnore(tenantLine = "true")
	void deleteByPostCode(@Param("postCode") String postCode);

	@InterceptorIgnore(tenantLine = "true")
	TucStaffEntity getByPostCode(@Param("postCode") String postCode, @Param("appId") String appId);

	@InterceptorIgnore(tenantLine = "true")
	TucStaffEntity selectStaffByNumAndDept(@Param("staffNum") String staffNum, @Param("deptId") String deptId);

	@InterceptorIgnore(tenantLine = "true")
	TucStaffEntity selectStaffByNum(@Param("staffNum")String staffNum);

	@InterceptorIgnore(tenantLine = "true")
	Integer countStaff(@Param("id") String id, @Param("appId") String appId);

	@InterceptorIgnore(tenantLine = "true")
	Integer countStaffByNum(@Param("num") String num, @Param("appId") String appId);

	@InterceptorIgnore(tenantLine = "true")
	void deleteStaffByAppId(@Param("appId") String appId);
}
