package com.ruoyi.generator.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.generator.mapper.SysProjectTemplateMapper;
import com.ruoyi.generator.domain.SysProjectTemplate;
import com.ruoyi.generator.service.ISysProjectTemplateService;

/**
 * 项目模板配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-09
 */
@Service
public class SysProjectTemplateServiceImpl implements ISysProjectTemplateService 
{
    @Autowired
    private SysProjectTemplateMapper sysProjectTemplateMapper;

    /**
     * 查询项目模板配置
     * 
     * @param id 项目模板配置主键
     * @return 项目模板配置
     */
    @Override
    public SysProjectTemplate selectSysProjectTemplateById(Long id)
    {
        return sysProjectTemplateMapper.selectSysProjectTemplateById(id);
    }

    @Override
    public SysProjectTemplate selectSysProjectTemplateByProjectAndType(Long projectId, String templateType) {
        SysProjectTemplate sysProjectTemplate = new SysProjectTemplate();
        sysProjectTemplate.setProjectId(projectId);
        sysProjectTemplate.setTemplateType(templateType);
        return sysProjectTemplateMapper.selectSysProjectTemplateByProjectAndType(sysProjectTemplate);
    }

    /**
     * 查询项目模板配置列表
     * 
     * @param sysProjectTemplate 项目模板配置
     * @return 项目模板配置
     */
    @Override
    public List<SysProjectTemplate> selectSysProjectTemplateList(SysProjectTemplate sysProjectTemplate)
    {
        return sysProjectTemplateMapper.selectSysProjectTemplateList(sysProjectTemplate);
    }

    /**
     * 新增项目模板配置
     * 
     * @param sysProjectTemplate 项目模板配置
     * @return 结果
     */
    @Override
    public int insertSysProjectTemplate(SysProjectTemplate sysProjectTemplate)
    {
        return sysProjectTemplateMapper.insertSysProjectTemplate(sysProjectTemplate);
    }

    /**
     * 修改项目模板配置
     * 
     * @param sysProjectTemplate 项目模板配置
     * @return 结果
     */
    @Override
    public int updateSysProjectTemplate(SysProjectTemplate sysProjectTemplate)
    {
        return sysProjectTemplateMapper.updateSysProjectTemplate(sysProjectTemplate);
    }

    /**
     * 批量删除项目模板配置
     * 
     * @param ids 需要删除的项目模板配置主键
     * @return 结果
     */
    @Override
    public int deleteSysProjectTemplateByIds(Long[] ids)
    {
        return sysProjectTemplateMapper.deleteSysProjectTemplateByIds(ids);
    }

    @Override
    public int deleteSysProjectTemplateByProjectId(Long projectId) {
        return sysProjectTemplateMapper.deleteSysProjectTemplateByProjectId(projectId);
    }

    /**
     * 删除项目模板配置信息
     * 
     * @param id 项目模板配置主键
     * @return 结果
     */
    @Override
    public int deleteSysProjectTemplateById(Long id)
    {
        return sysProjectTemplateMapper.deleteSysProjectTemplateById(id);
    }

    /**
     * 根据项目ID查询项目模板配置列表
     *
     * @param projectId 项目ID
     * @return 项目模板配置集合
     */
    @Override
    public List<SysProjectTemplate> selectSysProjectTemplateListByProjectId(Long projectId)
    {
        return sysProjectTemplateMapper.selectSysProjectTemplateListByProjectId(projectId);
    }
}
