src/org/openbravo/erpCommon/ad_process/AssetDelivery_data.xsql
author Asier Lostalé <asier.lostale@openbravo.com>
Mon, 05 May 2008 06:59:24 +0000
changeset 799 fef2c5e2feb7
parent 423 ecf368072c48
child 1605 8a0fe0193bef
permissions -rw-r--r--
Merged cleanup branch (r3931) with trunk
carlos@0
     1
<?xml version="1.0" encoding="UTF-8" ?>
carlos@0
     2
<!--
carlos@0
     3
 *************************************************************************
carlos@0
     4
 * The contents of this file are subject to the Openbravo  Public  License
carlos@0
     5
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
carlos@0
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
carlos@0
     7
 * file except in compliance with the License. You  may  obtain  a copy of
carlos@0
     8
 * the License at http://www.openbravo.com/legal/license.html 
carlos@0
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
carlos@0
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
carlos@0
    11
 * License for the specific  language  governing  rights  and  limitations
carlos@0
    12
 * under the License. 
carlos@0
    13
 * The Original Code is Openbravo ERP. 
carlos@0
    14
 * The Initial Developer of the Original Code is Openbravo SL 
carlos@0
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
carlos@0
    16
 * All Rights Reserved. 
carlos@0
    17
 * Contributor(s):  ______________________________________.
carlos@0
    18
 ************************************************************************
carlos@0
    19
-->
carlos@0
    20
carlos@0
    21
carlos@0
    22
carlos@0
    23
carlos@0
    24
carlos@0
    25
<SqlClass name="AssetDeliveryData" package="org.openbravo.erpCommon.ad_process">
carlos@0
    26
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    27
    <SqlMethodComment></SqlMethodComment>
carlos@0
    28
    <Sql>
carlos@0
    29
      <![CDATA[
carlos@0
    30
        SELECT A_ASSET_ID, GUARANTEEDATE , '' AS ISHTML, '' AS MAILHEADER, '' AS MAILTEXT,
carlos@0
    31
         '' AS DOWNLOADURL, '' AS VERSIONNO, '' AS R_MAILTEXT_ID, '' AS EMAIL, '' AS EMAILUSER, '' AS EMAILUSERPW,
carlos@0
    32
         '' AS AD_USER_ID, '' AS LOT, '' AS SERNO, '' AS M_PRODUCT_ID
carlos@0
    33
        FROM A_ASSET A, M_PRODUCT P
carlos@0
    34
        WHERE A.M_PRODUCT_ID = P.M_PRODUCT_ID
carlos@0
    35
        AND 1=1
carlos@0
    36
      ]]>
carlos@0
    37
    </Sql>
carlos@423
    38
    <Parameter name="bpartner" optional="true" after="AND 1=1"><![CDATA[ AND A.C_BPARTNER_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
    39
    <Parameter name="product" optional="true" after="AND 1=1"><![CDATA[ AND P.M_PRODUCT_ID = TO_NUMBER(?)]]></Parameter>
carlos@423
    40
    <Parameter name="assetgroup" optional="true" after="AND 1=1"><![CDATA[ AND A.A_ASSET_GROUP_ID = TO_NUMBER(?)]]></Parameter>
carlos@0
    41
    <Parameter name="GuaranteeDate" optional="true" after="AND 1=1"><![CDATA[ AND TRUNC(GUARANTEEDATE) >= TRUNC(TO_DATE(?))]]></Parameter>
carlos@0
    42
  </SqlMethod>
carlos@0
    43
  <SqlMethod name="getUser" type="preparedStatement" return="String">
carlos@0
    44
    <SqlMethodComment></SqlMethodComment>
carlos@0
    45
    <Sql>
carlos@0
    46
      <![CDATA[
carlos@0
    47
      SELECT AD_USER_ID 
carlos@0
    48
      FROM A_ASSET
carlos@423
    49
      WHERE A_ASSET_ID = TO_NUMBER(?)
carlos@0
    50
      ]]>
carlos@0
    51
    </Sql>
carlos@0
    52
    <Parameter name="aAssetId"/>
carlos@0
    53
  </SqlMethod>
carlos@0
    54
  <SqlMethod name="isActive" type="preparedStatement" return="String">
carlos@0
    55
    <SqlMethodComment></SqlMethodComment>
carlos@0
    56
    <Sql>
carlos@0
    57
      <![CDATA[
carlos@0
    58
      SELECT ISACTIVE 
carlos@0
    59
      FROM A_ASSET
carlos@423
    60
      WHERE A_ASSET_ID = TO_NUMBER(?)
carlos@0
    61
      ]]>
carlos@0
    62
    </Sql>
carlos@0
    63
    <Parameter name="aAssetId"/>
carlos@0
    64
  </SqlMethod>
carlos@0
    65
  <SqlMethod name="guaranteeDate" type="preparedStatement" return="String">
carlos@0
    66
    <SqlMethodComment></SqlMethodComment>
carlos@0
    67
    <Sql>
carlos@0
    68
      <![CDATA[
carlos@0
    69
      SELECT to_char(GUARANTEEDATE , to_char(?)) AS GUARANTEEDATE
carlos@0
    70
      FROM A_ASSET
carlos@423
    71
      WHERE A_ASSET_ID = TO_NUMBER(?)
carlos@0
    72
      ]]>
carlos@0
    73
    </Sql>
carlos@0
    74
    <Parameter name="dateFormat"/>
carlos@0
    75
    <Parameter name="aAssetId"/>
carlos@0
    76
  </SqlMethod>
carlos@0
    77
  <SqlMethod name="isSMTPAuthorization" type="preparedStatement" return="String">
carlos@0
    78
    <SqlMethodComment></SqlMethodComment>
carlos@0
    79
    <Sql>
carlos@0
    80
      <![CDATA[
carlos@0
    81
      SELECT ISSMTPAUTHORIZATION FROM AD_CLIENT
carlos@423
    82
      WHERE AD_CLIENT_ID = TO_NUMBER(?)
carlos@0
    83
      ]]>
carlos@0
    84
    </Sql>
carlos@0
    85
    <Parameter name="AdClientId"/>
carlos@0
    86
  </SqlMethod>
carlos@0
    87
  <SqlMethod name="selectSMTPHost" type="preparedStatement" return="String" default="">
carlos@0
    88
    <SqlMethodComment></SqlMethodComment>
carlos@0
    89
    <Sql>
carlos@0
    90
      <![CDATA[
carlos@423
    91
        SELECT SMTPHost AS NAME FROM AD_Client WHERE AD_Client_ID = TO_NUMBER(?)
carlos@0
    92
      ]]>
carlos@0
    93
    </Sql>
carlos@0
    94
    <Parameter name="adClientId"/>
carlos@0
    95
  </SqlMethod>
carlos@0
    96
  <SqlMethod name="selectAssetHelp" type="preparedStatement" return="String">
carlos@0
    97
    <SqlMethodComment></SqlMethodComment>
carlos@0
    98
    <Sql>
carlos@0
    99
      <![CDATA[
carlos@0
   100
      SELECT HELP 
carlos@0
   101
      FROM A_ASSET
carlos@423
   102
      WHERE A_ASSET_ID = TO_NUMBER(?)
carlos@0
   103
      ]]>
carlos@0
   104
    </Sql>
carlos@0
   105
    <Parameter name="aAssetId"/>
carlos@0
   106
  </SqlMethod>
carlos@0
   107
  <SqlMethod name="getEmail" type="preparedStatement" return="String">
carlos@0
   108
    <SqlMethodComment></SqlMethodComment>
carlos@0
   109
    <Sql>
carlos@0
   110
      <![CDATA[
carlos@0
   111
      SELECT EMAIL FROM AD_USER
carlos@423
   112
      WHERE AD_USER_ID = TO_NUMBER(?)
carlos@0
   113
      ]]>
carlos@0
   114
    </Sql>
carlos@0
   115
    <Parameter name="adUserId"/>
carlos@0
   116
  </SqlMethod>
carlos@0
   117
  <SqlMethod name="selectMailtext" type="preparedStatement" return="multiple">
carlos@0
   118
    <SqlMethodComment></SqlMethodComment>
carlos@0
   119
    <Sql>
carlos@0
   120
      <![CDATA[
carlos@0
   121
      SELECT ISHTML, MAILHEADER, MAILTEXT 
carlos@0
   122
      FROM R_MAILTEXT
carlos@423
   123
      WHERE R_MAILTEXT_ID = TO_NUMBER(?)
carlos@0
   124
      ]]>
carlos@0
   125
    </Sql>
carlos@0
   126
    <Parameter name="rMailtextId"/>
carlos@0
   127
  </SqlMethod>
carlos@0
   128
  <SqlMethod name="selectEmailRequest" type="preparedStatement" return="multiple">
carlos@0
   129
    <SqlMethodComment></SqlMethodComment>
carlos@0
   130
    <Sql>
carlos@0
   131
      <![CDATA[
carlos@0
   132
        SELECT RequestEMail AS EMail, RequestUser AS EMailUser, RequestUserPw AS EMailUserPw 
carlos@423
   133
        FROM AD_Client WHERE AD_Client_ID = TO_NUMBER(?)
carlos@0
   134
      ]]>
carlos@0
   135
    </Sql>
carlos@0
   136
    <Parameter name="adClientId"/>
carlos@0
   137
  </SqlMethod>
carlos@0
   138
  <SqlMethod name="selectProductInfo" type="preparedStatement" return="multiple">
carlos@0
   139
    <SqlMethodComment></SqlMethodComment>
carlos@0
   140
    <Sql>
carlos@0
   141
      <![CDATA[
asier@799
   142
      SELECT P.DOWNLOADURL, P.VERSIONNO, P.M_PRODUCT_ID
carlos@0
   143
      FROM M_PRODUCT P, A_ASSET A
carlos@0
   144
      WHERE P.M_PRODUCT_ID = A.M_PRODUCT_ID
carlos@423
   145
      AND A.A_ASSET_ID = TO_NUMBER(?)
carlos@0
   146
      ]]>
carlos@0
   147
    </Sql>
carlos@0
   148
    <Parameter name="aAssetId"/>
carlos@0
   149
  </SqlMethod>
carlos@0
   150
  <SqlMethod name="selectAssetInfo" type="preparedStatement" return="multiple">
carlos@0
   151
    <SqlMethodComment></SqlMethodComment>
carlos@0
   152
    <Sql>
carlos@0
   153
      <![CDATA[
carlos@0
   154
      SELECT AD_USER_ID, LOT, SERNO, VERSIONNO
carlos@0
   155
      FROM A_ASSET A
carlos@423
   156
      WHERE A.A_ASSET_ID = TO_NUMBER(?)
carlos@0
   157
      ]]>
carlos@0
   158
    </Sql>
carlos@0
   159
    <Parameter name="aAssetId"/>
carlos@0
   160
  </SqlMethod>
carlos@0
   161
  <SqlMethod name="update" type="preparedStatement" return="rowcount">
carlos@0
   162
    <SqlMethodComment></SqlMethodComment>
carlos@0
   163
    <Sql>
carlos@0
   164
      <![CDATA[
carlos@0
   165
      UPDATE A_ASSET SET HELP = HELP || ?, ISACTIVE = 'N'
carlos@423
   166
      WHERE A_ASSET_ID = TO_NUMBER(?)
carlos@0
   167
      ]]>
carlos@0
   168
    </Sql>
carlos@0
   169
    <Parameter name="help"/>
carlos@0
   170
    <Parameter name="aAssetId"/>
carlos@0
   171
  </SqlMethod>
carlos@0
   172
  <SqlMethod name="insert" type="preparedStatement" return="rowcount">
carlos@0
   173
    <SqlMethodComment></SqlMethodComment>
carlos@0
   174
    <Sql>
carlos@0
   175
      <![CDATA[
carlos@0
   176
      INSERT INTO A_ASSET_DELIVERY (AD_CLIENT_ID, AD_ORG_ID,ISACTIVE,CREATED, CREATEDBY,UPDATED, UPDATEDBY,
carlos@0
   177
      A_ASSET_DELIVERY_ID,A_ASSET_ID, MOVEMENTDATE, VERSIONNO, LOT, SERNO, EMAIL, AD_USER_ID)
carlos@0
   178
      VALUES(TO_NUMBER(?), TO_NUMBER(?), 'Y',now(), TO_NUMBER(?), now(), TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), TO_DATE(?), ?, ?, ?, ?, TO_NUMBER(?))
carlos@0
   179
      ]]>
carlos@0
   180
    </Sql>
carlos@0
   181
    <Parameter name="adClientId"/>
carlos@0
   182
    <Parameter name="adOrgId"/>
carlos@0
   183
    <Parameter name="adUserId"/>
carlos@0
   184
    <Parameter name="adUserId"/>
carlos@0
   185
    <Parameter name="aAssetdeliveryId"/>
carlos@0
   186
    <Parameter name="aAssetId"/>
carlos@0
   187
    <Parameter name="movementdate"/>
carlos@0
   188
    <Parameter name="versionno"/>
carlos@0
   189
    <Parameter name="lot"/>
carlos@0
   190
    <Parameter name="serno"/>
carlos@0
   191
    <Parameter name="email"/>
carlos@0
   192
    <Parameter name="user"/>
carlos@0
   193
  </SqlMethod>
carlos@0
   194
</SqlClass>