zhibing.pu
2024-04-15 0d5bade502337cab3fc2f96cf2d6891ded35bb77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.stylefeng.guns.modular.system.service.impl;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.RedEnvelopePaymentSettingsMapper;
import com.stylefeng.guns.modular.system.model.RedEnvelopePaymentSettings;
import com.stylefeng.guns.modular.system.service.IRedEnvelopePaymentSettingsService;
import org.springframework.stereotype.Service;
 
/**
 * @author zhibing.pu
 * @Date 2024/4/15 15:08
 */
@Service
public class RedEnvelopePaymentSettingsServiceImpl extends ServiceImpl<RedEnvelopePaymentSettingsMapper, RedEnvelopePaymentSettings> implements IRedEnvelopePaymentSettingsService {
    
    /**
     * 获取当前执行的红包支付配置
     * @return
     */
    @Override
    public RedEnvelopePaymentSettings getRedEnvelopePaymentSettings() {
        RedEnvelopePaymentSettings redEnvelopePaymentSettings = this.selectOne(new EntityWrapper<RedEnvelopePaymentSettings>()
                .eq("status", 1)
                .last(" and now() >= effectiveDate order by effectiveDate desc limit 0, 1"));
        return redEnvelopePaymentSettings;
    }
}