package com.yiqi.app.service.impl;

import java.util.List;
import com.yiqi.common.utils.DateUtils;
import com.yiqi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiqi.app.mapper.AppCouponTypeThirdPartyMapper;
import com.yiqi.app.domain.AppCouponTypeThirdParty;
import com.yiqi.app.service.IAppCouponTypeThirdPartyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * APP第三方管理Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-13
 */
@Service
public class AppCouponTypeThirdPartyServiceImpl extends ServiceImpl<AppCouponTypeThirdPartyMapper,AppCouponTypeThirdParty> implements IAppCouponTypeThirdPartyService {

    //<editor-folder desc="基础韩素">
    /**
     * 查询APP第三方管理
     *
     * @param id APP第三方管理主键
     * @return APP第三方管理
     */
    @Override
    public AppCouponTypeThirdParty selectAppCouponTypeThirdPartyById(Long id) {
        return baseMapper.selectAppCouponTypeThirdPartyById(id);
    }

    /**
     * 查询APP第三方管理列表
     *
     * @param appCouponTypeThirdParty APP第三方管理
     * @return APP第三方管理
     */
    @Override
    public List<AppCouponTypeThirdParty> selectAppCouponTypeThirdPartyList(AppCouponTypeThirdParty appCouponTypeThirdParty) {
        return baseMapper.selectAppCouponTypeThirdPartyList(appCouponTypeThirdParty);
    }

    /**
     * 新增APP第三方管理
     *
     * @param appCouponTypeThirdParty APP第三方管理
     * @return 结果
     */
    @Override
    public int insertAppCouponTypeThirdParty(AppCouponTypeThirdParty appCouponTypeThirdParty) {
        appCouponTypeThirdParty.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertAppCouponTypeThirdParty(appCouponTypeThirdParty);
    }

    /**
     * 修改APP第三方管理
     *
     * @param appCouponTypeThirdParty APP第三方管理
     * @return 结果
     */
    @Override
    public int updateAppCouponTypeThirdParty(AppCouponTypeThirdParty appCouponTypeThirdParty) {
        appCouponTypeThirdParty.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateAppCouponTypeThirdParty(appCouponTypeThirdParty);
    }

    /**
     * 批量删除APP第三方管理
     *
     * @param ids 需要删除的APP第三方管理主键
     * @return 结果
     */
    @Override
    public int deleteAppCouponTypeThirdPartyByIds(Long[] ids) {
        return baseMapper.deleteAppCouponTypeThirdPartyByIds(ids);
    }

    /**
     * 删除APP第三方管理信息
     *
     * @param id APP第三方管理主键
     * @return 结果
     */
    @Override
    public int deleteAppCouponTypeThirdPartyById(Long id) {
        return baseMapper.deleteAppCouponTypeThirdPartyById(id);
    }

    /**
     * 修改APP第三方管理状态
     *
     * @param appCouponTypeThirdParty APP第三方管理
     * @return 结果
     */
    @Override
    public int updateAppCouponTypeThirdPartyStatus(AppCouponTypeThirdParty appCouponTypeThirdParty) {
        appCouponTypeThirdParty.setUpdateBy(SecurityUtils.getUsername());
        appCouponTypeThirdParty.setUpdateById(SecurityUtils.getUserId());
        appCouponTypeThirdParty.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateAppCouponTypeThirdParty(appCouponTypeThirdParty);
    }

    //</editor-folder>

}
