Package com.founder.fix.fixflow.core.impl.db

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand


    try {
      connection = FixFlowShellProxy
          .getConnection(ConnectionManagement.defaultDataBaseId);
      this.connection = connection;
      engine = this.getProcessEngine(agentId);
      SqlCommand sqlCommand = new SqlCommand(connection);
      String sqlStr = "select * from fixflow_agent_agentinfo where agent_id = ?";
      List<Object> data = new ArrayList<Object>();
      data.add(agentId);
      List<Map<String, Object>> listData = sqlCommand.queryForList(
          sqlStr, data);
      if (listData.size() > 0) {
        Map<String, Object> eachAgentInfo = listData.get(0);
        agentInfo.put("agentId", agentId);
        agentInfo.put("agentName", this.getUserName(agentId));
        agentInfo.put("sDate", eachAgentInfo.get("SDATE"));
        agentInfo.put("eDate", eachAgentInfo.get("EDATE"));
        agentInfo.put("oDate", eachAgentInfo.get("ODATE"));
        agentInfo.put("status", eachAgentInfo.get("STATUS"));
        // eachAgentInfo.put("agentName", this.getUserName(agentId));

        sqlStr = "select * from fixflow_agent_agentdetails where agent_id = ?";
       
     
        data.clear();
        data.add(agentId);
        listData = sqlCommand.queryForList(sqlStr, data);
        for (Map<String, Object> rowDataMap : listData) {
          // if (resultData.size() > 0) {
          eachResultData.put("agentId", rowDataMap.get("AGENT_ID"));
          String auser = StringUtil
              .getString(rowDataMap.get("AUSER"));
View Full Code Here


        .getConnection(ConnectionManagement.defaultDataBaseId);
   
    /* 删除原来的数据 */
    /* begin*/
    Object[] objectParamWhere = { agentId };
    SqlCommand sqlCommand = new SqlCommand(this.connection);
    sqlCommand.delete("FIXFLOW_AGENT_AGENTINFO", "AGENT_ID=?",objectParamWhere);

    sqlCommand.delete("FIXFLOW_AGENT_AGENTDETAILS", "AGENT_ID=?",objectParamWhere);
   
    /* 删除原来的数据 */
    /* end */
   
   
    /* 新增数据 */
    /* begin*/
    Map<String, Object> objectParam = new HashMap<String, Object>();
    objectParam.put("OPERATOR", operator);
    objectParam.put("SDATE", sDate);
    objectParam.put("EDATE", eDate);
    objectParam.put("STATUS", status);
    objectParam.put("AGENT_ID", agentId);
    objectParam.put("ODATE", oDate);
    objectParam.put("VIEW_TYPE", viewType);
   
    // 执行插入语句
    sqlCommand.insert("FIXFLOW_AGENT_AGENTINFO", objectParam);
   
    for(Map<String, Object> detailInfo : detailInfoList){
      String processId = StringUtil.getString(detailInfo.get("processId"));
      String auser = StringUtil.getString(detailInfo.get("auser"));
         
      objectParam = new HashMap<String, Object>();
      objectParam.put("PROCESS_ID", processId);
      objectParam.put("AUSER", auser);
      objectParam.put("AGENT_ID", agentId);
      objectParam.put("GUID", java.util.UUID.randomUUID().toString());
      sqlCommand.insert("FIXFLOW_AGENT_AGENTDETAILS", objectParam);
    }
   
    /* 新增数据 */
    /* end */
  }
 
View Full Code Here

     
      StringBuffer sb = new StringBuffer();
      sb.append("SELECT USERID,USERNAME FROM AU_USERINFO WHERE LOGINID=? AND PASSWORD=?");
      connection = dbcf.createConnection();
      //这里是自带的数据库操作方式。
      SqlCommand sqlcommand = new SqlCommand(connection);
      List<Map<String, Object>> list2 = sqlcommand.queryForList(sb.toString(),list);
      if(list2!=null && list2.size()>0){
        //这里约定了一个参数,流程引擎在运行时会默认从session里按照这两个key来获取参数,如果替换了登录的方式,请保证这两个key依然可以获取到正确的数据
        request.getSession().setAttribute(FlowCenterService.LOGIN_USER_ID, list2.get(0).get("USERID"));
        request.getSession().setAttribute(FlowCenterService.LOGIN_USER_NAME, list2.get(0).get("USERNAME"));
       
View Full Code Here

          if(key!=null){
            rd = request.getRequestDispatcher("/fixflow/demo/doTask.jsp");
            connection = FixFlowShellProxy
                .getConnection(ConnectionManagement.defaultDataBaseId);
         
            SqlCommand sc = new SqlCommand(connection);
            List params = new ArrayList();
            params.add(key);
            List<Map<String, Object>> res = sc.queryForList(
                "select * from DEMOTABLE where COL1=?", params);
            if(res!=null && res.size()>0)
              filter.put("demoObject", res.get(0));
            request.setAttribute("result", filter);
          }
          filter.putAll(list);
          request.setAttribute("result", filter);
        }finally{
          if(connection!=null)
            connection.close();         
        }
      } else if (action.equals("doTask")) {// 演示如何进入一个已发起的流程处理页面
        filter.put("path", request.getSession().getServletContext()
            .getRealPath("/"));

        Connection connection = FixFlowShellProxy
            .getConnection(ConnectionManagement.defaultDataBaseId);

        try {
          SqlCommand sc = new SqlCommand(connection);
          List params = new ArrayList();
          params.add(filter.get("bizKey"));
          List<Map<String, Object>> res = sc.queryForList(
              "select * from DEMOTABLE where COL1=?", params);
         
          if(res!=null && res.size()>0)
            filter.put("demoObject", res.get(0));

View Full Code Here

  public void execute(ExecutionContext executionContext) throws Exception {
   

    if(sqlText!=null){
      SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
      sqlCommand.execute(sqlText.toString());
    }
    else {
      throw new FixFlowException("执行数据库语句不正确!");
    }
   
View Full Code Here

  public DeploymentPersistence(Connection connection)
  {
    this.connection = connection;
    // 初始化数据库操作类
    sqlCommand = new SqlCommand(connection);
  }
View Full Code Here

  private java.lang.String statusValue;

  public void execute(ExecutionContext executionContext) throws Exception {

    SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());

    String Fix_BizName=StringUtil.getString(Context.getAbstractScriptLanguageMgmt().execute("${Fix_BizName}", executionContext));
    String Fix_BizKeyFile=StringUtil.getString(Context.getAbstractScriptLanguageMgmt().execute("${Fix_BizKeyFile}", executionContext));
    if(Fix_BizName==null||Fix_BizName.equals("")){
      throw new FixFlowException("数据变量${Fix_BizName}为空");
    }
    if(Fix_BizKeyFile==null||Fix_BizKeyFile.equals("")){
      throw new FixFlowException("数据变量${Fix_BizKeyFile}为空");
    }
   
   
   
    String sqlText="UPDATE "+Fix_BizName+" SET  FIX_PROCESSSTATE='"+statusValue+"' WHERE "+Fix_BizKeyFile+"='"+executionContext.getBizKey()+"'";
   
    sqlCommand.execute(sqlText);

  }
View Full Code Here

  protected SqlCommand sqlCommand;

  public CommentPersistence(Connection connection) {
    this.connection = connection;
    // 初始化数据库操作类
    sqlCommand = new SqlCommand(connection);
  }
View Full Code Here

  public ResourcePersistence(Connection connection)
  {
    this.connection = connection;
    // 初始化数据库操作类
    sqlCommand = new SqlCommand(connection);
  }
View Full Code Here

  java.text.DateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
  public HistoryPersistence(Connection connection) {
    this.connection = connection;
    // 初始化数据库操作类
    sqlCommand = new SqlCommand(connection);
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.db.SqlCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.