longz
2026-06-04 da780b14b8db78043d2c0f27d3bfd73111e6d550
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
29
30
31
32
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.TSysPaymentModeMapper;
import com.stylefeng.guns.modular.system.model.TSysPaymentMode;
import com.stylefeng.guns.modular.system.service.ITSysPaymentModeService;
import org.springframework.stereotype.Service;
 
@Service
public class TSysPaymentModeServiceImpl extends ServiceImpl<TSysPaymentModeMapper, TSysPaymentMode> implements ITSysPaymentModeService {
 
    @Override
    public TSysPaymentMode getPaymentMode() {
        TSysPaymentMode paymentMode = selectOne(new EntityWrapper<TSysPaymentMode>());
        if (paymentMode == null) {
            paymentMode = new TSysPaymentMode();
            paymentMode.setPrivateType(1);
            paymentMode.setTaxiType(2);
            insert(paymentMode);
        } else if (paymentMode.getTaxiType() == null || paymentMode.getTaxiType() != 2) {
            paymentMode.setTaxiType(2);
            updateById(paymentMode);
        }
        return paymentMode;
    }
 
    @Override
    public void updatePaymentMode(TSysPaymentMode paymentMode) {
        updateById(paymentMode);
    }
}