SELECT
		fmd.id ,
		fm.REQUESTID
		
	FROM XUGU.formtable_main_146 fm
	LEFT JOIN XUGU.HRMRESOURCE hrm1 ON TO_NUMBER(fm.XSRY) = hrm1.id 
	LEFT JOIN XUGU.HRMRESOURCE hrm2 ON TO_NUMBER(fm.jfry) = hrm2.id
	LEFT JOIN XUGU.FORMTABLE_MAIN_146_dt1 fmd ON fmd.mainid = fm.id 
	LEFT JOIN XUGU.WORKFLOW_SELECTITEM ws1 ON fmd.cpmc = ws1.SELECTVALUE AND ws1.FIELDID = 14627
	LEFT JOIN XUGU.WORKFLOW_SELECTITEM ws2 ON fmd.BB = ws2.SELECTVALUE AND ws2.FIELDID = 14628
	LEFT JOIN XUGU.WORKFLOW_REQUESTBASE WR ON fm.REQUESTID = WR.REQUESTID 
	LEFT JOIN XUGU.PRJ_PROJECTINFO PP ON fm.glxm = PP.ID 
	WHERE TO_TIMESTAMP(wr.CREATEDATE || ' ' || wr.CREATETIME, 'YYYY-MM-DD HH24:MI:SS') > TO_TIMESTAMP('2024-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')
	ORDER BY wr.CREATEDATE DESC, wr.CREATETIME DESC 
	PARALLEL 8


			SELECT
		wr.REQUESTNAME, 
		wr.REQUESTNAMENEW, wr.REQUESTNAMEHTMLNEW, 
		fm.glxm,PP.NAME,fm.SQSJ, hrm1.LASTNAME, 
		hrm2.LASTNAME, fm.XSJSYX, fm.JFJSYX, 
		fm.SYDW, fm.XMXXMS, fm.JDS, 
		fmd.JDS,  ws1.SELECTNAME, 
		ws2.SELECTNAME, fmd.CLQ, fmd.CZXT, 
		fmd.IP, fmd.MAC,wr.CREATEDATE, wr.CREATETIME, 
		wr.LASTOPERATEDATE, wr.LASTOPERATETIME 
	FROM XUGU.formtable_main_146 fm
	LEFT JOIN XUGU.HRMRESOURCE hrm1 ON TO_NUMBER(fm.XSRY) = hrm1.id 
	LEFT JOIN XUGU.HRMRESOURCE hrm2 ON TO_NUMBER(fm.jfry) = hrm2.id
	LEFT JOIN XUGU.FORMTABLE_MAIN_146_dt1 fmd ON fmd.mainid = fm.id 
	LEFT JOIN XUGU.WORKFLOW_SELECTITEM ws1 ON fmd.cpmc = ws1.SELECTVALUE AND ws1.FIELDID = 14627
	LEFT JOIN XUGU.WORKFLOW_SELECTITEM ws2 ON fmd.BB = ws2.SELECTVALUE AND ws2.FIELDID = 14628
	LEFT JOIN XUGU.WORKFLOW_REQUESTBASE WR ON fm.REQUESTID = WR.REQUESTID 
	LEFT JOIN XUGU.PRJ_PROJECTINFO PP ON fm.glxm = PP.ID 
where fmd.id  = 13
	PARALLEL 8;
	-------------

	
		SELECT
		fmd.id ,
		fm.REQUESTID, 
		wr.REQUESTNAME, 
		wr.REQUESTNAMENEW, 
		wr.REQUESTNAMEHTMLNEW, 
		fm.glxm,
    	PP.NAME,
		fm.SQSJ, 
		hrm1.LASTNAME, 
		hrm2.LASTNAME, 
		fm.XSJSYX, 
		fm.JFJSYX, 
		fm.SYDW, 
		fm.XMXXMS, 
		fm.JDS, 
		fmd.JDS, 
		ws1.SELECTVALUE, 
		ws1.SELECTNAME, 
		ws2.SELECTNAME, 
		fmd.CLQ, 
		fmd.CZXT, 
		fmd.IP, 
		fmd.MAC,
		wr.CREATEDATE, 
		wr.CREATETIME, 
		wr.LASTOPERATEDATE, 
		wr.LASTOPERATETIME 
	FROM XUGU.formtable_main_146 fm
	LEFT JOIN XUGU.HRMRESOURCE hrm1 ON TO_NUMBER(fm.XSRY) = hrm1.id 
	LEFT JOIN XUGU.HRMRESOURCE hrm2 ON TO_NUMBER(fm.jfry) = hrm2.id
	LEFT JOIN XUGU.FORMTABLE_MAIN_146_dt1 fmd ON fmd.mainid = fm.id 
	LEFT JOIN XUGU.WORKFLOW_SELECTITEM ws1 ON fmd.cpmc = ws1.SELECTVALUE AND ws1.FIELDID = 14627
	LEFT JOIN  XUGU.WORKFLOW_SELECTITEM ws2 ON fmd.BB = ws2.SELECTVALUE AND ws2.FIELDID = 14628
	LEFT JOIN XUGU.WORKFLOW_REQUESTBASE WR ON fm.REQUESTID = WR.REQUESTID 
	LEFT JOIN XUGU.PRJ_PROJECTINFO PP ON fm.glxm = PP.ID 
	WHERE TO_TIMESTAMP(wr.CREATEDATE || ' ' || wr.CREATETIME, 'YYYY-MM-DD HH24:MI:SS') > TO_TIMESTAMP('2024-08-12 10:16:21.000 AD', 'YYYY-MM-DD HH24:MI:SS')
	--ORDER BY wr.CREATEDATE DESC, wr.CREATETIME DESC  
	ORDER BY fm.REQUESTID DESC
	PARALLEL 8;
	