首页 > 数据库 >ERP升级物料整理SQL语句

ERP升级物料整理SQL语句

时间:2022-10-24 18:36:27浏览次数:29  
标签:语句 case ERP -- when SQL end where select

select *  from View_Kcloud_material  --创建视图
select a.fnumber as '物料代码',a.fname '物料名称',a. FModel '规格型号',a.FShortNumber '短代码', a.FFullName '全名称',a.FOrderPrice '采购单价', 
b.fname '物料属性',c.fname '单位名称',c.fnumber '单位编码',d.fname '仓库名称',d.fnumber '仓库编码',a.FQtyDecimal '数量精度',
a.FLowLimit '最低存量',a.FHighLimit '最高存量',a.FSecInv '安全库存',case a.FIsEquipment when 0 then '否' else '是' end '是否设备',
 case a.FBatchManager when 0 then '否' else '是' end '批号管理',   case a.FTrack when 76 then '加权平均'  when 77 then '移动平均' when 78 then '先进先出' 
 when 79 then '后进先出' when 80 then '分批认定' when 81 then '计划价' end '计价方法' ,e.fnumber '存货科目代码',e.fname  '存货科目名称',
 f.fnumber '销售科目代码', f.fname  '销售科目名称',g.fnumber '成本科目代码',g.fname  '成本科目名称', case a.FIsSnManage when 0 then '否' else '是' end '是否启用序列号',
 a.FTaxRate '税率',   case a.FPlanTrategy when 321 then 'MRP' when 322 then 'MPS'  when 323 then 'FAS'  when 324 then 'None'   end   '计划策略',
  case a.FOrderTrategy when 331 then '批对批(LFL)' when 332 then '期间订货量(POQ)'  when 333 then '固定批量(FOQ)'  when 334 then '再订货点(ROP)'   end   '订货策略',
  a.FLeadTime   '提前期',a.FQtyMin '最小订货量',a.FQtyMax '最大订货量',a.FDefaultRoutingID '默认工艺路线',i.fname '计划员',i.fnumber '计划员代码',j.fname '计划模式',
  case a.FInspectionLevel when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '检验方式',a.FInspectionProject '检验方案',
  case a.FProChkMde when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '产品检验方式',
  case a.FWWChkMde when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '委外加工检验方式',
  case a.FSOChkMde when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '产品检验方式',
  case a.FWthDrwChkMde when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '退货检验方式 ',
  case a.FStkChkMde when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '库存检验方式',
  case a.FOtherChkMde when 351 then '全检' when 352 then '免检' when 353 then '抽检' end '其他检验方式',a.FStkChkPrd  '库存检验',
  a.FLength '长',    a.FWidth '宽',    a.FHeight '高',    a.FSize '体积',k.fname,k.fnumber,
  a.F_163   'ERP取数时间',a.F_162   '备用',a.F_161  '自定义防爆等级',  case a.F_160 when 351 then '全检' when 352 then '免检' when 353 then '抽检' end   'WMS检验方式',
  a.F_158   '减速比/速度',a.F_157   '最大力矩/推力',a.F_156   '输入信号',a.F_155   '液压油',a.F_154   '压力等级',a.F_153   'SRM检验员',
  a.F_152   '防爆证号',a.F_151   '防护等级',a.F_150   '环境温度',a.F_149   '电源电压',a.F_148   '行程/速度',a.F_147   'PLM系统编码',
  a.F_146   '装箱物料',case a.F_145 when 40183 then '否' else '是' end   '是否看板物料',case a.F_144 when 40186 then '否' else '是' end   '是否推送WMS',a.F_143   '物料是否修改',a.F_142   '包装类别',a.F_141   '外形尺寸',
  a.F_140   '防爆等级',a.F_139   '连接',a.F_138   '重量',a.F_137   '触点容量',a.F_136   '润滑油',a.F_135   '接线图号',a.F_134   '额定电流',
  a.F_133   '力矩/推力',a.F_132   '电机功率',a.F_131   '执行标准',a.F_130   '产品大类',a.F_129   '最小包装量',a.F_128   '物料大类',
  a.F_127   '是否军工产品',a.F_126   '(军工产品)结束日期',a.F_125   '(军工产品)生效日期',a.F_124   '是否重庆名牌',
  a.F_123   '(重庆名牌)结束日期',a.F_122   '(重庆名牌)生效日期',a.F_121   '是否中国名牌',a.F_120   '(中国名牌)结束日期',
  a.F_119   '(中国名牌)生效日期',a.F_118   '是否高新产品',a.F_117   '(高新产品)结束日期',a.F_116   '(高新产品)生效日期',
  a.F_115   '是否新产品',a.F_113   '结束日期',a.F_112   '生效日期',a.F_110   '阀规格型号',a.F_109   '二级齿轮型号',
  a.F_108   '执行器规格型号',a.F_107   '物料归类测试',a.F_106   '物料归类',a.F_105   '考核标准成本',a.F_104   '旧物料代码',
  a.F_103   '客户名称',a.F_102   '表号',a.F_101   '合同号'
from t_icitem a
left join t_item  c on a.FUnitID=c.fitemid and c.FItemClassID=7 and     c.FExternID=-1
left join  t_submessage b on b. FTypeID=210 and a.FErpClsID=b.FInterID   
left join t_stock d on a.FDefaultLoc=d.fitemid
left join  t_account e on a.FAcctID=e.FAccountID   --存货科目
left join  t_account f on a.FSaleAcctID=f.FAccountID  --销售科目
left join  t_account g on a.FCostAcctID=g.FAccountID  --成本科目
left join  t_account h on a.FAPAcctID=h.FAccountID  --应付科目
left join t_emp i on a.FPlanner=i.fitemid  --计划员
left join  t_submessage j on  a.FPlanMode=j.finterid --计划模式
left join t_WorkType k on k.finterid = a.FDefaultWorkTypeID --生产工艺
where a.fdeleted=0




--科目表
select *  from t_account

select *  from t_icitem where FCostProject<>0


--物料使用状态
select *  from t_submessage where FTypeID=170
--物料属性:委外 自制
select *  from t_submessage where FTypeID=210


--检验方式
select *  from t_submessage where FTypeID=171



--计划模式
select *  from t_submessage where FTypeID=606


--是否WMS
select *  from t_submessage where FTypeID=10013


--是否看板
select *  from t_submessage where FTypeID=10012




--仓库
select *  from t_stock  

--计划策略
select *  from t_submessage where FTypeID=167

--订货策略
select *  from t_submessage where FTypeID=169

--生产类型
select *  from t_WorkType


--基本单位
select *  from  t_item where FItemClassID=7 and     FExternID=-1
select *  from t_item where fname='件'  


--基础表信息
select *  from t_tabledescription  where FTableName='t_icitem'
select *  from t_fielddescription  where FTableid=17                                                                



--自定义信息表
select *  from t_tabledescription  where FTableName like 't_icitem%'
select *  from t_fielddescription  where FTableid=60     

 

标签:语句,case,ERP,--,when,SQL,end,where,select
From: https://www.cnblogs.com/caipanlong123/p/16822364.html

相关文章

  • MySQL中数据类型宽度
    一、数据类型的取值范围和宽度字段类型对应的取值范围:类型字节有符号取值范围无符号取值范围TINYINT1-128~1270~255SMALLINT2-32768~327670......
  • springboot整合elasticsearch实现MySQL模糊查询
    es关联mysql实现模糊查询的数据流:   1、使用logstash同步mysql数据到eslogstash简介及基本操作:https://blog.csdn.net/yurun_house/article/details/109025588win......
  • mysql事务和隔离级别学习--笔记
    一、MySQL事务1、什么事事务事务(transaction)就是一个最小的单独任务单元由一个或多个SQL语句组成,在这个任务单元中,每个SQL语句都是相互依赖,整个任务单元是作为一个不可分......
  • SQL Server DB 基于多核CPU的设置
    SQLServerDB基于多核CPU的设置 随着多核CPU的普及,SQLSERVER在处理并发情况会碰到这样一个情况:一旦有个复杂查询占用了CPU,则所有的CPU都会被Block住,导致S......
  • KYLIN(麒麟系统)下安装MySQL5.0
    1groupaddmysql2useradd-gmysqlmysql3#修改密码4passwdmysql5cd/usr/local6#解压文件7tar-zxvfmysql-standard-5.0.15-linux-i686.tar.gz8......
  • 如何搭建一套学习、开发PostgreSQL的环境
    背景万事开头难,搭建好一套学习、开发PostgreSQL的环境,是重中之重。因为其他平台(Ubuntu,CentOS,MAC)的用户大多数都具备了自行安装数据库的能力,在这里我只写一个面向Wi......
  • mysql InnoDB建表时设定初始大小的方法
    InnoDB在写密集的压力时,由于B-Tree扩展,因而也会带来数据文件的扩展,然而,InnoDB数据文件扩展需要使用mutex保护数据文件,这就会导致波动。丁奇的博客说明了这个问题:WhenInno......
  • 如何搭建一套学习、开发PostgreSQL的环境
    背景万事开头难,搭建好一套学习、开发PostgreSQL的环境,是重中之重。因为其他平台(Ubuntu,CentOS,MAC)的用户大多数都具备了自行安装数据库的能力,在这里我只写一个面向Wi......
  • 动手动脑:finally语句块一定会被运行吗
    运行packagedemo;publicclassDemo2{ publicstaticvoidmain(String[]args){ try{ System.out.println("inmain");......
  • MySQL 中 不等于 会过滤掉 Null 的问题
    1.原因: 在写SQL条件语句时经常用到不等于!=的筛选条件。  此时要注意此条件会将字段为Null的数据也当做满足不等于的条件而将数据筛选掉。 2.实例:表A ......