12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?xml version="1.0" encoding="UTF-8"?>
- <ns:hibernate xmlns:ns="http://www.primedata.com/xml/ns/j2ee/hibernate"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.primedata.com/xml/ns/j2ee/hibernate LTHibernateSchema.xsd">
- <statement id="findDataSourcePassword">
- SELECT DATASOURCE_ID,PARAM_CODE,PARAM_VALUE FROM T_HARVEST_DATASOURCE_PARAM WHERE PARAM_CODE=#password#
- </statement>
- <statement id="updateDataSourcePassword">
- UPDATE T_HARVEST_DATASOURCE_PARAM SET PARAM_VALUE=#paramValue# WHERE DATASOURCE_ID=#dataSourceId# AND
- PARAM_CODE='password'
- </statement>
- <statement id="findSingleServ">
- SELECT a.ENTITY_ID, a.ENTITY_CODE, a.ENTITY_NAME, a.PARENT_CATEGORY_ID, a.ENTITY_TYPE,
- a.PATH, a.SERVICE_CODE, b.SERVICE_NAME, b.SERVICE_URI
- from dsp_business_entity a join sam_service b on(a.SERVICE_CODE = b.SERVICE_CODE)
- where a.ENTITY_TYPE = 'T' and a.DB_TABLE_COUNT_RELATION = 1 and a.SERVICE_CODE is not null
- </statement>
- <statement id="findMutilTableServ">
- SELECT a.ENTITY_ID, a.ENTITY_CODE, a.ENTITY_NAME, a.PARENT_CATEGORY_ID, a.ENTITY_TYPE,
- a.PATH, a.SERVICE_CODE, b.SERVICE_NAME, b.SERVICE_URI
- from dsp_business_entity a join sam_service b on(a.SERVICE_CODE = b.SERVICE_CODE)
- where a.ENTITY_TYPE = 'RS' and a.DB_TABLE_COUNT_RELATION > 1 and a.SERVICE_CODE is not null
- </statement>
- <statement id="findDBEntity">
- SELECT ELEMENT_ID, PARENT_ENTITY_ID, PARENT_RESOURCE_ID,RESOURCE_TYPE,ELEMENT_NAME,ELEMENT_DESC,
- d.DATASOURCE_TYPE_CODE, d.DATASOURCE_NAME, d.DATA_PATH
- from dsp_business_element e join t_harvest_datasource d on(e.PARENT_RESOURCE_ID = d.DATASOURCE_ID)
- where e.PARENT_ENTITY_ID = ? and e.RESOURCE_TYPE != '3'
- </statement>
- <statement id="findResourceInstance">
- SELECT INSTANCE_ID, INSTANCE_CODE, INSTANCE_NAME,
- CLASSIFIER_ID, PARENT_ID, STRING_8 FROM T_MD_INSTANCE WHERE PARENT_ID = ? AND CLASSIFIER_ID = 'Column'
- </statement>
- <statement id="findSingleServiceInfo">
- SELECT a.ID as SERVICEID, a.`NAME`, a.`CODE`,
- a.URI, a.TYPE, a.queryField, b.ID as SIID, b.MODELID, c.DSID, c.TABLENAME
- FROM DSP_SERVICEINFO a JOIN dsp_si_table b on(a.ID = b.SERVICEID)
- JOIN dsp_modelinfo c on(b.MODELID = c.ID)
- where a.TYPE = 'T' and a.CODE = ?
- </statement>
- <statement id="findServiceInfo">
- SELECT a.ID as SERVICEID, a.`NAME`, a.`CODE`,
- a.URI, a.TYPE, a.queryField, b.ID as SIID, b.ID, b.DSID, b.RSSQL
- FROM DSP_SERVICEINFO a JOIN dsp_si_rs b on(a.ID = b.SERVICEID)
- where a.TYPE = 'RS' and a.CODE = ?
- </statement>
- <statement id="findUpgradeJoinResources">
- select b.ELEMENT_ID, b.PARENT_ENTITY_ID, b.PARENT_RESOURCE_ID, b.RESOURCE_TYPE, b.ELEMENT_NAME, b.ELEMENT_DESC,
- c.NEW_INSTANCE_ID, c.INSTANCE_NAME
- from dsp_business_element b join t_md_upgrade c on(b.ELEMENT_ID = c.old_instance_id)
- where b.RESOURCE_TYPE != '3'
- </statement>
- <statement id="upgradeJoinResources">
- alter table dsp_business_element
- add column NELEMENT_ID varchar(32);
- UPDATE dsp_business_element EL
- JOIN T_MD_UPGRADE MG ON (
- EL.ELEMENT_ID = MG.OLD_INSTANCE_ID
- )
- SET EL.NELEMENT_ID = MG.NEW_INSTANCE_ID
- where EL.RESOURCE_TYPE != '3';
- UPDATE dsp_business_element SET ELEMENT_ID = NELEMENT_ID WHERE NELEMENT_ID IS NOT NULL;
- alter table dsp_business_element
- drop column NELEMENT_ID;
- </statement>
- <statement id="upgradeJoinOnlineItems">
- alter table di_online_dataitem
- add column NRESOURCE_ITEM_ID varchar(32);
- UPDATE di_online_dataitem EL
- JOIN T_MD_UPGRADE MG ON (
- EL.RESOURCE_ITEM_ID = MG.OLD_INSTANCE_ID
- )
- SET EL.NRESOURCE_ITEM_ID = MG.NEW_INSTANCE_ID;
- UPDATE di_online_dataitem SET RESOURCE_ITEM_ID = NRESOURCE_ITEM_ID WHERE NRESOURCE_ITEM_ID IS NOT NULL;
- alter table di_online_dataitem
- drop column NRESOURCE_ITEM_ID;
- </statement>
- </ns:hibernate>
|