package com.ruoyi.branch.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.branch.mapper.TBranchAssessMapper;
import com.ruoyi.branch.domain.TBranchAssess;
import com.ruoyi.branch.service.ITBranchAssessService;

/**
 * 纪律考评Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-31
 */
@Service
public class TBranchAssessServiceImpl implements ITBranchAssessService 
{
    @Autowired
    private TBranchAssessMapper tBranchAssessMapper;

    /**
     * 查询纪律考评
     * 
     * @param assessId 纪律考评主键
     * @return 纪律考评
     */
    @Override
    public TBranchAssess selectTBranchAssessByAssessId(Long assessId)
    {
        return tBranchAssessMapper.selectTBranchAssessByAssessId(assessId);
    }

    /**
     * 查询纪律考评列表
     * 
     * @param tBranchAssess 纪律考评
     * @return 纪律考评
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<TBranchAssess> selectTBranchAssessList(TBranchAssess tBranchAssess)
    {
        return tBranchAssessMapper.selectTBranchAssessList(tBranchAssess);
    }

    /**
     * 新增纪律考评
     * 
     * @param tBranchAssess 纪律考评
     * @return 结果
     */
    @Override
    public int insertTBranchAssess(TBranchAssess tBranchAssess)
    {
        tBranchAssess.setCreateTime(DateUtils.getNowDate());
        return tBranchAssessMapper.insertTBranchAssess(tBranchAssess);
    }

    /**
     * 修改纪律考评
     * 
     * @param tBranchAssess 纪律考评
     * @return 结果
     */
    @Override
    public int updateTBranchAssess(TBranchAssess tBranchAssess)
    {
        tBranchAssess.setUpdateTime(DateUtils.getNowDate());
        return tBranchAssessMapper.updateTBranchAssess(tBranchAssess);
    }

    /**
     * 批量删除纪律考评
     * 
     * @param assessIds 需要删除的纪律考评主键
     * @return 结果
     */
    @Override
    public int deleteTBranchAssessByAssessIds(Long[] assessIds)
    {
        return tBranchAssessMapper.deleteTBranchAssessByAssessIds(assessIds);
    }

    /**
     * 删除纪律考评信息
     * 
     * @param assessId 纪律考评主键
     * @return 结果
     */
    @Override
    public int deleteTBranchAssessByAssessId(Long assessId)
    {
        return tBranchAssessMapper.deleteTBranchAssessByAssessId(assessId);
    }
}
