package com.ruoyi.system.service.impl.projectV2;

import java.util.List;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.projectV2.ZsyzLdpsMapper;
import com.ruoyi.system.domain.projectV2.ZsyzLdps;
import com.ruoyi.system.service.projectV2.IZsyzLdpsService;

/**
 * 招商引资_领导批示Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-26
 */
@Service
public class ZsyzLdpsServiceImpl implements IZsyzLdpsService 
{
    @Autowired
    private ZsyzLdpsMapper zsyzLdpsMapper;

    /**
     * 查询招商引资_领导批示
     * 
     * @param id 招商引资_领导批示主键
     * @return 招商引资_领导批示
     */
    @Override
    public ZsyzLdps selectZsyzLdpsById(Long id)
    {
        return zsyzLdpsMapper.selectZsyzLdpsById(id);
    }

    /**
     * 查询招商引资_领导批示列表
     * 
     * @param zsyzLdps 招商引资_领导批示
     * @return 招商引资_领导批示
     */
    @Override
    public List<ZsyzLdps> selectZsyzLdpsList(ZsyzLdps zsyzLdps)
    {
        return zsyzLdpsMapper.selectZsyzLdpsList(zsyzLdps);
    }

    /**
     * 新增招商引资_领导批示
     * 
     * @param zsyzLdps 招商引资_领导批示
     * @return 结果
     */
    @Override
    public int insertZsyzLdps(ZsyzLdps zsyzLdps)
    {
        //获取当前人员信息
        SysUser user = SecurityUtils.getLoginUser().getUser();
        zsyzLdps.setDeptId(user.getDeptId());
        zsyzLdps.setPsr(user.getUserName());
        zsyzLdps.setCjsj(DateUtils.getNowDate());
        return zsyzLdpsMapper.insertZsyzLdps(zsyzLdps);
    }

    /**
     * 修改招商引资_领导批示
     * 
     * @param zsyzLdps 招商引资_领导批示
     * @return 结果
     */
    @Override
    public int updateZsyzLdps(ZsyzLdps zsyzLdps)
    {
        //获取当前人员信息
        SysUser user = SecurityUtils.getLoginUser().getUser();
        zsyzLdps.setXgsj(DateUtils.getNowDate());
        zsyzLdps.setXgr(user.getUserName());
        if(!"1".equals(zsyzLdps.getType())){
            zsyzLdps.setZcpsnr("");
        }
        return zsyzLdpsMapper.updateZsyzLdps(zsyzLdps);
    }

    /**
     * 批量删除招商引资_领导批示
     * 
     * @param ids 需要删除的招商引资_领导批示主键
     * @return 结果
     */
    @Override
    public int deleteZsyzLdpsByIds(Long[] ids)
    {
        return zsyzLdpsMapper.deleteZsyzLdpsByIds(ids);
    }

    /**
     * 删除招商引资_领导批示信息
     * 
     * @param id 招商引资_领导批示主键
     * @return 结果
     */
    @Override
    public int deleteZsyzLdpsById(Long id)
    {
        return zsyzLdpsMapper.deleteZsyzLdpsById(id);
    }
}
