package org.dromara.payment.worker.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.payment.worker.domain.UserWorkerBusiness;
import org.dromara.payment.worker.domain.bo.UserWorkerBo;
import org.dromara.payment.worker.domain.bo.UserWorkerBusinessBo;
import org.dromara.payment.worker.domain.vo.UserWorkerBusinessVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.payment.worker.domain.vo.UserWorkerVo;

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

/**
 * 用工签约查询Mapper接口
 *
 * @author LionLi
 * @date 2024-04-26
 */
public interface UserWorkerBusinessMapper extends BaseMapperPlus<UserWorkerBusiness, UserWorkerBusinessVo> {


    /***
     * 用工签约查询
     * @param page
     * @param wrapper
     * @return
     */
    Page<UserWorkerBusinessVo> selUserWorkSignLists(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper wrapper);



    /***
     * 用工签约查询 ,不分页
     * @param wrapper
     * @return
     */
    List<UserWorkerBusinessVo> selUserWorkSignLists( @Param(Constants.WRAPPER) Wrapper wrapper);




    /***
     * 根据签约id，查询用工签约详情
     * @param id
     * @return
     */
    UserWorkerBusinessVo selUserWorkDetail(Long id);


    /***
     * 更新用工信息
     * @param userWorkerBo
     * @return
     */
    int updateUserWorkByCardId(UserWorkerBo userWorkerBo);

    /***
     *  更新用工信息
     * @param uwbo
     * @return
     */
    int updateUserWorkBisByWorkId(UserWorkerBusinessBo uwbo);

//    int updateUserWorkByPhone(UserWorkerBo userWorkerBo);


    /***
     * 根据身份证查询用工信息
     * @param merId
     * @param cardId
     * @return
     */
    UserWorkerBusinessVo selUserWorkByIdCard(@Param("merId")Long merId,@Param("cardId")String cardId,@Param("busType")Integer busType,@Param("sydId")Long sydId);


    /***
     * 簽約信息查詢會員信息
     * @param bo
     * @return
     */
    UserWorkerVo selMemberInfo(UserWorkerBusinessBo  bo);


    /***
     * 根据服务商ID，获取签约默认渠道
     * @param sydId
     * @return
     */
    String selSydDefaultChannel(Long sydId);


    Page<UserWorkerBusinessVo> selUserWorkByMerServInfo(@Param("page") IPage page,
                                                        @Param("merId")Long merId,
                                                        @Param("sydId")Long sydId,
                                                        @Param("workIds")String workIds,
                                                        @Param("busType")Integer busType);


    List<UserWorkerBusinessVo> selUserWorkByMerServInfo(
                                                        @Param("merId")Long merId,
                                                        @Param("sydId")Long sydId,
                                                        @Param("workIds")String workIds,
                                                        @Param("busType")Integer busType);



    List<UserWorkerBusinessVo> selUserWorkBizByCon(Map map);


    /****
     * 根据自雇者id，服务商id，业务类型查询签约信息
     * @param map
     * @return
     */
    List<UserWorkerBusinessVo> selUserWorkBizByWorkIdSydIdBusType(Map map);



}
