package com.sooka.system.service.impl;

import java.util.List;

import com.sooka.common.core.text.Convert;
import com.sooka.common.utils.DateUtils;
import com.sooka.framework.util.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sooka.system.mapper.TGuijiHousingconstructionYslxxMapper;
import com.sooka.system.domain.TGuijiHousingconstructionYslxx;
import com.sooka.system.service.ITGuijiHousingconstructionYslxxService;

/**
 * 用水量信息Service业务层处理
 *
 * @author lei
 * @date 2021-11-05
 */
@Service
public class TGuijiHousingconstructionYslxxServiceImpl extends Guiji_Base_Service implements ITGuijiHousingconstructionYslxxService {
    @Autowired
    private TGuijiHousingconstructionYslxxMapper tGuijiHousingconstructionYslxxMapper;

    /**
     * 查询用水量信息
     *
     * @param id 用水量信息ID
     * @return 用水量信息
     */
    @Override
    public TGuijiHousingconstructionYslxx selectTGuijiHousingconstructionYslxxById(String id) {
        return tGuijiHousingconstructionYslxxMapper.selectTGuijiHousingconstructionYslxxById(id);
    }

    /**
     * 查询用水量信息列表
     *
     * @param tGuijiHousingconstructionYslxx 用水量信息
     * @return 用水量信息
     */
    @Override
    public List<TGuijiHousingconstructionYslxx> selectTGuijiHousingconstructionYslxxList(TGuijiHousingconstructionYslxx tGuijiHousingconstructionYslxx) {
        List ls = tGuijiHousingconstructionYslxxMapper.selectTGuijiHousingconstructionYslxxList(tGuijiHousingconstructionYslxx);
        tGuijiHousingconstructionYslxx.setInterfaceinfoId("9f698aeb-27ba-4e05-9a1b-8b5471477917");
        tGuijiHousingconstructionYslxx.setInterfaceinfoName("共享-自来水公司-用水量信息");
        tGuijiHousingconstructionYslxx.setInterfacetype("platform_interfacetype_1");
        Long deptId = ShiroUtils.getSysUser().getDept().getDeptId();
        String deptName = ShiroUtils.getSysUser().getDept().getDeptName();
        tGuijiHousingconstructionYslxx.setDeptId(deptId);
        tGuijiHousingconstructionYslxx.setDeptName(deptName);
        add_log(tGuijiHousingconstructionYslxx);
        return ls;
    }

    /**
     * 新增用水量信息
     *
     * @param tGuijiHousingconstructionYslxx 用水量信息
     * @return 结果
     */
    @Override
    public int insertTGuijiHousingconstructionYslxx(TGuijiHousingconstructionYslxx tGuijiHousingconstructionYslxx) {
        tGuijiHousingconstructionYslxx.setCreateTime(DateUtils.getNowDate());
        return tGuijiHousingconstructionYslxxMapper.insertTGuijiHousingconstructionYslxx(tGuijiHousingconstructionYslxx);
    }

    /**
     * 修改用水量信息
     *
     * @param tGuijiHousingconstructionYslxx 用水量信息
     * @return 结果
     */
    @Override
    public int updateTGuijiHousingconstructionYslxx(TGuijiHousingconstructionYslxx tGuijiHousingconstructionYslxx) {
        return tGuijiHousingconstructionYslxxMapper.updateTGuijiHousingconstructionYslxx(tGuijiHousingconstructionYslxx);
    }

    /**
     * 删除用水量信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiHousingconstructionYslxxByIds(String ids) {
        return tGuijiHousingconstructionYslxxMapper.deleteTGuijiHousingconstructionYslxxByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用水量信息信息
     *
     * @param id 用水量信息ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiHousingconstructionYslxxById(String id) {
        return tGuijiHousingconstructionYslxxMapper.deleteTGuijiHousingconstructionYslxxById(id);
    }
}
