package com.cool.store.dao.decoration;

import com.cool.store.dto.decoration.DecorationTeamDTO;
import com.cool.store.entity.decoration.DecorationTeamConfigDO;
import com.cool.store.mapper.decoration.DecorationTeamConfigMapper;
import org.springframework.stereotype.Repository;

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

/**
 * @Author suzhuhong
 * @Date 2025/10/29 15:07
 * @Version 1.0
 */
@Repository
public class DecorationTeamConfigDAO {

    @Resource
    private DecorationTeamConfigMapper decorationTeamConfigMapper;

    public void addTeam(DecorationTeamConfigDO decorationTeamConfigDO){
        decorationTeamConfigMapper.insertSelective(decorationTeamConfigDO);
    }

    public void updateTeam(DecorationTeamConfigDO decorationTeamConfigDO){
        decorationTeamConfigMapper.updateByPrimaryKeySelective(decorationTeamConfigDO);
    }

    public DecorationTeamConfigDO getById(Long id){
        if (id == null){
            return null;
        }
        return decorationTeamConfigMapper.selectByPrimaryKey(id);
    }

    public List<DecorationTeamDTO> listByCondition(){
        return decorationTeamConfigMapper.listByCondition();
    }


}
