Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.telewave.logger.service;
/**
* Created by aiowang on 2018/7/26.
*/
public class SqlUitls {
//-1表示新数据(默认),1表示上报过的数据且失败,0表示待上报的数据
public static final String REPORT_FEILED = " , reportflag int default -1 , reportcode varchar(32) NULL";
public static final String REPORT_FEILED_UPDATE = " set (reportflag, reportcode) = (?, ?) where id =?";
public static final String BUSINESSDATALOG_INSERT = "INSERT INTO businessdatalog (id, software, version, createlogdate, clientip, edittype, tablename, primarykeyvalue, businessdata, seatno, operator, operatorid, operatordeptname, operatordeptcode, createdate) VALUES " +
"(:id, :software, :version, :createlogdate, :clientip, :edittype, :tablename, :primarykeyvalue, :businessdata, :seatno, :operator, :operatorid, :operatordeptname, :operatordeptcode, :createdate)";
public static final String BUSINESSDATALOG_DELETE_ID = "DELETE from businessdatalog where id=:id";
public static final String BUSINESSDATALOG_QUERY_ID = "select * from businessdatalog where id = ?";
public static final String BUSINESSDATALOG_QUERY_TOTLE_REPORT = "select (id) from businessdatalog where reportflag=0";
public static final String BUSINESSDATALOG_QUERY_PAGE = "select * from businessdatalog";
public static final String BUSINESSDATALOG_QUERY_PAGE_REPORT = "select * from businessdatalog where reportflag = ?";
public static final String BUSINESSDATALOG_UPDATE_REPORTSTATE = "update businessdatalog " + REPORT_FEILED_UPDATE ;
public static final String BUSINESSDATALOG_DELETE_REPORTFAIL = "delete businessdatalog where reportflag = 1";
public static final String BUSINESSDATALOG_DELETE_ALL = "delete businessdatalog";
public static final String BUSINESSDATALOG_UPDATE_REPORTFAIL_ALL ="update businessdatalog set reportflag=0 where reportflag=1";
public static final String BUSINESSDATALOG_UPDATE_REPORTINIT ="update businessdatalog set reportflag=0 where reportcode<>'200'";
public static final String BUSINESSDATALOG_DELETE_REPORTFAIL_DATE="delete businessdatalog where reportflag = 1 and createlogdate between ? and ? ";
public static final String BUSINESSDATALOG_CREATTABLE = "CREATE TABLE IF NOT EXISTS businessdatalog (\n" +
" id varchar(32) PRIMARY KEY NOT NULL ,\n" +
" software varchar(150) NOT NULL ,\n" +
" version varchar(15) NOT NULL ,\n" +
" createlogdate datetime NOT NULL ,\n" +
" clientip varchar(15) NOT NULL ,\n" +
" edittype int NOT NULL ,\n" +
" tablename varchar(150) NULL ,\n" +
" primarykeyvalue varchar(64) NULL ,\n" +
" businessdata text NOT NULL ,\n" +
" seatno varchar(32) NULL ,\n" +
" operator varchar(30) NULL ,\n" +
" operatorid varchar(64) NULL ,\n" +
" operatordeptname varchar(150) NULL ,\n" +
" operatordeptcode varchar(64) NULL ,\n" +
" createdate datetime NOT NULL \n" + REPORT_FEILED +
")";
public static final String OPERATIONLOG_INSERT = "INSERT INTO operationlog (id, software, version, createlogdate, clientip, operation, model, seatno, operator, operatorid, operatordeptname, operatordeptcode, createdate) VALUES " +
"(:id,:software,:version,:createlogdate,:clientip,:operation,:model,:seatno,:operator,:operatorid,:operatordeptname,:operatordeptcode,:createdate)";
public static final String OPERATIONLOG_DELETE_ID = "DELETE from operationlog where id=:id";
public static final String OPERATIONLOG_QUERY_ID = "select * from operationlog where id = ?";
public static final String OPERATIONLOG_QUERY_TOTLE_REPORT = "select (id) from operationlog where reportflag=0";
public static final String OPERATIONLOG_QUERY_PAGE = "select * from operationlog";
public static final String OPERATIONLOG_UPDATE_REPORTSTATE = "update operationlog " + REPORT_FEILED_UPDATE ;
public static final String OPERATIONLOG_DELETE_REPORTFAIL = "delete operationlog where reportflag = 1";
public static final String OPERATIONLOG_QUERY_PAGE_REPORT = "select * from operationlog where reportflag = ?";
public static final String OPERATIONLOG_DELETE_ALL = "delete operationlog";
public static final String OPERATIONLOG_UPDATE_REPORTINIT ="update operationlog set reportflag=0 where reportcode<>'200'";
public static final String OPERATIONLOG_UPDATE_REPORTFAIL_ALL ="update operationlog set reportflag=0 where reportflag=1";
public static final String OPERATIONLOG_DELETE_REPORTFAIL_DATE="delete operationlog where reportflag = 1 and createlogdate between ? and ? ";
public static final String OPERATIONLOG_CREATTABLE = "CREATE TABLE IF NOT EXISTS operationlog(\n" +
"ID VARCHAR(32) PRIMARY KEY NOT NULL,\n" +
"software VARCHAR(150) NOT NULL ,\n" +
"version VARCHAR(10) NOT NULL ,\n" +
"createlogdate datetime NOT NULL ,\n" +
"clientip VARCHAR(15) NOT NULL ,\n" +
"operation INTEGER NOT NULL ,\n" +
"model VARCHAR(30) NOT NULL ,\n" +
"seatno VARCHAR(32) ,\n" +
"operator VARCHAR(30) ,\n" +
"operatorid VARCHAR(64) ,\n" +
"operatordeptname VARCHAR(150),\n" +
"operatordeptcode VARCHAR(64),\n" +
"createdate datetime \n" + REPORT_FEILED +
")";
public static final String SOFTWARELOG_INSERT = "INSERT INTO softwarelog (id, software, version, createlogdate, clientip, source, logmsg, loggerleve, stacktrace, createdate) VALUES " +
"(:id, :software, :version, :createlogdate, :clientip, :source, :logmsg, :loggerleve, :stacktrace, :createdate)";
public static final String SOFTWARELOG_DELETE_ID = "DELETE from softwarelog where id=:id";
public static final String SOFTWARELOG_QUERY_ID = "select * from softwarelog where id = ?";
public static final String SOFTWARELOG_QUERY_TOTLE_REPORT = "select (id) from softwarelog where reportflag=0";
public static final String SOFTWARELOG_QUERY_PAGE = "select * from softwarelog";
public static final String SOFTWARELOG_QUERY_PAGE_REPORT = "select * from softwarelog where reportflag = ?";
public static final String SOFTWARELOG_UPDATE_REPORTSTATE = "update softwarelog " + REPORT_FEILED_UPDATE ;
public static final String SOFTWARELOG_DELETE_REPORTFAIL = "delete softwarelog where reportflag = 1";
public static final String SOFTWARELOG_DELETE_ALL = "delete softwarelog";
public static final String SOFTWARELOG_UPDATE_REPORTINIT ="update softwarelog set reportflag=0 where reportcode<>'200'";
public static final String SOFTWARELOG_UPDATE_REPORTFAIL_ALL ="update softwarelog set reportflag=0 where reportflag=1";
public static final String SOFTWARELOG_DELETE_REPORTFAIL_DATE="delete softwarelog where reportflag = 1 and createlogdate between ? and ? ";
public static final String SOFTWARELOG_CREATTABLE = "CREATE TABLE IF NOT EXISTS softwarelog (\n" +
" id varchar(32) PRIMARY KEY NOT NULL ,\n" +
" software varchar(150) NOT NULL, \n" +
" version varchar(15) NOT NULL ,\n" +
" createlogdate datetime NOT NULL, \n" +
" clientip varchar(15) NOT NULL ,\n" +
" source varchar(150) NOT NULL, \n" +
" logmsg text NOT NULL,\n" +
" loggerleve int NOT NULL,\n" +
" stacktrace text, \n" +
" createdate datetime \n" + REPORT_FEILED +
") ";
}