package com.willalp.flow.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.willalp.common.utils.StringUtils;
import com.willalp.flow.domain.HsFlowCc;
import com.willalp.flow.mapper.HsFlowCcMapper;
import com.willalp.flow.service.IHsFlowCcService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 流程单抄送记录Service业务层处理
 *
 * @author willalp
 * @date 2023-02-14
 */
@Service
public class HsFlowCcServiceImpl extends ServiceImpl<HsFlowCcMapper, HsFlowCc>  implements IHsFlowCcService
{
    @Resource
    private HsFlowCcMapper hsFlowCcMapper;

    /**
     * 查询流程单抄送记录列表
     *
     * @param hsFlowCc 流程单抄送记录
     * @return 流程单抄送记录
     */
    @Override
    public List<HsFlowCc> selectHsFlowCcList(HsFlowCc hsFlowCc)
    {
        return hsFlowCcMapper.selectHsFlowCcList(hsFlowCc);
    }

    @Override
    public List<HsFlowCc> selectHsFlowCcListByUserId(String userId) {
        if (StringUtils.isBlank(userId)) {
            return new ArrayList<>();
        }
//        return getBaseMapper().selectList(new QueryWrapper<HsFlowCc>().last("where locate('" + userId + "',users) order by update_time desc"));
        return getBaseMapper().appGetCcRecordList(userId);
    }

}
