{
 "hidden": false,
 "children": [{
  "configs": {
   "serverScript": "var sql, sql2, data = app.get();\
sql = '';\
sql2 = ' ';\
if (!Wb.isEmpty(data.startdate)) {\
  sql += \"  and  ETD>={?timestamp.startdate?}\";\
  sql2 += \"  and  ETD>={?timestamp.startdate?}\";\
}\
\
if (!Wb.isEmpty(data.enddate)) {\
  sql += \"  and  ETD<={?timestamp.enddate?}\";\
  sql2 += \"  and  ETD<={?timestamp.enddate?}\";\
}\
\
if (!Wb.isEmpty(data.eShipName)) {\
  sql += \" and  (VESSEL_NAME  like '%'||{?eShipName?}||'%' or LOC_VESSEL_NAME like '%'||{?eShipName?}||'%')\";\
  sql2 += \" and  (VESSEL_NAME  like '%'||{?eShipName?}||'%' or LOC_VESSEL_NAME like '%'||{?eShipName?}||'%')\";\
}\
\
\
if (!Wb.isEmpty(data.vyg)) {\
  sql += \" and (IB_VYG  like '%'||{?vyg?}||'%' OR OB_VYG like '%'||{?vyg?}||'%') \";\
  sql2 += \" and (VESSEK_VOY  like '%'||{?vyg?}||'%' ) \";\
}\
\
request.setAttribute('Sql', sql);\
request.setAttribute('Sql2', sql2);",
   "itemId": "module"
  },
  "expanded": true,
  "children": [{
   "configs": {
    "itemId": "dataprovider1",
    "sql": "  SELECT VV.*, CW.SC_WORK_PLACE_CODE AS WORK_PLACE_CODE\
    FROM (SELECT FA.VESSEL_NAME,\
                 FA.LOC_VESSEL_NAME,\
                 FA.VESSEK_VOY,\
                 FA.ETD AS ETA,\
                 FA.TENANCY_ID,\
                 FA.I_E_FLAG AS I_E_FLAG,\
                 PLACE_CODE,\
                 TRANSIT_ID\
            FROM FA_VESSEL_VISIT FA\
           WHERE 1 = 1 {#Sql2#}\
          UNION ALL\
          SELECT V.VESSEL_NAME,\
                 V.LOC_VESSEL_NAME,\
                 V.IB_VYG AS VESSEK_VOY,\
                 V.ETA AS ETA,\
                 V.TENANCY_ID,\
                 '1' AS I_E_FLAG,\
                 I_PLACE_CODE AS PLACE_CODE,\
          \t\t TRANSIT_ID\
            FROM VESSEL_VISIT V\
           WHERE 1 = 1 {#Sql#}\
          UNION ALL\
          SELECT V.VESSEL_NAME,\
                 V.LOC_VESSEL_NAME,\
                 V.OB_VYG AS VESSEK_VOY,\
                 V.ETD AS ETA,\
                 V.TENANCY_ID,\
                 '0' AS I_E_FLAG,\
                 E_PLACE_CODE AS PLACE_CODE,\
                 TRANSIT_ID\
            FROM VESSEL_VISIT V\
           WHERE V.TENANCY_ID {#sys.sqlTypeA#} {#Sql#}) VV\
         LEFT JOIN C_WORK_PLACE_DATA CW ON VV.PLACE_CODE = CW.WORK_PLACE_CODE\
ORDER BY ETA DESC"
   },
   "expanded": false,
   "children": [],
   "type": "dataprovider"
  }],
  "type": "module"
 }],
 "roles": {
  "dev": 1,
  "jj_japan_role": 1,
  "demo": 1,
  "salerole": 1
 },
 "title": "基本查询",
 "iconCls": "",
 "inframe": false,
 "pageLink": ""
}