package com.gic.haoban.manage.service.service.hm;

import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;

import java.util.List;

/**
 * 多人活码(TabHaobanHmClerkRelation)表服务接口
 *
 * @author mozhu
 * @since 2022-07-04 15:42:20
 */
public interface HmClerkRelationService {


    /**
     * 新增数据
     *
     * @param hmClerkRelationQDTO 实例对象
     * @return 实例对象
     */
    int insert(HmClerkRelationQDTO hmClerkRelationQDTO);

    /**
     * 查询hm id和职员id
     *
     * @param hmId    hm id
     * @param clerkId 职员id
     * @return {@link HmClerkRelationBO }
     * @author mozhu
     * @date 2022-07-07 11:44:53
     */
    HmClerkRelationBO queryByHmIdAndClerkId(Long hmId, String clerkId);

    /**
     * 更新上线时间
     *
     * @param relationId 关系id
     * @param overFlag   是否上限1是0否
     * @return int
     * @author mozhu
     * @date 2022-07-07 13:41:29
     */
    int updateAddNumById(Long relationId, Integer overFlag);

    /**
     * 重置
     *
     * @author mozhu
     * @date 2022-07-07 13:53:13
     */
    void resetAddNumAndOverFlag();

    /**
     * 查询职员id
     *
     * @param clerkId      职员id
     * @param enterpriseId 企业标识
     * @return {@link List }<{@link HmClerkRelationBO }>
     * @author mozhu
     * @date 2022-07-08 14:48:51
     */
    List<HmClerkRelationBO> queryByClerkId(String clerkId, String enterpriseId);

    /**
     * 获取导购id
     *
     * @param hmId hm id
     * @return {@link List }<{@link String }>
     * @author mozhu
     * @date 2022-07-08 14:59:26
     */
    List<String> getClerkIdByHmId(Long hmId);


    /**
     * 获取导购
     * @param hmId hm id
     * @return {@link List }<{@link HmClerkRelationBO }>
     * @author mozhu
     * @date 2022-07-13 17:06:22
     */
    List<HmClerkRelationBO> getHmClerkByHmId(Long hmId);


    /**
     * 获取导购分页
     *
     * @param basePageInfo 基本信息页
     * @param hmId         hm id
     * @return {@link List }<{@link HmClerkRelationBO }>
     * @author mozhu
     * @date 2022-07-20 15:04:40
     */
    Page<HmClerkRelationBO> getHmClerkByHmId(BasePageInfo basePageInfo, Long hmId);


    /**
     * 获取导购
     *
     * @param hmId    hm id
     * @param staffId 员工id
     * @return {@link HmClerkRelationBO }
     * @author mozhu
     * @date 2022-07-15 17:26:53
     */
    HmClerkRelationBO getHmClerkByHmIdAndStaffId(Long hmId,String staffId);


    /**
     * 更新状态通过id
     *
     * @param status     状态
     * @param relationId 关系id
     * @return int
     * @author mozhu
     * @date 2022-07-21 16:32:14
     */
    int updateStatusById(Integer status, Long relationId);

    /**
     * 查询需要删除的数据
     *
     * @param hmId     hm id
     * @param clerkIds 职员id
     * @return {@link List }<{@link HmClerkRelationBO }>
     * @author mozhu
     * @date 2022-07-26 15:38:33
     */
    List<HmClerkRelationBO> queryByHmIdNotInClerkIds(Long hmId, List<String> clerkIds);
    
    /**
     * 
    * @Title: updateByClerkChangeStore
    * @Description: 导购转移门店更新多人活码
    * @author xugh
    * @param bo
    * @param oldClerkId
    * @throws
     */
    void updateByClerkChangeStore(String enterpriseId,String oldClerkId,String newClerkId) ;
        
    ServiceResponse<List<HmBatchModifyResultDTO>> batchModify(HmBatchModifyQDTO qdto);

}
