package com.shkj.wcs.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shkj.common.utils.SecurityUtils;
import com.shkj.wcs.bo.WcsPlcPropertyQueryBo;
import com.shkj.wcs.domain.WcsPlcProperty;
import com.shkj.wcs.mapper.WcsPlcPropertyMapper;
import com.shkj.wcs.service.IWcsPlcPropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * PLC连接属性Service业务层处理
 *
 * @author zjx
 * @date 2023-04-21
 */
@Service
public class WcsPlcPropertyServiceImpl extends ServiceImpl<WcsPlcPropertyMapper, WcsPlcProperty> implements IWcsPlcPropertyService {
    @Autowired
    private WcsPlcPropertyMapper wcsPlcPropertyMapper;

    @Autowired
    private RedisTemplate redisTemplate;


    /**
     * 查询PLC连接属性
     *
     * @param id PLC连接属性主键
     * @return PLC连接属性
     */
    @Override
    public WcsPlcProperty selectWcsPlcPropertyById(Long id)
    {
        return wcsPlcPropertyMapper.selectWcsPlcPropertyById(id);
    }

    /**
     * 查询PLC连接属性列表
     *
     * @param wcsPlcProperty PLC连接属性
     * @return PLC连接属性
     */
    @Override
    public List<WcsPlcProperty> selectWcsPlcPropertyList(WcsPlcProperty wcsPlcProperty)
    {
        return wcsPlcPropertyMapper.selectWcsPlcPropertyList(wcsPlcProperty);
    }

    /**
     * 新增PLC连接属性
     *
     * @param wcsPlcProperty PLC连接属性
     * @return 结果
     */
    @Override
    public int insertWcsPlcProperty(WcsPlcProperty wcsPlcProperty)
    {
        return wcsPlcPropertyMapper.insertWcsPlcProperty(wcsPlcProperty);
    }

    /**
     * 修改PLC连接属性
     *
     * @param wcsPlcProperty PLC连接属性
     * @return 结果
     */
    @Override
    public int updateWcsPlcProperty(WcsPlcProperty wcsPlcProperty)
    {
        return wcsPlcPropertyMapper.updateWcsPlcProperty(wcsPlcProperty);
    }



    /**
     * 删除PLC连接属性信息
     *
     * @param id PLC连接属性主键
     * @return 结果
     */
    @Override
    public int deleteWcsPlcPropertyById(Long id)
    {
        return wcsPlcPropertyMapper.deleteWcsPlcPropertyById(id);
    }

    @Override
    public List<WcsPlcProperty> getWcsPlcPropertyByPlcId(Long plcId) {

        return wcsPlcPropertyMapper.getWcsPlcPropertyByPlcId(plcId);
    }

    @Override
    public WcsPlcProperty getWcsPlcPropertyByPlcIdAndPoint(WcsPlcPropertyQueryBo bo){
        return wcsPlcPropertyMapper.getWcsPlcPropertyByPlcIdAndPoint(bo);
    }

    @Override
    public int deleteWcsPlcPropertyByPlcId(Long plcId) {
        return wcsPlcPropertyMapper.deleteWcsPlcPropertyByPlcId(plcId);
    }

}
