一、模板相关的表
- 模板的主表:PUB_PAGE_TEMPLET
- 区域的表:PUB_AREA
- 表单的表: PUB_PAGE_TEMPLET
查询单据模板某个字段配置
SELECT fp.*
FROM PUB_PAGE_TEMPLET t
LEFT JOIN PUB_AREA a ON t.PK_PAGE_TEMPLET = a.TEMPLETID
LEFT JOIN PUB_FORM_PROPERTY fp ON fp.AREAID = a.pk_area
WHERE t.APPCODE = '201102BCLF400' -- 应用的编码
AND t.CODE = '20110ETEA_2641_2642' -- 模板的编码
AND t.PAGECODE = '201102BCLF_C' -- 应用注册页面的编码
AND a.CODE = 'arap_bxbusitem' -- - 模板区域的编码
AND fp.CODE = 'jkbxr';
更新模板的属性
---更新表体报销人的参照
UPDATE PUB_FORM_PROPERTY SET REFCODE = 'erm/public/refer/ExpPsndocRef/index', REFNAME = '报销单人员' WHERE PK_FORM_PROPERTY =( SELECT fp.REFCODE ,fp.REFNAME ,t.ts FROM PUB_PAGE_TEMPLET t LEFT JOIN PUB_AREA a ON t.PK_PAGE_TEMPLET = a.TEMPLETID LEFT JOIN PUB_FORM_PROPERTY fp ON fp.AREAID = a.pk_area WHERE t.APPCODE='201102BCLF400' -- 应用的编码 AND t.CODE = '20110ETEA_2641_2642' -- 模板的编码 AND t.PAGECODE = '201102BCLF_C' -- 应用注册页面的编码 AND a.CODE = 'arap_bxbusitem' --- 模板区域的编码 AND fp.CODE = 'jkbxr'; ---字段的编码 )
---更新完成之后,需要更新模板的ts,使脚本生效
UPDATE PUB_PAGE_TEMPLET
SET TS = to_char(SYSDATE, 'yyyy-mm-dd hh24:mi:ss')
WHERE APPCODE = '201102BCLF400'
AND CODE = '20110ETEA_2641_2642'
AND PAGECODE = '201102BCLF_C'