package com.hzya.frame.plugin.lets.dao.impl;

import cn.hutool.core.lang.Assert;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.lets.dao.IBdTaxitemsDao;
import com.hzya.frame.plugin.lets.entity.BdTaxitemsEntity;

import java.util.List;

/**
 * (BdTaxitems)表数据库访问层
 *
 * @author makejava
 * @since 2023-08-30 18:32:17
 */
public class BdTaxitemsDaoImpl extends MybatisGenericDao<BdTaxitemsEntity, String> implements IBdTaxitemsDao {
    @DS("lets_u8c")
    @Override
    public BdTaxitemsEntity queryBdInvbasdocByInvcode(BdTaxitemsEntity bdTaxitemsEntity) throws Exception {
        Assert.notNull(bdTaxitemsEntity, "bdTaxitemsEntity不能为空");
        Assert.notNull(bdTaxitemsEntity.getInvcode(), "存货编码不能为空");

        List<BdTaxitemsEntity> query = query("com.hzya.frame.plugin.lets.dao.impl.BdTaxitemsDaoImpl.queryBdInvbasdocByInvcode", bdTaxitemsEntity);
        if (query != null && query.size() > 0) {
            return query.get(0);
        }
        return null;
    }

    @DS("lets_u8c")
    @Override
    public   List<BdTaxitemsEntity> queryBdInvbasdocByInvcodeV2(BdTaxitemsEntity bdTaxitemsEntity) throws Exception {
        List<BdTaxitemsEntity> bdTaxitemsEntityList = query("com.hzya.frame.plugin.lets.dao.impl.BdTaxitemsDaoImpl.queryBdInvbasdocByInvcodeV2", bdTaxitemsEntity);
        return bdTaxitemsEntityList;
    }
}