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

/**
 * (BdCubasdoc)表数据库访问层
 *
 * @author makejava
 * @since 2023-08-25 09:41:41
 */
//@Repository("BdCubasdocDaoImpl")
public class BdCubasdocDaoImpl extends MybatisGenericDao<BdCubasdocEntity, String> implements IBdCubasdocDao {

    @DS("sowow_sqlserver_test")
    @Override
    public BdCubasdocEntity queryBdCumandocEntity(BdCubasdocEntity bdCumandocEntity) throws Exception {
        Assert.notNull(bdCumandocEntity, "BdCumandocEntity不可为空！");
        Assert.notNull(bdCumandocEntity.getPk_cumandoc(), "供应商管理id不能为空！");
        Assert.notNull(bdCumandocEntity.getPkCorp(), "公司id不能为空!");
//        Assert.notNull(bdCumandocEntity.getCustflag(), "客商属性不能为空!");

        return query(bdCumandocEntity, "com.hzya.frame.plugin.lets.dao.impl.BdCubasdocDaoImpl.queryBdCumandocByPkCumandoc");
    }

    @DS("sowow_sqlserver_test")
    @Override
    public String selectUserNameByPk(String cuserid) {
        return (String) selectOne("com.hzya.frame.plugin.lets.dao.impl.BdCubasdocDaoImpl.selectUserNameByPk",cuserid);
    }
}

