package com.ruoyi.project.pssr.service.impl;

import com.ruoyi.project.pssr.domain.TPssrProtection;
import com.ruoyi.project.pssr.mapper.TPssrProtectionMapper;
import com.ruoyi.project.pssr.service.ITPssrProtectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 人身防护Service业务层处理
 *
 * @author ssy
 * @date 2024-09-18
 */
@Service
public class TPssrProtectionServiceImpl implements ITPssrProtectionService {
    @Autowired
    private TPssrProtectionMapper tPssrProtectionMapper;

    /**
     * 查询人身防护
     *
     * @param id 人身防护ID
     * @return 人身防护
     */
    @Override
    public TPssrProtection selectTPssrProtectionById(Long id) {
        return tPssrProtectionMapper.selectTPssrProtectionById(id);
    }

    @Override
    public int selectNoConfirmCount(Long subId) {
        return tPssrProtectionMapper.selectNoConfirmCount(subId);
    }

    @Override
    public TPssrProtection selectAllConfirmedPersonBySubId(TPssrProtection tPssrProtection) {
        return tPssrProtectionMapper.selectAllConfirmedPersonBySubId(tPssrProtection);
    }

    /**
     * 查询人身防护列表
     *
     * @param tPssrProtection 人身防护
     * @return 人身防护
     */
    @Override
    public List<TPssrProtection> selectTPssrProtectionList(TPssrProtection tPssrProtection) {
        return tPssrProtectionMapper.selectTPssrProtectionList(tPssrProtection);
    }

    /**
     * 新增人身防护
     *
     * @param tPssrProtection 人身防护
     * @return 结果
     */
    @Override
    public int insertTPssrProtection(TPssrProtection tPssrProtection) {
        return tPssrProtectionMapper.insertTPssrProtection(tPssrProtection);
    }

    /**
     * 修改人身防护
     *
     * @param tPssrProtection 人身防护
     * @return 结果
     */
    @Override
    public int updateTPssrProtection(TPssrProtection tPssrProtection) {
        return tPssrProtectionMapper.updateTPssrProtection(tPssrProtection);
    }

    @Override
    public int updateAllBySubId(TPssrProtection tPssrProtection) {
        return tPssrProtectionMapper.updateAllBySubId(tPssrProtection);
    }

    /**
     * 批量删除人身防护
     *
     * @param ids 需要删除的人身防护ID
     * @return 结果
     */
    @Override
    public int deleteTPssrProtectionByIds(Long[] ids) {
        return tPssrProtectionMapper.deleteTPssrProtectionByIds(ids);
    }

    /**
     * 删除人身防护信息
     *
     * @param id 人身防护ID
     * @return 结果
     */
    @Override
    public int deleteTPssrProtectionById(Long id) {
        return tPssrProtectionMapper.deleteTPssrProtectionById(id);
    }
}
