package com.cool.store.dao;

import com.cool.store.entity.MemberQuestionDO;
import com.cool.store.entity.QualificationsInfoDO;
import com.cool.store.mapper.QualificationsInfoMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @Author suzhuhong
 * @Date 2024/6/21 15:26
 * @Version 1.0
 */
@Repository
public class QualificationsInfoDAO {

    @Resource
    private QualificationsInfoMapper qualificationsInfoMapper;


    /**
     * 新增与更新
     * @param request
     * @return
     */
    public boolean insertOrUpdate(QualificationsInfoDO request){
       return qualificationsInfoMapper.insertOrUpdate(request);
    }

    public void updateAuditIdByLineId(Long auditId, Long id){
        if (id==null||auditId==null){
            return;
        }
        qualificationsInfoMapper.updateAuditIdByLineId(auditId, id);
    }

    public QualificationsInfoDO getByLineId(@Param("lineId") Long lineId){
        if (lineId==null){
            return new QualificationsInfoDO();
        }
        return qualificationsInfoMapper.getByLineId(lineId);
    }
}
