package com.pj.project.tb_account;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pj.utils.so.SoMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Service: tb_account -- 客户账户
 *
 * @author qzy
 */
@Service
public class TbAccountService extends ServiceImpl<TbAccountMapper, TbAccount> implements IService<TbAccount> {

    /**
     * 底层 Mapper 对象
     */
    @Autowired
    TbAccountMapper tbAccountMapper;

    TbAccount getByCustomerId(String customerId) {
        QueryWrapper<TbAccount>ew=new QueryWrapper<>();
        ew.eq("customer_id",customerId);
        return getOne(ew);
    }

    /**
     * 查集合 - 根据条件（参数为空时代表忽略指定条件）
     */
    List<TbAccount> getList(SoMap so) {
        return tbAccountMapper.getList(so);
    }


}
