Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ’ป ๋ฐฐ์น˜ ์„œ๋น„์Šค ๊ตฌํ˜„ ๋ฐ ๋ฆฌํŒฉํ† ๋ง #12

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

AnneMayor
Copy link
Collaborator

@AnneMayor AnneMayor commented Jan 14, 2022

  • ์‹ค์‹œ๊ฐ„ ๊ฒฝ๋งค ์ฑ„ํŒ…๋ฐฉ ์ƒ์„ฑ ๋ฐ Sago ํ†ต๊ณ„ ์ง‘๊ณ„ ๋ฐฐ์น˜ ์„œ๋น„์Šค ๊ตฌํ˜„ ์™„๋ฃŒ
  • ์‹ค์‹œ๊ฐ„ ๊ฒฝ๋งค ์ฑ„ํŒ…๋ฐฉ ์†Œ์†Œํ•œ ๋ฆฌํŒฉํ† ๋ง(ํด๋ž˜์Šค ํŒŒ์ผ ์œ„์น˜ ๋ณ€๊ฒฝ)

@AnneMayor AnneMayor added feature Develop new feature refactoring labels Jan 14, 2022
@AnneMayor AnneMayor self-assigned this Jan 14, 2022

@Getter
@Setter
@RequiredArgsConstructor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ „์— PR์—์„œ๋„ ๋ง์”€๋“œ๋ ธ๋˜ ๋ถ€๋ถ„์ธ๋ฐ final ๋ฉค๋ฒ„๋ณ€์ˆ˜์— ๋Œ€ํ•ด์„œ๋งŒ ์ƒ์„ฑ์ž๋ฅผ generateํ•ด์ฃผ๋Š” annotation์ด์—์š”. lombok๋„ ํ•œ๋ฒˆ ์‚ดํŽด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”

<select id="selectCountFromTables" parameterType="java.time.ZonedDateTime" resultType="com.dhmall.batch.statistics.SagoStatisticsDto">
SELECT auctions.total_day_auction_count, users.total_day_user_count, payments.total_day_payment_count
FROM
( SELECT count(*) total_day_auction_count FROM auctions WHERE created_at = #{createdAt}) auctions,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ฐ count query๋ฅผ ๋ณ„๋„์˜ ๋ฉ”์„œ๋“œ๋กœ ๋ถ„๋ฆฌํ•˜๋Š”๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”. selectCountFromTables์ด ์–ด๋–ค ๋ฉ”์„œ๋“œ์ธ์ง€ ์•Œ๊ธฐ ์‰ฝ์ง€ ์•Š๊ณ  ์–ด๋–ค ๋ฐ์ดํ„ฐ๋ฅผ countํ•ด์˜ค๋Š” ๊ฑด์ง€๋„ ํ•ด๋‹น xmlํŒŒ์ผ์˜ query๋ฅผ ๋ณด์ง€์•Š์œผ๋ฉด ์•Œ ์ˆ˜ ์—†๊ฒŒ ๊ฐœ๋ฐœ๋˜์–ด์žˆ๋Š” ๊ฒƒ ๊ฐ™์•„์š”~

createSagoStatisticsInfo(statisticsInfo);
}

public SagoStatisticsDto findCountFromTables() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ•ด๋‹น ๋ฉ”์„œ๋“œ๋Š” ๋ฌธ์ œ๊ฐ€ ๋งŽ์€ ์ฝ”๋“œ์ธ ๊ฒƒ ๊ฐ™์•„์š”. xmlํŒŒ์ผ์— ๊ด€๋ จ ๋‚ด์šฉ ๋ฆฌ๋ทฐ ๋“œ๋ ธ์–ด์š” :)

Copy link

@f-lab-hubert f-lab-hubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜๊ณ ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค. ์ˆ˜์ •์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„์ด ์žˆ์–ด๋ณด์—ฌ์š”. ๋ฆฌ๋ทฐ ํ™•์ธ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค :)

@AnneMayor
Copy link
Collaborator Author

mapper xml SQL๋ฌธ ์ˆ˜์ • ํ•„์š”(delete ๊ตฌ๋ฌธ์— where ์ ˆ ์ถ”๊ฐ€ ๋“ฑ)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Develop new feature refactoring
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants