package com.goafanti.common.dao;

import java.util.List;

import com.goafanti.organization.bo.OrganizationListOut;
import com.goafanti.admin.bo.AdminCustomerBo;
import com.goafanti.admin.bo.AdminListBo;
import com.goafanti.admin.bo.depCountBo;
import com.goafanti.common.model.OrganizationManagement;
import com.goafanti.common.model.OrganizationManagementExample;

import org.apache.ibatis.annotations.Param;

public interface OrganizationManagementMapper {
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	long countByExample(OrganizationManagementExample example);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int deleteByExample(OrganizationManagementExample example);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int deleteByPrimaryKey(String id);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int insert(OrganizationManagement record);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int insertSelective(OrganizationManagement record);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	List<OrganizationManagement> selectByExample(OrganizationManagementExample example);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	OrganizationManagement selectByPrimaryKey(String id);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int updateByExampleSelective(@Param("record") OrganizationManagement record,
			@Param("example") OrganizationManagementExample example);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int updateByExample(@Param("record") OrganizationManagement record,
			@Param("example") OrganizationManagementExample example);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int updateByPrimaryKeySelective(OrganizationManagement record);
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_management
	 * @mbg.generated  Thu Nov 30 11:09:29 CST 2017
	 */
	int updateByPrimaryKey(OrganizationManagement record);
	List<OrganizationListOut> selectSuperId(@Param("sort")int sort);
	/**
	 * 根据组织名称查组织编号
	 */
	String selectDepNoByName(String name);
	
	/**
	 * 根据上级组织查组织编号
	 */
	String  selectDepNo(String id);
	/**
	
	
	/**
	 * 查询相同上级下编号数量
	 */
	int selectDepNoCount(String superId);
	/**
	 * 模糊查询负责人名称
	 */
	List<AdminListBo> selectName(String name);
	
	OrganizationListOut selectAllById(String id);
	
	int deleteById(String id);
	
	String selectAdminNameById(String name);
	
	String selectIdByDepNo(String depNo);
	/**
	 * 查询有相同上级组织的信息
	 * @param superId
	 * @return
	 */
	List<OrganizationListOut> selectIDNBySuperId(String superId);
	
	int updateByNumber(OrganizationListOut olo);
	
	int selectCountBySuperId(String superId);
	
	String selectIdByName(String name);
	
	String selectNameById(String id);
	
	String selectDepNoById(String id);
	
	int selectUserById(String id);
	
	/**
	 * 查询下级集合
	 * @param superIds
	 * @return
	 */
	List<OrganizationManagement> selectSubDeps(@Param("superIds")String superIds);
	
	List<depCountBo> selectBysuperName(@Param("superName")String superName);
	/**
	 * 查询当前集合
	 * @param adminId
	 * @return
	 */
	List<OrganizationManagement> selectCurrentDeps(@Param("aid")String aid);
	
	/**
	 * 查询所有部门
	 * @return
	 */
	List<OrganizationManagement> selectAllDeps();
	/**
	 * 查询最大编号
	 * @param abbreviation
	 * @return
	 */
	String getMaxAbbreviation(String abbreviation);
	
	List<AdminCustomerBo> getDepAll(@Param("depName")String depName,@Param("depId")String depId,
			@Param("adminName")String adminName,@Param("startTime")String startTime, @Param("endTime")String endTime);
	
}
