package com.xingxi.business.ExpressInfo.service.impl;

import com.xingxi.common.core.text.Convert;
import com.xingxi.common.utils.DateUtils;
import com.xingxi.business.ExpressInfo.domain.ExpressInfo;
import com.xingxi.business.ExpressInfo.mapper.ExpressInfoMapper;
import com.xingxi.business.ExpressInfo.service.IExpressInfoService;
import org.springframework.stereotype.Service;

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

/**
 * 快递信息Service业务层处理
 *
 * @author xingxi
 * @date 2025-03-06
 */
@Service
public class ExpressInfoServiceImpl implements IExpressInfoService {
    @Resource
    private ExpressInfoMapper expressInfoMapper;

    /**
     * 查询快递信息
     *
     * @param expressInfoId 快递信息主键
     * @return 快递信息
     */
    @Override
    public ExpressInfo selectExpressInfoByExpressInfoId(Long expressInfoId) {
        return expressInfoMapper.selectExpressInfoByExpressInfoId(expressInfoId);
    }

    /**
     * 查询快递信息列表
     *
     * @param expressInfo 快递信息
     * @return 快递信息
     */
    @Override
    public List<ExpressInfo> selectExpressInfoList(ExpressInfo expressInfo) {
        return expressInfoMapper.selectExpressInfoList(expressInfo);
    }

    /**
     * 新增快递信息
     *
     * @param expressInfo 快递信息
     * @return 结果
     */
    @Override
    public int insertExpressInfo(ExpressInfo expressInfo) {
        expressInfo.setCreateTime(DateUtils.getNowDate());
        return expressInfoMapper.insertExpressInfo(expressInfo);
    }

    /**
     * 新增快递信息
     *
     * @param expressInfoList 快递信息
     * @return 结果
     */
    @Override
    public int batchInsertExpressInfo(List<ExpressInfo> expressInfoList) {
        return expressInfoMapper.batchInsertExpressInfo(expressInfoList);
    }

    /**
     * 修改快递信息
     *
     * @param expressInfo 快递信息
     * @return 结果
     */
    @Override
    public int updateExpressInfo(ExpressInfo expressInfo) {
        expressInfo.setUpdateTime(DateUtils.getNowDate());
        return expressInfoMapper.updateExpressInfo(expressInfo);
    }

    /**
     * 批量删除快递信息
     *
     * @param expressInfoIds 需要删除的快递信息主键
     * @return 结果
     */
    @Override
    public int deleteExpressInfoByExpressInfoIds(String expressInfoIds) {
        return expressInfoMapper.deleteExpressInfoByExpressInfoIds(Convert.toStrArray(expressInfoIds));
    }

    /**
     * 删除快递信息信息
     *
     * @param expressInfoId 快递信息主键
     * @return 结果
     */
    @Override
    public int deleteExpressInfoByExpressInfoId(Long expressInfoId) {
        return expressInfoMapper.deleteExpressInfoByExpressInfoId(expressInfoId);
    }

    /**
     * 逻辑删除快递信息
     *
     * @param expressInfoId 快递信息主键
     * @return 结果
     */
    @Override
    public int logicDeleteExpressInfoByExpressInfoId(Long expressInfoId) {
        return expressInfoMapper.logicDeleteExpressInfoByExpressInfoId(expressInfoId);
    }

    /**
     * 逻辑批量删除快递信息
     *
     * @param expressInfoIds 需要删除的数据主键集合
     * @return 结果
     */
    @Override
    public int logicDeleteExpressInfoByExpressInfoIds(String[] expressInfoIds) {
        return expressInfoMapper.logicDeleteExpressInfoByExpressInfoIds(expressInfoIds);
    }

    /**
     * 逻辑批量删除快递信息
     *
     * @param expressInfo 快递信息
     * @return 结果
     */
    @Override
    public int logicDeleteExpressInfoByCondition(ExpressInfo expressInfo) {
        return expressInfoMapper.logicDeleteExpressInfoByCondition(expressInfo);
    }
}
