package com.qryord.project.business.query.service.impl;

import com.qryord.common.utils.DateUtils;
import com.qryord.common.utils.text.Convert;
import com.qryord.project.business.query.domain.TQuery;
import com.qryord.project.business.query.mapper.TQueryMapper;
import com.qryord.project.business.query.service.ITQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 查询履历Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-06
 */
@Service
public class TQueryServiceImpl implements ITQueryService 
{
    @Autowired
    private TQueryMapper tQueryMapper;

    /**
     * 查询查询履历
     * 
     * @param id 查询履历主键
     * @return 查询履历
     */
    @Override
    public TQuery selectTQueryById(Long id)
    {
        return tQueryMapper.selectTQueryById(id);
    }

    /**
     * 查询查询履历列表
     * 
     * @param tQuery 查询履历
     * @return 查询履历
     */
    @Override
    public List<TQuery> selectTQueryList(TQuery tQuery)
    {
        return tQueryMapper.selectTQueryList(tQuery);
    }

    /**
     * 新增查询履历
     * 
     * @param tQuery 查询履历
     * @return 结果
     */
    @Override
    public int insertTQuery(TQuery tQuery)
    {
        tQuery.setCreateTime(DateUtils.getNowDate());
        return tQueryMapper.insertTQuery(tQuery);
    }

    /**
     * 修改查询履历
     * 
     * @param tQuery 查询履历
     * @return 结果
     */
    @Override
    public int updateTQuery(TQuery tQuery)
    {
        tQuery.setUpdateTime(DateUtils.getNowDate());
        return tQueryMapper.updateTQuery(tQuery);
    }

    /**
     * 批量删除查询履历
     * 
     * @param ids 需要删除的查询履历主键
     * @return 结果
     */
    @Override
    public int deleteTQueryByIds(String ids)
    {
        return tQueryMapper.deleteTQueryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除查询履历信息
     * 
     * @param id 查询履历主键
     * @return 结果
     */
    @Override
    public int deleteTQueryById(Long id)
    {
        return tQueryMapper.deleteTQueryById(id);
    }
}
