package com.zcloud.service.termLibrary.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.dsno2.termLibrary.RiskTermLibraryMapper;
import com.zcloud.service.termLibrary.RiskTermLibraryService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

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

/**
 * 说明：隐患排查包保责任人任务清单
 * 作者：zhangyanli
 * 时间：2024-02-20
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class RiskTermLibraryServiceImpl implements RiskTermLibraryService {

    @Resource
    private RiskTermLibraryMapper riskTermLibraryMapper;

    /**
     * 新增
     *
     * @param pd
     * @throws Exception
     */
    @Override
    public void save(PageData pd) throws Exception {
        riskTermLibraryMapper.save(pd);
    }

    /**
     * 删除
     *
     * @param pd
     * @throws Exception
     */
    @Override
    public void delete(PageData pd) throws Exception {
        riskTermLibraryMapper.delete(pd);
    }

    /**
     * 修改
     *
     * @param pd
     * @throws Exception
     */
    @Override
    public void edit(PageData pd) throws Exception {
        riskTermLibraryMapper.edit(pd);
    }

    /**
     * 列表
     *
     * @param page
     * @throws Exception
     */
    @Override
    public List<PageData> list(Page page) throws Exception {
        return riskTermLibraryMapper.datalistPage(page);
    }

    /**
     * 列表(全部)
     *
     * @param pd
     * @throws Exception
     */
    @Override
    public List<PageData> listAll(PageData pd) throws Exception {
        return riskTermLibraryMapper.listAll(pd);
    }

    /**
     * 通过id获取数据
     *
     * @param pd
     * @throws Exception
     */
    @Override
    public PageData findById(PageData pd) throws Exception {
        return riskTermLibraryMapper.findById(pd);
    }

    /**
     * 批量删除
     *
     * @param pd
     * @throws Exception
     */
    @Override
    public void deleteAll(PageData pd) throws Exception {
        riskTermLibraryMapper.deleteAll(pd);
    }
}

