package com.gic.haoban.manage.service.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;

public interface WxEnterpriseRelatedMapper {

    int deleteByEnterpriseId(String enterpriseId) ;

    int deleteById(String id) ;

    int insertSelective(TabHaobanWxEnterpriseRelated record);

    TabHaobanWxEnterpriseRelated selectByPrimaryKey(String wxEnterpriseRelatedId);

    int updateByPrimaryKeySelective(TabHaobanWxEnterpriseRelated record);

    List<TabHaobanWxEnterpriseRelated> listByWxenterpriseId(String wxEnterpriseId);
    
    List<TabHaobanWxEnterpriseRelated> listByWxEnterpriseIdAndNoStatus(String wxEnterpriseId) ;
    
    List<TabHaobanWxEnterpriseRelated> listByWxenterpriseIdList(@Param("wxEnterpriseIdList") List<String> wxEnterpriseIdList);

    List<TabHaobanWxEnterpriseRelated> listByEnterpriseId(String enterpriseId);

	List<TabHaobanWxEnterpriseRelated> queryAllHasGicEnterpriseId();
	
	List<TabHaobanWxEnterpriseRelated> listEnterpriseByEnterpriseIds(@Param("enterpriseIds")List<String> enterpriseIds);

//    List<TabHaobanWxEnterpriseRelated> listEnterpriseByTime(@Param("time")String time);

    /**
     * 查询企业下唯一商户
     *
     * @param enterpriseId
     * @param wxEnterpriseId
     * @return
     */
    TabHaobanWxEnterpriseRelated findOneByEIdAndWxEid(@Param("enterpriseId") String enterpriseId, @Param("wxEnterpriseId") String wxEnterpriseId);

    /**
     * 查询企业下唯一商户 总部企业
     *
     * @param enterpriseId
     * @return
     */
    TabHaobanWxEnterpriseRelated findRootWxEnterpriseByEnterpriseId(@Param("enterpriseId") String enterpriseId);

    /**
     * 查询好办所有的企业id
     * @return : 返回好办关联的所有企业id
     */
    List<String> findAllEnterpriseId();

    void saveClerkEditFlag(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId, @Param("clerkEditFlag")int value);
}