package io.hmit.modules.serviceOrder.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionOrganizationDao;
import io.hmit.modules.serviceOrder.dao.PensionOrganizationServiceDao;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity;
import io.hmit.modules.serviceOrder.service.PensionOrganizationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * 机构表
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2021-03-10
 */
@Service
public class PensionOrganizationServiceImpl extends CrudServiceImpl<PensionOrganizationDao, PensionOrganizationEntity, PensionOrganizationDTO> implements PensionOrganizationService {

    @Autowired
    private PensionOrganizationServiceDao pensionOrganizationServiceDao;

    @Override
    public QueryWrapper<PensionOrganizationEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<PensionOrganizationEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


    @Override
    public List<Long> findServiceIdListByServiceUserId(Long userId) {
        return pensionOrganizationServiceDao.findServiceIdListByServiceUserId(userId);
    }
}
