package com.willalp.apply.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import java.util.Map;

import com.willalp.apply.domain.HsSysApply;
import com.willalp.apply.mapper.HsSysApplyMapper;
import com.willalp.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.willalp.apply.service.IHsSysApplyService;

/**
 * 编码申请Service业务层处理
 *
 * @author bjh
 * @date 2022-01-04
 */
@Service
public class HsSysApplyServiceImpl extends ServiceImpl<HsSysApplyMapper, HsSysApply>  implements IHsSysApplyService
{
    @Autowired
    private HsSysApplyMapper hsSysApplyMapper;

    /**
     * 查询编码申请
     *
     * @param id 编码申请主键
     * @return 编码申请
     */
    @Override
    public HsSysApply selectHsSysApplyById(Long id)
    {
        return hsSysApplyMapper.selectHsSysApplyById(id);
    }

    /**
     * 查询编码申请列表
     *
     * @param hsSysApply 编码申请
     * @return 编码申请
     */
    @Override
    public List<HsSysApply> selectHsSysApplyList(HsSysApply hsSysApply)
    {
        return hsSysApplyMapper.selectHsSysApplyList(hsSysApply);
    }

    @Override
    public Map<String,Object> selectCodeById(Long id)
    {
        return hsSysApplyMapper.selectCodeById(id);
    }

    @Override
    public List<Map<String,Object>> selectHsSysLevelList(String id)
    {
        return hsSysApplyMapper.selectHsSysLevelList(id);
    }

    @Override
    public void updateSysCodename(String levelid,int i,String value)
    {
        hsSysApplyMapper.updateSysCodename(levelid,i,value);
    }

    @Override
    public List<Map<String,Object>> checkApplyData(String codeapply)
    {
        return hsSysApplyMapper.checkApplyData(codeapply);
    }
    /**
     * 新增编码申请
     *
     * @param hsSysApply 编码申请
     * @return 结果
     */
    @Override
    public int insertHsSysApply(HsSysApply hsSysApply)
    {
        hsSysApply.setCreateTime(DateUtils.getNowDate());
        return hsSysApplyMapper.insertHsSysApply(hsSysApply);
    }

    /**
     * 修改编码申请
     *
     * @param hsSysApply 编码申请
     * @return 结果
     */
    @Override
    public int updateHsSysApply(HsSysApply hsSysApply)
    {
        hsSysApply.setUpdateTime(DateUtils.getNowDate());
        return hsSysApplyMapper.updateHsSysApply(hsSysApply);
    }

    /**
     * 批量删除编码申请
     *
     * @param ids 需要删除的编码申请主键
     * @return 结果
     */
    @Override
    public int deleteHsSysApplyByIds(Long[] ids)
    {
        return hsSysApplyMapper.deleteHsSysApplyByIds(ids);
    }

    /**
     * 删除编码申请信息
     *
     * @param id 编码申请主键
     * @return 结果
     */
    @Override
    public int deleteHsSysApplyById(Long id)
    {
        return hsSysApplyMapper.deleteHsSysApplyById(id);
    }
}
