Skip to content

Commit

Permalink
Update CarRepository.java
Browse files Browse the repository at this point in the history
  • Loading branch information
dydwo0740 authored Aug 22, 2023
1 parent 9513858 commit b5d185f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ private RowMapper<TrimInfoDto> trimInfoRowMapper() {
}

public List<CarPriceDto> findCarPriceAndCount() {
String sql = "select SalesHistory.sold_options_id, (car_default_price + sum(model_price)) as sum from Model inner join HistoryModelMapper\n" +
"on Model.model_id = HistoryModelMapper.model_id inner join SalesHistory\n" +
"on SalesHistory.history_id = HistoryModelMapper.history_id inner join Car\n" +
"on Car.car_id = SalesHistory.car_id group by SalesHistory.history_id;";
String sql = "select SalesHistory.sold_options_id, (car_default_price + sum(model_price)) as sum from Model inner join HistoryModelMapper " +
"on Model.model_id = HistoryModelMapper.model_id inner join SalesHistory " +
"on SalesHistory.history_id = HistoryModelMapper.history_id inner join Car " +
"on Car.car_id = SalesHistory.car_id group by SalesHistory.history_id";

return template.query(sql, carPriceRowMapper());
}
Expand Down

0 comments on commit b5d185f

Please sign in to comment.