{
 "hidden": false,
 "children": [{
  "configs": {
   "itemId": "module",
   "serverScript": "var data = app.get();\
var sql = '';\
\
if (!((Wb.isEmpty(data.receiveFlag)) || data.receiveFlag == 'A')) {\
  sql += \"and RECEIVE_FLAG ={?receiveFlag?}\";\
}\
\
if (!Wb.isEmpty(data.sdate))\
  sql += \"  and  TO_CHAR(CREATED_ON,'yyyy-MM-dd') >= TO_CHAR({?timestamp.sdate?},'yyyy-MM-dd')\";\
if (!Wb.isEmpty(data.edate))\
  sql += \"  and  TO_CHAR(CREATED_ON,'yyyy-MM-dd') <= TO_CHAR({?timestamp.edate?},'yyyy-MM-dd')\";\
\
if (!Wb.isEmpty(data.isMySend)) {\
  if (data.isMySend == 'S') { //  我发送的\
    sql += \"and CREATED_BY ={?user?} AND SR_FLAG='S' \";\
  }\
  if (data.isMySend == 'R') { // 发送给我的\
    sql += \"and RE_USER_ID ={?user?} AND SR_FLAG='R' \";\
  }\
}\
request.setAttribute('sql', sql);"
  },
  "expanded": true,
  "children": [{
   "configs": {
    "itemId": "dataprovider1",
    "totalSql": "SELECT COUNT(1) FROM REMQ_MSG_CUSTOM X WHERE 1=1 {#sql#}",
    "sql": "SELECT X.ID,\
       BUSINESS_KEY,\
       BUSINESS_TYPE,\
       BUSINESS_URL,\
       MSG_INFO,\
       CAST(RECEIVE_FLAG AS SIGNED) RECEIVE_FLAG,\
       RECEIVE_TIM,\
       CREATED_BY,\
       CREATED_ON,\
       UPDATED_BY,\
       UPDATED_ON,\
       CHAT_NAME,\
       SR_FLAG,\
       RE_USER_ID\
FROM REMQ_MSG_CUSTOM X WHERE 1=1 {#sql#} ORDER BY CREATED_ON DESC limit {?bigint.start?},{?bigint.limit?}"
   },
   "expanded": false,
   "children": [],
   "type": "dataprovider"
  }],
  "type": "module"
 }],
 "roles": {"default": 1},
 "title": "个人消息管理sql",
 "iconCls": "",
 "inframe": false,
 "pageLink": ""
}