package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.proprietorHouse.ProprietorHouse;
import com.ruoyi.system.mapper.ProprietorHouseMapper;
import com.ruoyi.system.service.IProprietorHouseService;
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 ProprietorHouseServiceImpl implements IProprietorHouseService 
{
    @Autowired
    private ProprietorHouseMapper proprietorHouseMapper;

    /**
     * 查询业主房屋管理
     * 
     * @param proprietorId 业主房屋管理主键
     * @return 业主房屋管理
     */
    @Override
    public ProprietorHouse selectProprietorHouseByProprietorId(Long proprietorId)
    {
        return proprietorHouseMapper.selectProprietorHouseByProprietorId(proprietorId);
    }

    /**
     * 查询业主房屋管理列表
     * 
     * @param proprietorHouse 业主房屋管理
     * @return 业主房屋管理
     */
    @Override
    public List<ProprietorHouse> selectProprietorHouseList(ProprietorHouse proprietorHouse)
    {
        return proprietorHouseMapper.selectProprietorHouseList(proprietorHouse);
    }

    /**
     * 新增业主房屋管理
     * 
     * @param proprietorHouse 业主房屋管理
     * @return 结果
     */
    @Override
    public int insertProprietorHouse(ProprietorHouse proprietorHouse)
    {
        proprietorHouse.setCreateTime(DateUtils.getNowDate());
        return proprietorHouseMapper.insertProprietorHouse(proprietorHouse);
    }

    /**
     * 修改业主房屋管理
     * 
     * @param proprietorHouse 业主房屋管理
     * @return 结果
     */
    @Override
    public int updateProprietorHouse(ProprietorHouse proprietorHouse)
    {
        proprietorHouse.setUpdateTime(DateUtils.getNowDate());
        return proprietorHouseMapper.updateProprietorHouse(proprietorHouse);
    }

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

    /**
     * 删除业主房屋管理信息
     * 
     * @param proprietorId 业主房屋管理主键
     * @return 结果
     */
    @Override
    public int deleteProprietorHouseByProprietorId(Long proprietorId)
    {
        return proprietorHouseMapper.deleteProprietorHouseByProprietorId(proprietorId);
    }
}
