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.IBdInvbasdocDao;
import com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity;

import java.util.List;

/**
 * (BdInvbasdoc)表数据库访问层
 *
 * @author makejava
 * @since 2023-08-25 11:27:08
 */
//@Repository("BdInvbasdocDaoImpl")
public class BdInvbasdocDaoImpl extends MybatisGenericDao<BdInvbasdocEntity, String> implements IBdInvbasdocDao {

    @DS("lets_u8c")
    @Override
    public BdInvbasdocEntity queryBdInvbasdocByPkInvmandoc(BdInvbasdocEntity bdInvbasdocEntity) throws Exception {
        Assert.notNull(bdInvbasdocEntity, "BdInvmandocEntity不可为空！");
        Assert.notNull(bdInvbasdocEntity.getPk_invmandoc(), "pkInvmandoc不可为空！");
//        Assert.notNull(bdInvbasdocEntity.getPk_corp(), "存货管理档案公司主键不能为空");

        return query(bdInvbasdocEntity, "com.hzya.frame.plugin.lets.dao.impl.BdInvbasdocDaoImpl.queryBdInvbasdocByPkInvmandoc");
    }

    @DS("lets_u8c")
    @Override
    public List<BdInvbasdocEntity> queryBdInvbasdocByPkInvmandocV2(BdInvbasdocEntity bdInvbasdocEntity) throws Exception {
        Assert.notNull(bdInvbasdocEntity, "BdInvmandocEntity不可为空！");
//        Assert.notNull(bdInvbasdocEntity.getPk_invmandoc(), "pkInvmandoc不可为空！");
//        Assert.notNull(bdInvbasdocEntity.getPk_corp(), "存货管理档案公司主键不能为空");

        List<BdInvbasdocEntity> bdInvbasdocEntities = queryList(bdInvbasdocEntity, "com.hzya.frame.plugin.lets.dao.impl.BdInvbasdocDaoImpl.queryBdInvbasdocByPkInvmandoc");
        return bdInvbasdocEntities;
    }

    @DS("lets_u8c")
    @Override
    public List<BdInvbasdocEntity> queryBdInvbasdocByPkInvmandocV3(BdInvbasdocEntity bdInvbasdocEntity) throws Exception {
        Assert.notNull(bdInvbasdocEntity, "bdInvbasdocEntity不能为空！");
        Assert.notNull(bdInvbasdocEntity.getInvcodes(), "invcodes不能为空");
        return queryList(bdInvbasdocEntity, "com.hzya.frame.plugin.lets.dao.impl.BdInvbasdocDaoImpl.queryBdInvbasdocByInvcodes");
    }
}