package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.houseManage.HouseManage;
import com.ruoyi.system.mapper.HouseManageMapper;
import com.ruoyi.system.service.IHouseManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 房屋管理Service业务层处理
 * 
 * @author boman
 * @date 2025-02-14
 */
@Service
public class HouseManageServiceImpl implements IHouseManageService 
{
    @Autowired
    private HouseManageMapper houseManageMapper;

    /**
     * 查询房屋管理
     * 
     * @param portalId 房屋管理主键
     * @return 房屋管理
     */
    @Override
    public HouseManage selectHouseManageByPortalId(Long portalId)
    {
        return houseManageMapper.selectHouseManageByPortalId(portalId);
    }

    /**
     * 查询房屋管理列表
     * 
     * @param houseManage 房屋管理
     * @return 房屋管理
     */
    @Override
    public List<HouseManage> selectHouseManageList(HouseManage houseManage)
    {
        return houseManageMapper.selectHouseManageList(houseManage);
    }

    /**
     * 新增房屋管理
     * 
     * @param houseManage 房屋管理
     * @return 结果
     */
    @Override
    public int insertHouseManage(HouseManage houseManage)
    {
        houseManage.setCreateTime(DateUtils.getNowDate());
        return houseManageMapper.insertHouseManage(houseManage);
    }

    /**
     * 修改房屋管理
     * 
     * @param houseManage 房屋管理
     * @return 结果
     */
    @Override
    public int updateHouseManage(HouseManage houseManage)
    {
        houseManage.setUpdateTime(DateUtils.getNowDate());
        return houseManageMapper.updateHouseManage(houseManage);
    }

    /**
     * 批量删除房屋管理
     * 
     * @param portalIds 需要删除的房屋管理主键
     * @return 结果
     */
    @Override
    public int deleteHouseManageByPortalIds(Long[] portalIds)
    {
        return houseManageMapper.deleteHouseManageByPortalIds(portalIds);
    }

    /**
     * 删除房屋管理信息
     * 
     * @param portalId 房屋管理主键
     * @return 结果
     */
    @Override
    public int deleteHouseManageByPortalId(Long portalId)
    {
        return houseManageMapper.deleteHouseManageByPortalId(portalId);
    }
}
