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

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


     
      String sqlText=getUserInfoConfig().getSqlText();
     
     

      SqlCommand sqlCommand = getSqlCommand();

      List<Object> objectParamWhere = new ArrayList<Object>();

      objectParamWhere.add(userId);

      List<Map<String, Object>> dataObj = sqlCommand.queryForList("SELECT USERTABLE.* FROM ("+sqlText+") USERTABLE where USERTABLE."+userIdField+"=?", objectParamWhere);

      if(dataObj.size()==0){
        return null;
      }
     
View Full Code Here


    Map<String,Object> resultMap = new HashMap<String,Object>();
    List<UserTo> resultList = new ArrayList<UserTo>();
    String userIdField=getUserInfoConfig().getUserIdField();
    String userNameField=getUserInfoConfig().getUserNameField();
    String sqlText=getUserInfoConfig().getSqlText();
    SqlCommand sqlCommand = getSqlCommand();
    String sql = "SELECT USERTABLE.* FROM ("+sqlText+") USERTABLE WHERE 1=1";
    String countSql = "SELECT count(*) FROM ("+sqlText+") USERTABLE WHERE 1=1";
    String whereSql = "";
    if(queryMap != null && queryMap.containsKey("USERID")){
      whereSql += " AND "+userIdField+" LIKE '%"+queryMap.get("USERID")+"%'";
    }
    if(queryMap != null && queryMap.containsKey("USERNAME")){
      whereSql += " AND "+userNameField+" LIKE '%"+queryMap.get("USERNAME")+"%' ";
    }
    sql += whereSql;
    countSql += whereSql;
   
    int count = Integer.parseInt(sqlCommand.queryForValue(countSql).toString());
    if (page != null) {
      Pagination pagination = Context.getProcessEngineConfiguration().getDbConfig().getPagination();
      sql = pagination.getPaginationSql(sql, page.getFirstResult(), page.getMaxResults(), "*",null);
    }
    List<Map<String, Object>> dataObj = sqlCommand.queryForList(sql, null);
   
    for(int i= 0;i<dataObj.size();i++){
      if (dataObj.get(i).get(userIdField) != null) {
        UserTo userTo = new UserTo(StringUtil.getString(dataObj.get(i).get(userIdField)), StringUtil.getString(dataObj.get(i).get(userNameField)), dataObj.get(i));
        resultList.add(userTo);
View Full Code Here

  private java.lang.String table;

  private java.util.HashMap param;

  public void execute(ExecutionContext executionContext) throws Exception {
    SqlCommand sqlCommand=executionContext.getSqlCommand();
    // 构建查询参数
    HashMap<String, Object> objectParam = (HashMap<String, Object>)param;
    // 执行插入语句
    sqlCommand.insert(table, objectParam);
  }
View Full Code Here

   
    try {
      ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
      interpreter.set("sysRulesConfig", Context.getProcessEngineConfiguration());
      interpreter.set("parameter", parameter);
      interpreter.set("sqlCommand", new SqlCommand(Context.getDbConnection()));
      if(configMap!=null){
       
        for (String mapKey : configMap.keySet()) {
          interpreter.set(mapKey, configMap.get(mapKey));
        }
View Full Code Here

  public Object executeBusinessRules(String ruleId, Object parameter, Map<String, Object> configMap) {
    try {
      ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
      interpreter.set("sysRulesConfig", Context.getProcessEngineConfiguration());
      interpreter.set("parameter", parameter);
      interpreter.set("sqlCommand", new SqlCommand(Context.getDbConnection()));
      if(configMap!=null){
       
        for (String mapKey : configMap.keySet()) {
          interpreter.set(mapKey, configMap.get(mapKey));
        }
View Full Code Here

  public static List<Map<String, Object>> getDataValueAll(String dataBaseId, String bizkey, String field, ExecutionContext executionContext) {
    List<Object> paramList = new ArrayList<Object>();
    paramList.add(bizkey);
    String bizObjName = StringUtil.getString(ExpressionMgmt.execute("Fix_BizName", executionContext));
    String bizField = StringUtil.getString(ExpressionMgmt.execute("Fix_BizKeyFile", executionContext));
    SqlCommand sqlCommand = new SqlCommand(Context.getDbConnection(dataBaseId));
    List<Map<String, Object>> dataObjList = sqlCommand.queryForList("SELECT " + field + " FROM " + bizObjName + " WHERE " + bizField + "=?", paramList);

    return dataObjList;

  }
View Full Code Here

  public static Object getDataValue(String dataBaseId, String bizkey, String field, ExecutionContext executionContext) {
    List<Object> paramList = new ArrayList<Object>();
    paramList.add(bizkey);
    String bizObjName = StringUtil.getString(ExpressionMgmt.execute("Fix_BizName", executionContext));
    String bizField = StringUtil.getString(ExpressionMgmt.execute("Fix_BizKeyFile", executionContext));
    SqlCommand sqlCommand = new SqlCommand(Context.getDbConnection(dataBaseId));
    List<Map<String, Object>> dataObjList = sqlCommand.queryForList("SELECT " + field + " FROM " + bizObjName + " WHERE " + bizField + "=?", paramList);
    if (dataObjList.size() == 0) {
      return null;
    } else {
      return dataObjList.get(0).get(field);
    }
View Full Code Here

public class DataBaseUtil {
 
  public static Object getSequenceValue(String sequenceName){
   
   
    SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
    Object returnValueObject=sqlCommand.queryForValue("SELECT "+sequenceName+".nextval FROM DUAL");
   
   
    return returnValueObject;
   
  }
View Full Code Here

  public List<Map<String, Object>> getDataValueAll(String dataBaseId, String bizkey, String field, ExecutionContext executionContext) {
    List<Object> paramList = new ArrayList<Object>();
    paramList.add(bizkey);
    String bizObjName = StringUtil.getString(ExpressionMgmt.execute("Fix_BizName", executionContext));
    String bizField = StringUtil.getString(ExpressionMgmt.execute("Fix_BizKeyFile", executionContext));
    SqlCommand sqlCommand = new SqlCommand(Context.getDbConnection(dataBaseId));
    List<Map<String, Object>> dataObjList = sqlCommand.queryForList("SELECT " + field + " FROM " + bizObjName + " WHERE " + bizField + "=?", paramList);

    return dataObjList;

  }
View Full Code Here

  public Object getDataValue(String dataBaseId, String bizkey, String field, ExecutionContext executionContext) {
    List<Object> paramList = new ArrayList<Object>();
    paramList.add(bizkey);
    String bizObjName = StringUtil.getString(ExpressionMgmt.execute("Fix_BizName", executionContext));
    String bizField = StringUtil.getString(ExpressionMgmt.execute("Fix_BizKeyFile", executionContext));
    SqlCommand sqlCommand = new SqlCommand(Context.getDbConnection(dataBaseId));
    List<Map<String, Object>> dataObjList = sqlCommand.queryForList("SELECT " + field + " FROM " + bizObjName + " WHERE " + bizField + "=?", paramList);
    if (dataObjList.size() == 0) {
      return null;
    } else {
      return dataObjList.get(0).get(field);
    }
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.