|
楼主 |
发表于 2018-11-12 09:58:10
|
显示全部楼层
- <div component="$UI/system/components/justep/data/data" autoLoad="false"
- xid="mainData" idColumn="FID" confirmDelete="false" confirmRefresh="false" onCustomRefresh="mainDataCustomRefresh">
- <column name="FID" type="String" xid="xid1"/>
- <column name="FTYPEID" type="String" xid="xid2"/>
- <column name="FTYPENAME" type="String" xid="xid3"/>
- <column name="FTYPECODE" type="String" xid="xid4"/>
- <column name="FCREATEDATE" type="Date" xid="xid5"/>
- <column name="FTITLE" type="String" xid="xid6"/>
- <column name="FDETAILS" type="String" xid="xid7"/>
- <column name="FFUNCODE" type="String" xid="xid8"/>
- <column name="FSTATUSCODE" type="String" xid="xid9"/>
- <column name="FSTSTUSNAME" type="String" xid="xid10"/>
- <column name="FCREATEPSNNAME" type="String" xid="xid11"/>
- <column name="FCREATEPSNID" type="String" xid="xid12"/>
- <column name="FCREATEPSNFID" type="String" xid="xid13"/>
- <column name="FCREATEPSNCODE" type="String" xid="xid14"/>
- <column name="FREADTIME" type="Date" xid="xid15"/>
- <column name="FSTATECODE" type="String" xid="xid16"/>
- <column name="FSTATENAME" type="String" xid="xid17"/>
- </div>
- public static Table queryMyNoticeRead(String typecode, String usercode, String fun, String filter, Integer limit, Integer offset) {
- if (fun != null)
- filter += " and FFUNCODE = '" + fun + "'";
- String sql = "select * from ( select a.*,rownum rn from ( select NO_NoticePublish.fID as fID,( CASE WHEN NO_NoticePublish.fViewPsnID LIKE '%" + usercode
- + "%' and NO_NoticePublish.fStateCode = '2' THEN NO_NoticePublish.fTypeIDView ELSE NO_NoticePublish.fTypeID END ) AS fTypeID, " + "( CASE WHEN NO_NoticePublish.fViewPsnID LIKE '%"
- + usercode + "%' and NO_NoticePublish.fStateCode = '2' THEN NO_NoticePublish.fTypeNameView ELSE NO_NoticePublish.fTypeName END ) AS fTypeName, "
- + "( CASE WHEN NO_NoticePublish.fViewPsnID LIKE '%" + usercode
- + "%' and NO_NoticePublish.fStateCode = '2' THEN NO_NoticePublish.fTypeCodeView ELSE NO_NoticePublish.fTypeCode END ) AS fTypeCode, "
- + "NO_NoticePublish.fCreateDate as fCreateDate, ( CASE WHEN NO_NoticePublish.fViewPsnID LIKE '%"
- + usercode + "%' and NO_NoticePublish.fStateCode = '2' THEN NO_NoticePublish.fTitleView ELSE NO_NoticePublish.fTitle END ) AS fTitle, "
- + "( CASE WHEN NO_NoticePublish.fViewPsnID LIKE '%" + usercode
- + "%' and NO_NoticePublish.fStateCode = '2' THEN NO_NoticePublish.fDetailsView ELSE NO_NoticePublish.fDetails END ) AS fDetails, " + "( CASE WHEN NO_NoticePublish.fViewPsnID LIKE '%"
- + usercode + "%' and NO_NoticePublish.fStateCode = '2' THEN NO_NoticePublish.fFunCodeView ELSE NO_NoticePublish.fFunCode END ) AS fFunCode, "
- + "NO_NoticePublish.fStateCode AS fStatusCode, NO_NoticePublish.fStateName AS fStatusName, NO_NoticePublish.fCreatePsnName AS fCreatePsnName, "
- + "NO_NoticePublish.fCreatePsnID AS fCreatePsnID, NO_NoticePublish.fCreatePsnFID AS fCreatePsnFID, NO_NoticePublish.fCreatePsnCode AS fCreatePsnCode, "
- + "(case when NO_Readed.fUpdateDate is not null then NO_Readed.fUpdateDate else null end) as fReadTime, "
- + "(case when NO_Readed.fReaderID is not null then '1' else '0' end) as fStateCode,"
- + "(case when NO_Readed.fReaderID is not null then '已阅' else '未阅' end) as fStateName from NO_NoticePublish NO_NoticePublish left join (select a.* from "
- + "NO_Readed a where a.fReaderID = '" + usercode + "') NO_Readed on NO_Readed.fNoticeID = NO_NoticePublish.fID where 1=1 and ( ( NO_NoticePublish.fStateCode = '1' "
- + "and NO_NoticePublish.fRangeCode like '%" + typecode + "%' ) or ( NO_NoticePublish.fViewPsnID like '%" + usercode
- + "%' and NO_NoticePublish.fStateCode = '2' ) or ( ( NO_NoticePublish.fTypeID is not null or NO_NoticePublish.fTitle is not null ) and "
- + "NO_NoticePublish.fStateCode = '2' ) ) order by fStateCode asc, fStatusCode desc, NO_Readed.fUpdateDate desc,NO_NoticePublish.fCreateDate desc ) a where 1=1 " + filter
- + " and rownum <= " + Integer.toString(offset + limit) + " ) where rn > " + Integer.toString(offset);
- Table table = SQL.select(sql, null, "/dealer/notice/data", null);
- // 设置主键
- table.getProperties().put(Table.PROP_NAME_ROWID, "FID");
- // 设置总记录数 , 计算分页
- int num = queryMyNoticeReadCount(typecode, usercode, filter);
- table.getProperties().put(Table.PROP_DB_COUNT, num);
- return table;
- }
复制代码 NO_NoticePublish.fCreateDate 和 NO_Readed.fUpdateDate 在概念定义中都是datetime
|
-
-
|