858804be7caeae0bfc00142bdeab3a70e3c7e11f.svn-base 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package com.chinacreator.process.dao;
  2. import com.chinacreator.process.util.DataSource;
  3. import com.frameworkset.common.poolman.SQLExecutor;
  4. import org.springframework.stereotype.Component;
  5. import java.sql.SQLException;
  6. import java.util.HashMap;
  7. import java.util.List;
  8. @Component
  9. public class IntensiveSyncOrderDao {
  10. public List<HashMap> queryList() throws SQLException {
  11. String sql = " select id,userid,spid,to_char(ordertime,'yyyy-mm-dd hh24:mi:ss') ordertime,to_char(canceltime,'yyyy-mm-dd hh24:mi:ss') canceltime,to_char(SYNCOUNT) SYNCOUNT from TD_Intensive_syncOrder_WAIT where resultcode = '1' or (resultcode <> '0000' and SYNCOUNT < 6) order by inserttime";
  12. List<HashMap> hashMaps = SQLExecutor.queryListWithDBName(HashMap.class, DataSource.NET3G, sql);
  13. return hashMaps;
  14. }
  15. public void updataQueryList(String id,String resultcode) throws SQLException {
  16. String sql = "update TD_Intensive_syncOrder_WAIT set resultcode = ?,updatetime = sysdate where id = ?";
  17. SQLExecutor.updateWithDBName(DataSource.NET3G, sql,resultcode,id);
  18. }
  19. public int updExecTimeout(){
  20. int res = 0;
  21. String sql = "update TD_Intensive_syncOrder_WAIT set resultcode = '1' where resultcode = '2' and updatetime < sysdate-1/24/6";
  22. try {
  23. Object obj = SQLExecutor.updateWithDBName(DataSource.NET3G, sql, null);
  24. res = (Integer)obj;
  25. } catch (SQLException e) {
  26. e.printStackTrace();
  27. }
  28. return res;
  29. }
  30. public List<HashMap> getInvokeUrl(String projname,String invokename) throws SQLException {
  31. String sql = "SELECT INVOKEURL, PARAM1, PARAM2 from TB_PROJINVOKEURL_CONF where projname = ? and invokename = ? and status = '0'";
  32. List<HashMap> hashMaps = SQLExecutor.queryListWithDBName(HashMap.class, DataSource.NET3G, sql,projname,invokename);
  33. return hashMaps;
  34. }
  35. public String getProductid(String spid) throws SQLException {
  36. String sql = "select productid from tb_intensive_productid_conf where spid = ?";
  37. return SQLExecutor.queryFieldWithDBName("net3g", sql, new Object[]{spid});
  38. }
  39. public void updata(String id,String resultcode,String resultinfo,String resultdata,int syncount) throws SQLException {
  40. String sql = "update TD_Intensive_syncOrder_WAIT set resultcode = ?,resultinfo = ?,resultdata = ?,syncount = ?,updatetime = sysdate where id = ?";
  41. SQLExecutor.updateWithDBName(DataSource.NET3G, sql,resultcode,resultinfo,resultdata,syncount,id);
  42. }
  43. public String getChannel(String spid)throws SQLException {
  44. String sql = "SELECT CHANNEL FROM tb_jiyuechanl_sp_config WHERE SPID = ? AND STATUS = '0'";
  45. return SQLExecutor.queryFieldWithDBName("net3g", sql, new Object[]{spid});
  46. }
  47. }