package com.zehong.system.service.impl;

import java.util.List;

import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TUserManageVillageMapper;
import com.zehong.system.domain.TUserManageVillage;
import com.zehong.system.service.ITUserManageVillageService;

/**
 * 基本信息维护-用户管理-居住区(村庄)Service业务层处理
 * 
 * @author zehong
 * @date 2024-08-27
 */
@Service
public class TUserManageVillageServiceImpl implements ITUserManageVillageService 
{
    @Autowired
    private TUserManageVillageMapper tUserManageVillageMapper;

    /**
     * 查询基本信息维护-用户管理-居住区(村庄)
     * 
     * @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
     * @return 基本信息维护-用户管理-居住区(村庄)
     */
    @Override
    public TUserManageVillage selectTUserManageVillageById(Long fVillageId)
    {
        return tUserManageVillageMapper.selectTUserManageVillageById(fVillageId);
    }

    /**
     * 查询基本信息维护-用户管理-居住区(村庄)列表
     * 
     * @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
     * @return 基本信息维护-用户管理-居住区(村庄)
     */
    @Override
    public List<TUserManageVillage> selectTUserManageVillageList(TUserManageVillage tUserManageVillage)
    {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        String deptId = user.getDeptId();
        tUserManageVillage.setBeyondEnterpriseId(deptId);
        return tUserManageVillageMapper.selectTUserManageVillageList(tUserManageVillage);
    }

    /**
     * 查询基本信息维护-用户管理-居住区(村庄)导出
     *
     * @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
     * @return 基本信息维护-用户管理-居住区(村庄)
     */
    @Override
    public List<TUserManageVillage> exportTUserManageVillageList(TUserManageVillage tUserManageVillage) {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        String deptId = user.getDeptId();
        tUserManageVillage.setBeyondEnterpriseId(deptId);
        return tUserManageVillageMapper.exportUserManageVillageList(tUserManageVillage);
    }

    /**
     * 新增基本信息维护-用户管理-居住区(村庄)
     * 
     * @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
     * @return 结果
     */
    @Override
    public int insertTUserManageVillage(TUserManageVillage tUserManageVillage)
    {
        return tUserManageVillageMapper.insertTUserManageVillage(tUserManageVillage);
    }

    /**
     * 修改基本信息维护-用户管理-居住区(村庄)
     * 
     * @param tUserManageVillage 基本信息维护-用户管理-居住区(村庄)
     * @return 结果
     */
    @Override
    public int updateTUserManageVillage(TUserManageVillage tUserManageVillage)
    {
        return tUserManageVillageMapper.updateTUserManageVillage(tUserManageVillage);
    }

    /**
     * 批量删除基本信息维护-用户管理-居住区(村庄)
     * 
     * @param fVillageIds 需要删除的基本信息维护-用户管理-居住区(村庄)ID
     * @return 结果
     */
    @Override
    public int deleteTUserManageVillageByIds(Long[] fVillageIds)
    {
        return tUserManageVillageMapper.deleteTUserManageVillageByIds(fVillageIds);
    }

    /**
     * 删除基本信息维护-用户管理-居住区(村庄)信息
     * 
     * @param fVillageId 基本信息维护-用户管理-居住区(村庄)ID
     * @return 结果
     */
    @Override
    public int deleteTUserManageVillageById(Long fVillageId)
    {
        return tUserManageVillageMapper.deleteTUserManageVillageById(fVillageId);
    }
}
