package org.jeecg.modules.bytedance.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.bytedance.common.entity.WexinConfig;
import org.jeecg.modules.bytedance.common.mapper.WexinConfigMapper;
import org.jeecg.modules.bytedance.common.service.IWexinConfigService;
import org.springframework.stereotype.Service;

/**
 * 企业微信配置信息
 *
 * @author jeecg-boot
 * 2021-06-17
 * @version V1.0
 */
@Service
public class WexinConfigServiceImpl extends ServiceImpl<WexinConfigMapper, WexinConfig> implements IWexinConfigService {

    @Override
    public WexinConfig getInfoByCorpId(String corpId) {
        QueryWrapper<WexinConfig> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("corp_id", corpId);
        queryWrapper.orderByDesc("create_time");
        queryWrapper.last("limit 1");
        return this.getOne(queryWrapper);
    }
}
