|
26 | 26 | import ru.mystamps.web.dao.dto.DbImageDto;
|
27 | 27 | import ru.mystamps.web.dao.dto.ImageInfoDto;
|
28 | 28 | import ru.mystamps.web.dao.dto.LinkEntityDto;
|
| 29 | +import ru.mystamps.web.dao.dto.PurchaseAndSaleDto; |
29 | 30 | import ru.mystamps.web.dao.dto.SeriesFullInfoDto;
|
30 | 31 | import ru.mystamps.web.dao.dto.SeriesInfoDto;
|
31 | 32 | import ru.mystamps.web.dao.dto.SitemapInfoDto;
|
|
34 | 35 | import ru.mystamps.web.dao.dto.UserDetails;
|
35 | 36 | import ru.mystamps.web.dao.dto.UsersActivationDto;
|
36 | 37 | import ru.mystamps.web.dao.dto.UsersActivationFullDto;
|
| 38 | +import ru.mystamps.web.service.dto.Currency; |
37 | 39 |
|
38 | 40 | @SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods" })
|
39 | 41 | final class RowMappers {
|
@@ -100,6 +102,36 @@ public static SeriesInfoDto forSeriesInfoDto(ResultSet rs, int i) throws SQLExce
|
100 | 102 | );
|
101 | 103 | }
|
102 | 104 |
|
| 105 | + /** |
| 106 | + * @author Sergey Chechenev |
| 107 | + */ |
| 108 | + // CheckStyle: ignore LineLength for next 1 line |
| 109 | + public static PurchaseAndSaleDto forPurchaseAndSaleDto(ResultSet rs, int i) throws SQLException { |
| 110 | + Date date = rs.getDate("date"); |
| 111 | + String sellerName = rs.getString("seller_name"); |
| 112 | + String sellerUrl = rs.getString("seller_url"); |
| 113 | + String buyerName = rs.getString("buyer_name"); |
| 114 | + String buyerUrl = rs.getString("buyer_url"); |
| 115 | + String transactionUrl = rs.getString("transaction_url"); |
| 116 | + BigDecimal firstPrice = rs.getBigDecimal("first_price"); |
| 117 | + Currency firstCurrency = JdbcUtils.getCurrency(rs, "first_currency"); |
| 118 | + BigDecimal secondPrice = rs.getBigDecimal("second_price"); |
| 119 | + Currency secondCurrency = JdbcUtils.getCurrency(rs, "second_currency"); |
| 120 | + |
| 121 | + return new PurchaseAndSaleDto( |
| 122 | + date, |
| 123 | + sellerName, |
| 124 | + sellerUrl, |
| 125 | + buyerName, |
| 126 | + buyerUrl, |
| 127 | + transactionUrl, |
| 128 | + firstPrice, |
| 129 | + firstCurrency, |
| 130 | + secondPrice, |
| 131 | + secondCurrency |
| 132 | + ); |
| 133 | + } |
| 134 | + |
103 | 135 | public static SeriesFullInfoDto forSeriesFullInfoDto(ResultSet rs, int i) throws SQLException {
|
104 | 136 | Integer seriesId = rs.getInt("id");
|
105 | 137 | Integer releaseDay = JdbcUtils.getInteger(rs, "release_day");
|
|
0 commit comments