查询全部结果

@param ms
@return
515337
public String selectAll(MappedStatement ms) {
        final Class<?> entityClass = getEntityClass(ms);
        //修改返回值类型为实体类型
        setResultType(ms, entityClass);
        StringBuilder sql = new StringBuilder();
        sql.append(SqlHelper.selectAllColumns(entityClass));
        sql.append(SqlHelper.fromTable(entityClass, tableName(entityClass)));

        // 逻辑删除的未删除查询条件
        sql.append("<where>");
        sql.append(SqlHelper.whereLogicDelete(entityClass, false));
        sql.append("</where>");

        sql.append(SqlHelper.orderByDefault(entityClass));
        return sql.toString();
    }
761732
public MapperTemplate isMapperMethod(String msId) {
        MapperTemplate mapperTemplate = getMapperTemplateByMsId(msId);
        if(mapperTemplate == null){
            //通过 @RegisterMapper 注解自动注册的功能
            try {
                Class<?> mapperClass = getMapperClass(msId);
                if(mapperClass.isInterface() && hasRegisterMapper(mapperClass)){
                    mapperTemplate = getMapperTemplateByMsId(msId);
                }
            } catch (Exception e){
            }
        }
        return mapperTemplate;
    }
746962
private AbstractHelperDialect getDialect(MappedStatement ms) {
        //改为对dataSource做缓存
        DataSource dataSource = ms.getConfiguration().getEnvironment().getDataSource();
        String url = getUrl(dataSource);
        if (urlDialectMap.containsKey(url)) {
            return urlDialectMap.get(url);
        }
        try {
            lock.lock();
            if (urlDialectMap.containsKey(url)) {
                return urlDialectMap.get(url);
            }
            if (StringUtil.isEmpty(url)) {
                throw new PageException("无法自动获取jdbcUrl，请在分页插件中配置dialect参数!");
            }
            String dialectStr = fromJdbcUrl(url);
            if (dialectStr == null) {
                throw new PageException("无法自动获取数据库类型，请通过 helperDialect 参数指定!");
            }
            AbstractHelperDialect dialect = initDialect(dialectStr, properties);
            urlDialectMap.put(url, dialect);
            return dialect;
        } finally {
            lock.unlock();
        }
    }
1182722
public int getSpanEnd(Object what) {
        int count = mSpanCount;
        Object[] spans = mSpans;

        for (int i = count - 1; i >= 0; i--) {
            if (spans[i] == what) {
                int where = mSpanEnds[i];

                if (where > mGapStart)
                    where -= mGapLength;

                return where;
            }
        }

        return -1;
    }
1194571
public MDecimal getMPS() {
		MDecimal result = new MDecimal(currentUnit.getConverterTo(
				METERS_PER_SECOND).convert(doubleValue()));
		logger.trace(MMarker.GETTER, "Converting from {} to MPS : {}",
				currentUnit, result);
		return result;
	}
888572
public static String sprintf( String s, int[] params ) {
        if ((s == null) || (params == null)) {
            return s;
        }
        StringBuffer result = new StringBuffer("");
        String[] ss = split(s);
        int p = 0;
        for( int i = 0; i < ss.length; i++ ) {
            char c = ss[i].charAt(0);
            String t = ss[i].substring(1);
            if (c == '+') {
                result.append(t);
            } else {
                int param = params[p];
                result.append(new Format(t).form(param));
                p++;
            }
        }
        return result.toString();
    }
1138295
private static int[] mstPartition(double[][] matrix) {
    final int n = matrix.length;
    int[] edges = PrimsMinimumSpanningTree.processDense(matrix);
    // Note: Prims does *not* yield edges sorted by edge length!
    double meanlength = thresholdLength(matrix, edges);
    int[] idx = new int[n], best = new int[n], sizes = new int[n];
    int bestsize = -1;
    double bestlen = 0;
    for(int omit = n - 2; omit > 0; --omit) {
      final double len = edgelength(matrix, edges, omit);
      if(len < meanlength) {
        continue;
      }
      omitEdge(edges, idx, sizes, omit);
      // Finalize array:
      int minsize = n;
      for(int i = 0; i < n; i++) {
        int j = idx[i] = follow(i, idx);
        if(j == i && sizes[i] < minsize) {
          minsize = sizes[i];
        }
      }
      if(minsize > bestsize || (minsize == bestsize && len > bestlen)) {
        bestsize = minsize;
        bestlen = len;
        System.arraycopy(idx, 0, best, 0, n);
      }
    }
    return best;
  }
1202445
public static String milliSecToString(final long mS) {
    final long rem_mS = (long)(mS % 1000.0);
    final long rem_sec = (long)((mS / 1000.0) % 60.0);
    final long rem_min = (long)((mS / 60000.0) % 60.0);
    final long hr  =     (long)(mS / 3600000.0);
    final String mSstr = zeroPad(Long.toString(rem_mS), 3);
    final String secStr = zeroPad(Long.toString(rem_sec), 2);
    final String minStr = zeroPad(Long.toString(rem_min), 2);
    return String.format("%d:%2s:%2s.%3s", hr, minStr, secStr, mSstr);
  }
314147
def msw(self):
        '''  '''
        return (t for t, c in self.tcmap().items() if len(c) > 1)
922561
public AbstractPrintQuery addMsgPhrase(final String... _msgPhrase)
        throws EFapsException
    {
        final List<MsgPhrase> msgphrases = new ArrayList<>();
        for (final String phraseStr : _msgPhrase) {
            msgphrases.add(MsgPhrase.get(phraseStr));
        }
        return addMsgPhrase(msgphrases.toArray(new MsgPhrase[msgphrases.size()]));
    }
180821
public static String getMethodDescriptor(final Method m) {
        Class<?>[] parameters = m.getParameterTypes();
		StringBuilder sb = new StringBuilder();
        sb.append('(');
        for (int i = 0; i < parameters.length; ++i) {
            getDescriptor(sb, parameters[i]);
        }
        sb.append(')');
        getDescriptor(sb, m.getReturnType());
        return sb.toString();
    }
880798
public String getMsgPhrase(final SelectBuilder _selectBldr,
                               final CIMsgPhrase _msgPhrase)
        throws EFapsException
    {
        return getMsgPhrase(_selectBldr, _msgPhrase.getMsgPhrase());
    }
1150577
public static int d(String tag, String msg) {
        return d(SUBSYSTEM.MAIN, tag, msg);
    }
324953
public String getList() {
    String result = "";
    int i = 1;

    for (String s : mReps.keySet()) {
      result += (i++) + ". key='" + s + "', value='" + mReps.get(s) + "'\n";
    }

    return result;
  }
293079
public String selectCount(MappedStatement ms) {
        Class<?> entityClass = getEntityClass(ms);
        StringBuilder sql = new StringBuilder();
        sql.append(SqlHelper.selectCount(entityClass));
        sql.append(SqlHelper.fromTable(entityClass, tableName(entityClass)));
        sql.append(SqlHelper.whereAllIfColumns(entityClass, isNotEmpty()));
        return sql.toString();
    }
979882
public static function makeMsgId()
    {
        static $sequence = 0;
        static $t = 0;
        if (!$t) {
            $t = static::getMillisecond();
            $t = ($t - $t % 1000) / 1000;
            $t = $t % 10000 * 10000;
        }
        //获取msgId
        ++$sequence;

        return $t + $sequence;
    }
1127610
public int insert(String sql) {
        String msId = msUtils.insert(sql);
        return sqlSession.insert(msId);
    }