package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.LicenseMapper;
import com.ruoyi.model.domain.License;
import com.ruoyi.model.service.ILicenseService;

/**
 * 执照Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class LicenseServiceImpl implements ILicenseService 
{
    @Autowired
    private LicenseMapper licenseMapper;

    /**
     * 查询执照
     * 
     * @param licenseId 执照主键
     * @return 执照
     */
    @Override
    public License selectLicenseByLicenseId(Long licenseId)
    {
        return licenseMapper.selectLicenseByLicenseId(licenseId);
    }

    /**
     * 查询执照列表
     * 
     * @param license 执照
     * @return 执照
     */
    @Override
    public List<License> selectLicenseList(License license)
    {
        return licenseMapper.selectLicenseList(license);
    }

    /**
     * 新增执照
     * 
     * @param license 执照
     * @return 结果
     */
    @Override
    public int insertLicense(License license)
    {
        license.setCreateTime(DateUtils.getNowDate());
        return licenseMapper.insertLicense(license);
    }

    /**
     * 修改执照
     * 
     * @param license 执照
     * @return 结果
     */
    @Override
    public int updateLicense(License license)
    {
        license.setUpdateTime(DateUtils.getNowDate());
        return licenseMapper.updateLicense(license);
    }

    /**
     * 批量删除执照
     * 
     * @param licenseIds 需要删除的执照主键
     * @return 结果
     */
    @Override
    public int deleteLicenseByLicenseIds(Long[] licenseIds)
    {
        return licenseMapper.deleteLicenseByLicenseIds(licenseIds);
    }

    /**
     * 删除执照信息
     * 
     * @param licenseId 执照主键
     * @return 结果
     */
    @Override
    public int deleteLicenseByLicenseId(Long licenseId)
    {
        return licenseMapper.deleteLicenseByLicenseId(licenseId);
    }

    /**
     * 查询执照列表
     *
     * @return 执照
     */
    @Override
    public List<License> getLicenseList() {
        return licenseMapper.getLicenseList();
    }
}
