package com.gic.haoban.manage.service.service.impl;

import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanAppLogDao;
import com.gic.haoban.manage.service.entity.TabHaobanAppLog;
import com.gic.haoban.manage.service.service.TabHaobanAppLogService;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * (TabHaobanAppLog)表服务实现类
 *
 * @author makejava
 * @since 2023-05-11 20:42:00
 */
@Service("tabHaobanAppLogService")
public class TabHaobanAppLogServiceImpl implements TabHaobanAppLogService {
    @Resource
    private TabHaobanAppLogDao tabHaobanAppLogDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public TabHaobanAppLog queryById(Long id) {
        return this.tabHaobanAppLogDao.queryById(id);
    }

    /**
     * 分页查询
     *
     * @param tabHaobanAppLog 筛选条件
     * @param pageRequest     分页对象
     * @return 查询结果
     */
    @Override
    public Page<TabHaobanAppLog> queryByPage(TabHaobanAppLog tabHaobanAppLog, PageRequest pageRequest) {
        return null;
    }

    /**
     * 新增数据
     *
     * @param tabHaobanAppLog 实例对象
     * @return 实例对象
     */
    @Override
    public Integer insert(TabHaobanAppLog tabHaobanAppLog) {
        tabHaobanAppLog.setCreateTime(new Date());
        return this.tabHaobanAppLogDao.insert(tabHaobanAppLog);
    }

    /**
     * 修改数据
     *
     * @param tabHaobanAppLog 实例对象
     * @return 实例对象
     */
    @Override
    public TabHaobanAppLog update(TabHaobanAppLog tabHaobanAppLog) {
        this.tabHaobanAppLogDao.update(tabHaobanAppLog);
        return this.queryById(tabHaobanAppLog.getId());
    }
}
