<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
    <query id="JdgQcmAutoJudge.get" desc="查询">
        <![CDATA[
SELECT T.ID,
       T.PROCESS_CODE,
       DECODE(T.IS_AUTO, '1', 'True', 'False') IS_AUTO,
       T.OP_USER_ID,
       TO_CHAR(T.OP_TIME, 'yyyy-mm-dd hh24:mi:ss') OP_TIME,
       CASE
         WHEN (SYSDATE - T.LAST_ONLINE_TIME) * 86400 < 7 THEN
          '在线'
         ELSE
          '离线'
       END STATUS,
       A.PROCESS_DESC,
       B.USERNAME OP_USER
  FROM QCM_AUTO_JUDGE T
  LEFT JOIN COM_BASE_PROCESS A
    ON A.PROCESS_CODE = T.PROCESS_CODE
  LEFT JOIN CORE_APP_USER B
    ON B.USERID = T.OP_USER_ID
  WHERE T.SUPP_UNIT ={0}
		]]>
    </query>

    <query id="JdgQcmAutoJudge.getById" desc="查询">
        <![CDATA[
SELECT T.ID,
       T.PROCESS_CODE,
       DECODE(T.IS_AUTO, '1', 'True', 'False') IS_AUTO,
       T.OP_USER_ID,
       TO_CHAR(T.OP_TIME, 'yyyy-mm-dd hh24:mi:ss') OP_TIME,
       CASE
         WHEN (SYSDATE - T.LAST_ONLINE_TIME) * 86400 < 7 THEN
          '在线'
         ELSE
          '离线'
       END STATUS,
       A.PROCESS_DESC,
       B.USERNAME OP_USER
  FROM QCM_AUTO_JUDGE T
  LEFT JOIN COM_BASE_PROCESS A
    ON A.PROCESS_CODE = T.PROCESS_CODE
  LEFT JOIN CORE_APP_USER B
    ON B.USERID = T.OP_USER_ID
  WHERE T.ID = {0}
		]]>
    </query>

    <query id="JdgQcmAutoJudge.setById" desc="更新">
        <![CDATA[
UPDATE QCM_AUTO_JUDGE T
   SET T.IS_AUTO       = '#IS_AUTO#',
       T.OP_USER_ID = '#OP_USER_ID#',
       T.OP_TIME    = SYSDATE
 WHERE T.ID = '#ID#'
		]]>
    </query>

    <query id="JdgQcmAutoJudge.setLastOnlineTime" desc="更新最后在线时间">
        <![CDATA[
UPDATE QCM_AUTO_JUDGE T SET T.LAST_ONLINE_TIME = SYSDATE
		]]>
    </query>
</queryMap>