package com.jeequan.jeepay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeequan.jeepay.db.entity.DivisionSubject;
import com.jeequan.jeepay.service.mapper.DivisionSubjectMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2024-04-03
 */
@Service
public class DivisionSubjectService extends ServiceImpl<DivisionSubjectMapper, DivisionSubject> {


    /**
     * 根据任务id和类型查询
     * @param taskId
     * @param type
     * @return
     */
    public List<DivisionSubject> listByTemplateIdAndType(String taskId, byte type) {
        LambdaQueryWrapper<DivisionSubject> queryWrapper = DivisionSubject.gw().eq(DivisionSubject::getTaskId, taskId).eq(DivisionSubject::getType, type);
        return baseMapper.selectList(queryWrapper);
    }
}
