goja-core/src/main/java/goja/core/db/Dao.java
public static <M extends Model> boolean deleteByIds(Serializable[] ids, Class<M> modelClass) {
        final Table table = TableMapping.me().getTable(modelClass);
        final String[] primaryKey = table.getPrimaryKey();
        if (primaryKey == null || primaryKey.length < 1 || ids == null) {
            throw new IllegalArgumentException("需要删除的表数据主键不存在，无法删除!");
        }
        // 暂时支持单主键的，多主键的后续在说吧。
        final String question_mark =
                StringUtils.repeat(StringPool.QUESTION_MARK, StringPool.COMMA, ids.length);
        String deleteSql = "DELETE FROM "
                + table.getName()
                + " WHERE "
                + primaryKey[0]
                + " IN ("
                + question_mark
                + ")";
        return Db.update(deleteSql, ids) >= 0;
    }
public static <M extends Model> boolean deleteByIds(Serializable[] ids, Class<M> modelClass) {
        final Table table = TableMapping.me().getTable(modelClass);
        final String[] primaryKey = table.getPrimaryKey();
        if (primaryKey == null || primaryKey.length < 1 || ids == null) {
            throw new IllegalArgumentException("需要删除的表数据主键不存在，无法删除!");
        }
        // 暂时支持单主键的，多主键的后续在说吧。
        final String question_mark =
                StringUtils.repeat(StringPool.QUESTION_MARK, StringPool.COMMA, ids.length);
        String deleteSql = "DELETE FROM "
                + table.getName()
                + " WHERE "
                + primaryKey[0]
                + " IN ("
                + question_mark
                + ")";
        return Db.update(deleteSql, ids) >= 0;
    }
public static < M extends Model > boolean deleteByIds ( Serializable [ ] ids , Class < M > modelClass ) { final Table table = TableMapping . me ( ) . getTable ( modelClass ) ; final String [ ] primaryKey = table . getPrimaryKey ( ) ; if ( primaryKey == null || primaryKey . length < 1 || ids == null ) { throw new IllegalArgumentException ( "需要删除的表数据主键不存在，无法删除!"); } // 暂时支持单主键的，多主键的后续在说吧。 final String question_mark = StringUtils . repeat ( StringPool . QUESTION_MARK , StringPool . COMMA , ids . length ) ; String deleteSql = "DELETE FROM " + table . getName ( ) + " WHERE " + primaryKey [ 0 ] + " IN (" + question_mark + ")" ; return Db . update ( deleteSql , ids ) >= 0 ; }
根据多个数据通过主键批量删除数据

@param ids        要删除的数据值数组
@param modelClass 对应的Model的Class
@return 是否删除成功
根据多个数据通过主键批量删除数据