模仿 laravel DB 写个 95%还原的 java 版吧。
https://laravel.com/docs/10.x/queries```
$users = DB::table('users')
->join('contacts', '
users.id', '=', 'contacts.user_id')
->join('orders', '
users.id', '=', 'orders.user_id')
->select('users.*', 'contacts.phone', 'orders.price')
->get();
$latestPosts = DB::table('posts')
->select('user_id', DB::raw('MAX(created_at) as last_post_created_at'))
->where('is_published', true)
->groupBy('user_id');
$users = DB::table('users')
->where('votes', '>', 100)
->orWhere('name', 'John')
->get();
$users = User::where(function (Builder $query) {
$query->select('type')
->from('membership')
->whereColumn('membership.user_id', '
users.id')
->orderByDesc('membership.start_date')
->limit(1);
}, 'Pro')->get();
```