SELECT a.仓库ID,
a.仓库名称,
d.仓位ID,
d.仓位名称,
c.内码
FROM ( SELECT a.FSTOCKID '仓库ID',
b.FNAME '仓库名称'
FROM dbo.T_BD_STOCK a
INNER JOIN dbo.T_BD_STOCK_L b
ON a.FSTOCKID = b.FSTOCKID) a
LEFT JOIN ( SELECT FENTRYID '仓位值表FENTRYID',
FSTOCKID '仓库ID'
FROM dbo.T_BD_STOCKFLEXITEM) b
ON b.仓库ID = a.仓库ID
LEFT JOIN ( SELECT FDETAILID '内码',
FENTRYID '仓位值表FENTRYID',
FFLEXENTRYID '仓位表FENTRYID'
FROM T_BD_STOCKFLEXDETAIL) c
ON c.仓位值表FENTRYID = b.仓位值表FENTRYID
LEFT JOIN ( SELECT loc.FID AS '仓位ID',
locCol1L.FNAME '仓位名称',
locCol1.FENTRYID '仓位表FENTRYID'
FROM T_BAS_FLEXVALUESDETAIL loc
LEFT JOIN T_BAS_FLEXVALUESENTRY locCol1
ON (loc.FF100015 = locCol1.FENTRYID)
LEFT JOIN T_BAS_FLEXVALUESENTRY_L locCol1L
ON locCol1.FENTRYID = locCol1L.FENTRYID) d
ON d.仓位表FENTRYID = c.仓位表FENTRYID
WHERE d.仓位ID = '102345';
仓库取值
SELECT a.FSTOCKID '仓库ID',b.FNAME '仓库名称' FROM dbo.T_BD_STOCK a INNER JOIN dbo.T_BD_STOCK_L b ON a.FSTOCKID = b.FSTOCKID
T_BD_STOCK 仓库主表
T_BD_STOCK_L 仓库名称表
T_BD_STOCKFLEXITEM 仓库启用的仓位值集类型(启用的仓位维度)
T_BD_STOCKFLEXITEM 这个表存储的是仓库关联的仓位值集信息,例如:仓库A 仓位值集选则了A01 B01 两个仓位值集,则在这张表里会有两条记录 输入图片说明
FSTOCKID 仓库内码
FENTRYID 自增主键,如果仓库关联仓位值集后删除了或者选择了其他的仓位值集则会跳号
FFLEXID 仓位值集基础资料内码 t_BAS_FlexValues T_BD_STOCKFLEXDETAIL
仓库所选仓位值集类型下,可选的仓位值集明细资料(可选的仓位值) 输入图片说明 输入图片说明
FENTRYID 关联的T_BD_STOCKFLEXITEM 表中的FENTRYID
FDETAILID T_BD_STOCKFLEXDETAIL 表中内码
FFLEXENTRYID 仓位(T_BAS_FLEXVALUESDETAIL)内码
T_BAS_FLEXVALUESDETAIL
业务单据上,填写好各仓位维度的值之后,会向仓位数据表,插入一条数据,并生成一个流水主键值; 单据上仓位字段,存储此表的流水主键值; 单据通过关联此表,可以读取各个仓位维度值
FID 业务单据上仓位字段存储的值
FF100003 FF + 仓位值集的FID
T_BAS_FLEXVALUESENTRY 仓位主表
T_BAS_FLEXVALUESENTRY_L 仓位名称表
推荐阅读
您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!
请选择打赏金币数 *