This commit is contained in:
2025-02-12 18:32:21 +09:00
commit aff0f4eeda
767 changed files with 285356 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
spring:
## deploy
# profiles:
# active: stage
jwt:
secret_key: '81b659967735aea6e4cb0467d04ea12c4a6432b415254f59825055680f59a9823fec5a15e9adbd246b1365ef1522580477691bc5cb56a9364143e7d9385d9912'
expiration: 86400000 # a day
refresh-token:
expiration: 604800000 # 7 days
mail:
host: smtp.gmail.com
port: 465
username: caliverse_adm@caliverse.io
password: fvif mdcq nxyq yzll
properties:
mail:
transport:
protocol: smtp
auth: true
starttls:
enable: true
debug: true
password:
expiration-days: 180

View File

@@ -0,0 +1,173 @@
server:
port: 23450
################################################################################################################################################################################################
# spring 설정
################################################################################################################################################################################################
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://10.20.20.8:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: root!
mybatis:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.caliverse.admin.domain.entity
total-datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://10.20.20.8:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: external_ro
password: bQNEXbRWQTtV6bwlqktGyBiuf2KqYF
#스프링 프레임워크의 기능 , 중복된 bean이 있을경우 마지막 등록된 bean이 이전에 등록된 bean을 덮어쓰게됨
main:
allow-bean-definition-overriding: true
#Hibernate의 로깅 레벨을 지정
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
#mongodb autoconfiguration 설정 제외
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
config:
activate:
on-profile: ${spring.profiles.active:dev}
################################################################################################################################################################################################
# springdoc
################################################################################################################################################################################################
springdoc:
api-docs:
enabled: true
packages-to-scan: com.caliverse.admin.domain.api
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
path: /
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
################################################################################################################################################################################################
# logging
################################################################################################################################################################################################
logging:
level:
root: info
org.springframework.cache: DEBUG
org.springframework.data.redis.cache: DEBUG
################################################################################################################################################################################################
# Meta
################################################################################################################################################################################################
caliverse:
# metadatapath: /metadata/
# metadatapath: classpath:/metadata/
file: classpath:file/
metadata:
path: /metadata/
reload:
interval: 3600000
################################################################################################################################################################################################
# File
################################################################################################################################################################################################
excel:
file-path: /upload/
################################################################################################################################################################################################
# AWS
############################################t####################################################################################################################################################
amazon:
dynamodb:
endpoint: https://dynamodb.us-west-2.amazonaws.com
metaTable: Metaverse-Dev
aws:
accesskey: AKIA4G3CB4Z5T6JUPHJN
secretkey: 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
region: us-west-2
s3:
bucket-name: metaverse-myhomeugc-test
enabled: false
################################################################################################################################################################################################
# RabbitMq
################################################################################################################################################################################################
rabbitmq:
url: 10.20.20.8
port: 5672
username: admin
password: admin
ssl: false
################################################################################################################################################################################################
# Mongodb
################################################################################################################################################################################################
mongodb:
host: 10.20.20.8:27017
business-log:
username: ""
password: ""
db: LogDB
indicator:
username: ""
password: ""
db: IndicatorDB
admin:
username: ""
password: ""
db: admin
################################################################################################################################################################################################
# "Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
################################################################################################################################################################################################
redis:
host: 10.20.20.8
port: 6379
password: KT-i5#i%-%LxKfZ5YJj6
async-timeout: 30000
sync-timeout: 30000
ssl: false
abort-connect: false
web3:
url: https://eco-system-dev-rollup-admin-api.caliverse.io/
timeout: 60000
delay: 2000
max-retry: 3

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<property name="LOG_DIR" value="logs" /> <!--로그 저장 디렉토리-->
<property name="LOG_PATH_NAME" value="${LOG_DIR}\\caliverse" /> <!--로그 파일명-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SS} [%thread] %-3level %logger{15}%X{method, .%method} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH_NAME}.log</file>
<!-- 일자별로 로그파일 적용 -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%F]%M\(%L\) : %m%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>

View File

@@ -0,0 +1,174 @@
server:
port: 23450
################################################################################################################################################################################################
# spring 설정
################################################################################################################################################################################################
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://metaverse-live-admintool.cdn6gxjy33pu.us-west-2.rds.amazonaws.com:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: caliverse
password: ApxkZkfflqjtm1!
mybatis:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.caliverse.admin.domain.entity
total-datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://prod-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: external_ro
password: gMTkUuoETPAaJyGTveKWIWyxrdoDQf9aL
#스프링 프레임워크의 기능 , 중복된 bean이 있을경우 마지막 등록된 bean이 이전에 등록된 bean을 덮어쓰게됨
main:
allow-bean-definition-overriding: true
#Hibernate의 로깅 레벨을 지정
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
#mongodb autoconfiguration 설정 제외
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
config:
activate:
on-profile: ${spring.profiles.active:live}
################################################################################################################################################################################################
# springdoc
################################################################################################################################################################################################
springdoc:
api-docs:
enabled: true
packages-to-scan: com.caliverse.admin.domain.api
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
path: /
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
################################################################################################################################################################################################
# logging
################################################################################################################################################################################################
logging:
level:
root: info
################################################################################################################################################################################################
# Meta
################################################################################################################################################################################################
caliverse:
# metadatapath: classpath:metadata/
# metadatapath: /metadata/
file: classpath:file/
metadata:
path: /metadata/
reload:
interval: 3600000
################################################################################################################################################################################################
# File
################################################################################################################################################################################################
excel:
file-path: /upload/
################################################################################################################################################################################################
# AWS
################################################################################################################################################################################################
amazon:
dynamodb:
endpoint: https://dynamodb.us-west-2.amazonaws.com
metaTable: Metaverse-Live
aws:
accesskey: AKIA4G3CB4Z5T6JUPHJN
secretkey: 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
region: us-west-2
s3:
bucket-name: metaverse-myhomeugc-live
enabled: false
################################################################################################################################################################################################
# RabbitMq
################################################################################################################################################################################################
rabbitmq:
url: b-a34727bf-09b9-4439-acfe-65ead25a5676.mq.us-west-2.amazonaws.com
port: 5671
username: serveruser
password: Zkfflqjtm!33&*(
ssl: true
################################################################################################################################################################################################
# Mongodb
################################################################################################################################################################################################
mongodb:
host: 172.20.143.197:27017
business-log:
username: calimongowrite
password: cali%lw9#1verse
db: LogDB
indicator:
username: lrwindiconnect
password: live%sw9#3verse
db: IndicatorDB
admin:
username: admin
password: zk28fl@#qjtm
db: admin
################################################################################################################################################################################################
# "Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
################################################################################################################################################################################################
redis:
host: clustercfg.metaverse-live-cluster.ocif0u.usw2.cache.amazonaws.com
port: 6379
password: wiUaVvNwX4PhBj&8
async-timeout: 30000
sync-timeout: 30000
ssl: true
abort-connect: false
web3:
url: https://eco-system-live-rollup-admin-api.caliverse.io
timeout: 60000
delay: 2000
max-retry: 3

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<property name="LOG_DIR" value="logs" /> <!--로그 저장 디렉토리-->
<property name="LOG_PATH_NAME" value="${LOG_DIR}\\caliverse" /> <!--로그 파일명-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SS} [%thread] %-3level %logger{15}%X{method, .%method} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH_NAME}.log</file>
<!-- 일자별로 로그파일 적용 -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%F]%M\(%L\) : %m%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>

View File

@@ -0,0 +1,192 @@
server:
port: 9099
################################################################################################################################################################################################
# spring 설정
################################################################################################################################################################################################
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://localhost:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: root!
mybatis:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.caliverse.admin.domain.entity
total-datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://localhost:13306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: external_ro
password: bQNEXbRWQTtV6bwlqktGyBiuf2KqYF
#스프링 프레임워크의 기능 , 중복된 bean이 있을경우 마지막 등록된 bean이 이전에 등록된 bean을 덮어쓰게됨
main:
allow-bean-definition-overriding: true
#Hibernate의 로깅 레벨을 지정
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
#mongodb autoconfiguration 설정 제외
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
################################################################################################################################################################################################
# springdoc
################################################################################################################################################################################################
springdoc:
api-docs:
enabled: true
packages-to-scan: com.caliverse.admin.domain.api
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
path: /swagger-ui.html
disable-swagger-default-url: false
display-request-duration: true
operations-sorter: alpha
################################################################################################################################################################################################
# logging
################################################################################################################################################################################################
logging:
level:
root: debug
################################################################################################################################################################################################
# Meta
################################################################################################################################################################################################
caliverse:
# metadatapath: D:\03.SVN\03.caliverse\DataAssets\MS2\JSON
# metadatapath: classpath:metadata/
file: classpath:file/
metadata:
path: D:\03.SVN\03.caliverse\DataAssets\MS2\JSON
reload:
interval: 3600000
################################################################################################################################################################################################
# File
################################################################################################################################################################################################
excel:
# file-path: /home/ec2-user/admintool/upload/
file-path: D:\caliverse-api/upload/
################################################################################################################################################################################################
# AWS
################################################################################################################################################################################################
amazon:
dynamodb:
endpoint: http://localhost:8000/
# endpoint: https://dynamodb.us-west-2.amazonaws.com
metaTable: Metaverse-Dev
# metaTable: Metaverse-Live
aws:
accesskey: ""
secretkey: ""
# accesskey: AKIA4G3CB4Z5T6JUPHJN
# secretkey: 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
region: us-west-2
s3:
bucket-name: metaverse-myhomeugc-test
enabled: false
################################################################################################################################################################################################
# RabbitMq
################################################################################################################################################################################################
rabbitmq:
# url: localhost
# port: 5672
# username: admin
# password: admin
# ssl: false
# dev
url: 10.20.20.8
port: 5672
username: admin
password: admin
ssl: false
################################################################################################################################################################################################
# Mongodb
################################################################################################################################################################################################
mongodb:
host: 10.20.20.8:27017
business-log:
username: ""
password: ""
db: LogDB
indicator:
username: ""
password: ""
db: IndicatorDB
admin:
username: ""
password: ""
db: admin
# business-log:
# uri: mongodb://localhost:27017
# db: LogDB
# indicator:
# uri: mongodb://localhost:27017
# db: IndicatorDB
################################################################################################################################################################################################
# "Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
################################################################################################################################################################################################
redis:
# host: localhost
# port: 6379
# password: KT-i5#i%-%LxKfZ5YJj6
# async-timeout: 30000
# sync-timeout: 30000
# ssl: false
# abort-connect: false
host: 10.20.20.8
port: 6379
password: KT-i5#i%-%LxKfZ5YJj6
async-timeout: 30000
sync-timeout: 30000
ssl: false
abort-connect: false
web3:
url: https://eco-system-dev-rollup-admin-api.caliverse.io
timeout: 60000
delay: 2000
max-retry: 3

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<property name="LOG_DIR" value="..\\logs" /> <!--로그 저장 디렉토리-->
<property name="LOG_PATH_NAME" value="${LOG_DIR}\\caliverse" /> <!--로그 파일명-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SS} [%thread] %-3level %logger{15}%X{method, .%method} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH_NAME}.log</file>
<!-- 일자별로 로그파일 적용 -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>60</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%F]%M\(%L\) : %m%n</pattern>
</encoder>
</appender>
<logger name="com.caliverse.admin.global.common.aspect.LoggingAspect" level="OFF"/>
<logger name="METHOD_LOGGER" level="INFO" additionalivity="false">
<appender-ref ref="CUSTOM_PATTERN"/>
</logger>
<appender name="CUSTOM_PATTERN" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SS} [%thread] %-3level [%X{method}] - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>

View File

@@ -0,0 +1,176 @@
server:
port: 23450
################################################################################################################################################################################################
# spring 설정
################################################################################################################################################################################################
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://metaverse-qa-admintool.cdn6gxjy33pu.us-west-2.rds.amazonaws.com:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: caliverse
password: Zkfflqjtm1!!
mybatis:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.caliverse.admin.domain.entity
total-datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://qa-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: external_ro
password: k0RantM9gOAg5ATecBTFXzbCYDnvXi
#스프링 프레임워크의 기능 , 중복된 bean이 있을경우 마지막 등록된 bean이 이전에 등록된 bean을 덮어쓰게됨
main:
allow-bean-definition-overriding: true
#Hibernate의 로깅 레벨을 지정
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
#mongodb autoconfiguration 설정 제외
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
config:
activate:
on-profile: ${spring.profiles.active:qa}
################################################################################################################################################################################################
# springdoc
################################################################################################################################################################################################
springdoc:
api-docs:
enabled: true
packages-to-scan: com.caliverse.admin.domain.api
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
path: /
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
################################################################################################################################################################################################
# logging
################################################################################################################################################################################################
logging:
level:
root: info
org.springframework.cache: DEBUG
org.springframework.data.redis.cache: DEBUG
################################################################################################################################################################################################
# Meta
################################################################################################################################################################################################
caliverse:
# metadatapath: classpath:/metadata/
# metadatapath: /metadata/
file: classpath:file/
metadata:
path: /metadata/
reload:
interval: 3600000
################################################################################################################################################################################################
# File
################################################################################################################################################################################################
excel:
file-path: /upload/
################################################################################################################################################################################################
# AWS
############################################t####################################################################################################################################################
amazon:
dynamodb:
endpoint: https://dynamodb.us-west-2.amazonaws.com
metaTable: Metaverse-Qa
aws:
accesskey: AKIA4G3CB4Z5T6JUPHJN
secretkey: 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
region: us-west-2
s3:
bucket-name: metaverse-myhomeugc-qa
enabled: false
################################################################################################################################################################################################
# RabbitMq
################################################################################################################################################################################################
rabbitmq:
url: b-d7c76a76-156d-4d55-8614-d4ce122a47c3.mq.us-west-2.amazonaws.com
port: 5671
username: serveruser
password: Zkfflqjtm!33&*(
ssl: true
################################################################################################################################################################################################
# Mongodb
################################################################################################################################################################################################
mongodb:
host: 172.40.141.201:27017
business-log:
username: calimongowrite
password: stage%sw9#1verse
db: LogDB
indicator:
username: srwindiconnect
password: stage%sw9#1verse
db: IndicatorDB
admin:
username: admin
password: stage28fl@#qjtm
db: admin
# uri: mongodb://srwindiconnect:stage%25sw9%231verse@172.40.141.201:27017
################################################################################################################################################################################################
# "Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
################################################################################################################################################################################################
redis:
host: clustercfg.metaverse-qa-cluster.ocif0u.usw2.cache.amazonaws.com
port: 6379
password: wiUaVvNwX4PhBj&8
async-timeout: 30000
sync-timeout: 30000
ssl: true
abort-connect: false
web3:
url: https://eco-system-qa-rollup-admin-api.caliverse.io
timeout: 60000
delay: 2000
max-retry: 3

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<property name="LOG_DIR" value="logs" /> <!--로그 저장 디렉토리-->
<property name="LOG_PATH_NAME" value="${LOG_DIR}\\caliverse" /> <!--로그 파일명-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SS} [%thread] %-3level %logger{15}%X{method, .%method} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH_NAME}.log</file>
<!-- 일자별로 로그파일 적용 -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%F]%M\(%L\) : %m%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>

View File

@@ -0,0 +1,174 @@
server:
port: 23450
################################################################################################################################################################################################
# spring 설정
################################################################################################################################################################################################
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://metaverse-stage-admintool.cdn6gxjy33pu.us-west-2.rds.amazonaws.com:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: satuser
password: Zkfflha^&*
mybatis:
mapper-locations: classpath:mappers/*.xml
type-aliases-package: com.caliverse.admin.domain.entity
total-datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://stage-caliverse-db.cluster-ro-czac0we0qoyx.us-west-2.rds.amazonaws.com:3306/caliverse?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: caliverse
password: XjEDXb8fi9ZXP5PaxDCxPWeXK03mzk
#스프링 프레임워크의 기능 , 중복된 bean이 있을경우 마지막 등록된 bean이 이전에 등록된 bean을 덮어쓰게됨
main:
allow-bean-definition-overriding: true
#Hibernate의 로깅 레벨을 지정
level:
org.hibernate.SQL: debug
org.hibernate.type: trace
#mongodb autoconfiguration 설정 제외
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
config:
activate:
on-profile: ${spring.profiles.active:stage}
################################################################################################################################################################################################
# springdoc
################################################################################################################################################################################################
springdoc:
api-docs:
enabled: true
packages-to-scan: com.caliverse.admin.domain.api
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
path: /
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
################################################################################################################################################################################################
# logging
################################################################################################################################################################################################
logging:
level:
root: info
################################################################################################################################################################################################
# Meta
################################################################################################################################################################################################
caliverse:
# metadatapath: classpath:/metadata/
# metadatapath: /metadata/
file: classpath:file/
metadata:
path: /metadata/
reload:
interval: 3600000
################################################################################################################################################################################################
# File
################################################################################################################################################################################################
excel:
file-path: /upload/
################################################################################################################################################################################################
# AWS
############################################t####################################################################################################################################################
amazon:
dynamodb:
endpoint: https://dynamodb.us-west-2.amazonaws.com
metaTable: Metaverse-Stage
aws:
accesskey: AKIA4G3CB4Z5T6JUPHJN
secretkey: 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
region: us-west-2
s3:
bucket-name: metaverse-myhomeugc-stage
enabled: false
################################################################################################################################################################################################
# RabbitMq
################################################################################################################################################################################################
rabbitmq:
url: b-d0e44de3-7fb3-4120-b851-4566002eaf8e.mq.us-west-2.amazonaws.com
port: 5671
username: serveruser
password: Zkfflqjtm!33&*(
ssl: true
################################################################################################################################################################################################
# Mongodb
################################################################################################################################################################################################
mongodb:
host: 172.30.147.83:27017
business-log:
username: calimongowrite
password: stage%sw9#1verse
db: LogDB
indicator:
username: srwindiconnect
password: stage%sw9#1verse
db: IndicatorDB
admin:
username: admin
password: stage28fl@#qjtm
db: admin
################################################################################################################################################################################################
# "Redis": "127.0.0.1:6379,password=KT-i5#i%-%LxKfZ5YJj6,AsyncTimeout=30000,SyncTimeout=30000,ssl=false,abortConnect=false",
################################################################################################################################################################################################
redis:
host: clustercfg.metaverse-stage-cluster.ocif0u.usw2.cache.amazonaws.com
port: 6379
password: wiUaVvNwX4PhBj&8
async-timeout: 30000
sync-timeout: 30000
ssl: true
abort-connect: false
web3:
url: https://eco-system-stage-rollup-admin-api.caliverse.io
timeout: 60000
delay: 2000
max-retry: 3

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<property name="LOG_DIR" value="logs" /> <!--로그 저장 디렉토리-->
<property name="LOG_PATH_NAME" value="${LOG_DIR}\\caliverse" /> <!--로그 파일명-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SS} [%thread] %-3level %logger{15}%X{method, .%method} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH_NAME}.log</file>
<!-- 일자별로 로그파일 적용 -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH_NAME}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>10MB</maxFileSize>
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%-5p] [%F]%M\(%L\) : %m%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</configuration>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,19 @@
### RabbitMQ Test ( login )
POST http://localhost:9099/api/v1/auth/login
Content-Type: application/json
{
"name": "sangyeob.kim@lotte.net",
"email": "sangyeob.kim@lotte.net",
"password": "502755Kcat!"
}
> {%
client.global.set("auth_token", response.body.data.access_token);
%}
### rabbit mq test ( send )
POST http://localhost:9099/api/v1/RabbitMQTest/send
authorization: Bearer {{auth_token}}
Content-Type: application/json

View File

@@ -0,0 +1,144 @@
<!-- AdminMapper.xml -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.AdminMapper">
<!-- resultMap 설정 -->
<resultMap id="UserResultMap" type="com.caliverse.admin.domain.entity.Admin">
<!-- 일반 필드들은 column과 property를 매핑하여 추가합니다. -->
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="name" column="name"/>
<result property="password" column="password"/>
<result property="email" column="email"/>
<result property="status" column="status"/>
<result property="groupId" column="group_id"/>
<result property="groupNm" column="group_nm"/>
<result property="pwUpdateDt" column="pw_update_dt"/>
</resultMap>
<select id="findByEmail" resultMap="UserResultMap" parameterType="java.lang.String">
SELECT * FROM admin WHERE email = #{email} and deleted = 0
</select>
<select id="existsByEmail" resultType="boolean" parameterType="java.lang.String">
SELECT COUNT(*) > 0 FROM admin WHERE email = #{email} and deleted = 0
</select>
<select id="findPwdById" resultType="String" parameterType="java.lang.Long">
SELECT password FROM admin WHERE id = #{id}
</select>
<select id="findPwdHistoryById" resultType="String" parameterType="java.lang.Long">
SELECT password FROM admin_history WHERE admin_id = #{id}
</select>
<insert id="save" parameterType="com.caliverse.admin.domain.entity.Admin">
INSERT INTO admin (name, password, email, status, group_id)
VALUES (#{name}, #{password}, #{email}, #{status}, ${groupId} )
</insert>
<update id="initPwd" parameterType="map">
UPDATE admin SET password = #{password}
,status = 'INIT'
,update_by = #{updateBy}
,pw_update_Dt = NOW()
,update_dt = NOW()
WHERE id = #{id}
</update>
<update id="updatePwd" parameterType="map">
UPDATE admin SET password = #{password}
,status = #{status}
,update_by = #{updateBy}
,pw_update_Dt = NOW()
,update_dt = NOW()
WHERE id = #{updateBy}
</update>
<insert id="saveHistoryPwd" parameterType="map">
INSERT INTO admin_history (admin_id,password) VALUES (#{adminId}, #{password})
</insert>
<!--운영자 리스트 조회-->
<select id="getAdminList" resultMap="UserResultMap" parameterType="map">
SELECT * FROM
(
SELECT (@row_number:=@row_number + 1) AS row_num
, a.id
, a.name
, a.email
, a.status
, a.group_id
, a.pw_update_dt AS pw_update_dt
FROM admin a
, (SELECT @row_number:=0) AS t
WHERE a.deleted = 0
<if test="join_check == 'true'">AND a.status = 'ROLE_NOT_PERMITTED'
</if>
<if test="
group_id != null and group_id != ''">AND a.group_id = #{group_id}
</if>
<choose>
<when test="search_type == 'NAME' || search_type == 'name'">
<if test="search_key != null and search_key != ''">
AND a.name LIKE CONCAT('%',#{search_key},'%')
</if>
</when>
<otherwise>
<if test="search_key != null and search_key != ''">
AND a.email LIKE CONCAT('%',#{search_key},'%')
</if>
</otherwise>
</choose>
ORDER BY a.create_dt
)c
<if test="orderby != null and orderby != ''">
ORDER BY c.row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM admin WHERE deleted = 0
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM admin a WHERE a.deleted = 0
<if test="join_check == 'true'">
AND a.status = 'ROLE_NOT_PERMITTED'
</if>
<if test="group_id != null and group_id != ''">
AND a.group_id = #{group_id}
</if>
<choose>
<when test="search_type == 'NAME' || search_type == 'name'">
<if test="search_key != null and search_key != ''">
AND a.name LIKE CONCAT('%',#{search_key},'%')
</if>
</when>
<otherwise>
<if test="search_key != null and search_key != ''">
AND a.email LIKE CONCAT('%',#{search_key},'%')
</if>
</otherwise>
</choose>
</select>
<!--로그인 승인/불가-->
<update id="updateStatus" parameterType="map">
UPDATE admin SET status = #{status} , update_by = #{id} , update_dt = NOW() WHERE email = #{email}
</update>
<!--운영자 그룹 저장-->
<update id="updateGroup" parameterType="map">
UPDATE admin SET group_id = #{group_id} , update_by = #{id} , update_dt = NOW() WHERE email = #{email}
</update>
<!--운영자 선택 삭제-->
<update id="deleteAdmin" parameterType="map">
UPDATE admin SET deleted = ${deleted} WHERE email = #{email}
</update>
</mapper>

View File

@@ -0,0 +1,233 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.BattleMapper">
<resultMap id="BattleEventResultMap" type="com.caliverse.admin.domain.entity.BattleEvent">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="groupId" column="group_id"/>
<result property="eventName" column="event_name"/>
<result property="repeatType" column="repeat_type"/>
<result property="eventOperationTime" column="event_operation_time"/>
<result property="status" column="status"/>
<result property="eventStartDt" column="event_start_dt"/>
<result property="eventEndDt" column="event_end_dt"/>
<result property="roundTime" column="round_time"/>
<result property="roundCount" column="round_count"/>
<result property="hotTime" column="hot_time"/>
<result property="configId" column="config_id"/>
<result property="rewardGroupId" column="reward_group_id"/>
<result property="createBy" column="create_by"/>
<result property="createDt" column="create_dt"/>
<result property="updateBy" column="update_by"/>
<result property="updateDt" column="update_dt"/>
</resultMap>
<!--리스트 조회-->
<select id="getBattleEventList" resultMap="BattleEventResultMap" parameterType="map">
SELECT *
FROM(
SELECT (@row_number:=@row_number + 1) AS row_num , c.* FROM
(
SELECT
a.id
, a.group_id
, a.event_name
, a.repeat_type
, a.event_operation_time
, a.status
, a.event_start_dt
, a.event_end_dt
, a.round_time
, a.round_count
, a.hot_time
, a.config_id
, a.reward_group_id
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
FROM battle_event a
WHERE 1 = 1
<choose>
<when test="land_type == 'NAME' or land_type == 'name' ">
<if test="land_data != null and land_data != ''">
AND a.land_name LIKE CONCAT('%',#{land_data},'%')
</if>
</when>
<otherwise>
<if test="land_data != null and land_data != ''">
AND a.land_id = #{land_data}
</if>
</otherwise>
</choose>
<choose>
<when test="user_type == 'NAME' or user_type == 'name' ">
<if test="user_data != null and user_data != ''">
AND a.bidder_nickname LIKE CONCAT('%',#{user_data},'%')
</if>
</when>
<otherwise>
<if test="user_data != null and user_data != ''">
AND a.bidder_guid = #{user_data}
</if>
</otherwise>
</choose>
<if test="land_size != null and land_size != ''">
<choose>
<when test="land_size != 'ALL' ">
AND a.land_size = #{land_size}
</when>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.auction_start_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.auction_end_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
GROUP BY a.id
ORDER BY status
)c
, (SELECT @row_number:=0) AS t
) Z
ORDER BY
CASE WHEN Z.status = 'FAIL' OR Z.status = 'CANCEL' THEN 1 ELSE 0 END,
<if test="orderby != null and orderby != ''">
row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM battle_event
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM battle_event a
WHERE 1 = 1
<if test="title != null and title != ''">
AND b.title LIKE CONCAT('%',#{title},'%')
</if>
<if test="event_type != null and event_type != ''">
<choose>
<when test="event_type != 'ALL' ">
AND event_type = #{event_type}
</when>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.auction_start_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.auction_end_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
</select>
<select id="chkTimeOver" parameterType="com.caliverse.admin.domain.request.BattleEventRequest" resultType="integer">
SELECT COUNT(*)
FROM battle_event
WHERE
-- 시간 중복 체크
TIME(#{eventStartTime}) &lt; ADDTIME(TIME(event_start_dt), SEC_TO_TIME(event_operation_time))
AND ADDTIME(TIME(#{eventStartTime}), SEC_TO_TIME(#{eventOperationTime})) > TIME(event_start_dt)
-- 날짜 범위 중복 체크
AND (
(DATE(#{eventStartTime}) BETWEEN DATE(event_start_dt) AND DATE(event_end_dt))
OR (DATE(#{eventEndTime}) BETWEEN DATE(event_start_dt) AND DATE(event_end_dt))
OR (DATE(event_start_dt) BETWEEN DATE(#{eventStartTime}) AND DATE(#{eventEndTime}))
OR (DATE(event_end_dt) BETWEEN DATE(#{eventStartTime}) AND DATE(#{eventEndTime}))
)
</select>
<!--이벤트 상세 조회-->
<select id="getBattleEventDetail" parameterType="java.lang.Long" resultMap="BattleEventResultMap" >
SELECT
a.id
, a.group_id
, a.event_name
, a.repeat_type
, a.event_operation_time
, a.status
, a.event_start_dt
, a.event_end_dt
, a.round_time
, a.round_count
, a.hot_time
, a.config_id
, a.reward_group_id
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
FROM battle_event a
WHERE a.id = #{id}
</select>
<!--저장-->
<insert id="postBattleEvent" parameterType="com.caliverse.admin.domain.request.BattleEventRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO battle_event (group_id, event_name, repeat_type, event_operation_time, event_start_dt, event_end_dt, config_id, reward_group_id, round_time, round_count, hot_time, create_by, update_by)
VALUES (#{groupId}, #{eventName}, #{repeatType}, #{eventOperationTime}, #{eventStartDt}, #{eventEndDt}, #{configId}, #{rewardGroupId}, #{roundTime}, #{roundCount}, #{hotTime}, #{createBy}, #{updateBy})
</insert>
<!--수정-->
<update id="updateBattleEvent" parameterType="com.caliverse.admin.domain.request.BattleEventRequest">
UPDATE battle_event SET group_id = #{groupId}
, resv_end_dt = #{resvEndDt}
, auction_start_dt = #{auctionStartDt}
, auction_end_dt = #{auctionEndDt}
, currency_type = #{currencyType}
, start_price = #{startPrice}
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<!--삭제-->
<update id="deleteBattleEvent" parameterType="map">
UPDATE battle_event
SET deleted = 1
,status = 'CANCEL'
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<update id="updateStatusBattleEvent" parameterType="map">
UPDATE battle_event
SET status = #{status}
where id = #{id}
</update>
<select id="getScheduleBattleEventList" resultMap="BattleEventResultMap">
SELECT id
, a.group
, a.event_name
, a.repeat_type
, a.event_operation_time
, a.status
, a.event_start_dt
, a.event_end_dt
, a.round_time
, a.round_count
, a.hot_time
, a.config_id
, a.reward_group_id
FROM battle_event
WHERE (status = 'WAIT' or status = 'AUCTION_START' or status = 'RESV_START')
AND deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,192 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.BlackListMapper">
<resultMap id="BlackListResultMap" type="com.caliverse.admin.domain.entity.BlackList">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="guid" column="guid"/>
<result property="nickname" column="nickname"/>
<result property="status" column="status"/>
<result property="period" column="period"/>
<result property="sanctions" column="sanctions"/>
<result property="type" column="type"/>
<result property="createBy" column="create_by"/>
<result property="createDt" column="create_dt"/>
<result property="startDt" column="start_dt"/>
<result property="endDt" column="end_dt"/>
</resultMap>
<!--인게임메시지 리스트 조회-->
<select id="getBlackList" resultMap="BlackListResultMap" parameterType="map">
SELECT * FROM (
SELECT (@row_number:=@row_number + 1) AS row_num
,a.id
,a.guid
,a.nickname
,a.status
,a.period
,a.sanctions
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
FROM black_list a
,(SELECT @row_number:=0) AS t
WHERE 1 = 1
AND a.deleted = 0
<choose>
<when test="search_type == 'NAME' or search_type == 'name' ">
<if test="search_key != null and search_key != ''">
AND a.nickname LIKE CONCAT('%',#{search_key},'%')
</if>
</when>
<otherwise>
<if test="search_key != null and search_key != ''">
AND a.guid = #{search_key}
</if>
</otherwise>
</choose>
<if test="sanctions != null and sanctions != ''">
<choose>
<when test="sanctions == 'ALL' ">
</when>
<otherwise>
AND a.sanctions = #{sanctions}
</otherwise>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status == 'ALL' ">
</when>
<otherwise>
AND a.status = #{status}
</otherwise>
</choose>
</if>
<if test="period != null and period != ''">
<choose>
<when test="period == 'ALL' ">
</when>
<otherwise>
AND a.period = #{period}
</otherwise>
</choose>
</if>
ORDER BY a.create_dt
) c
WHERE 1 = 1
<if test="email != null and email != ''">
AND c.create_by LIKE CONCAT('%',#{email},'%')
</if>
<if test="orderby != null and orderby != ''">
ORDER BY c.row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM black_list WHERE deleted = 0
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM black_list a WHERE a.deleted = 0
<choose>
<when test="search_type == 'NAME' or search_type == 'name' ">
<if test="search_key != null and search_key != ''">
AND a.nickname LIKE CONCAT('%',#{search_key},'%')
</if>
</when>
<otherwise>
<if test="search_key != null and search_key != ''">
AND a.guid = #{search_key}
</if>
</otherwise>
</choose>
<if test="sanctions != null and sanctions != ''">
<choose>
<when test="sanctions == 'ALL' ">
</when>
<otherwise>
AND a.sanctions = #{sanctions}
</otherwise>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status == 'ALL' ">
</when>
<otherwise>
AND a.status = #{status}
</otherwise>
</choose>
</if>
<if test="period != null and period != ''">
<choose>
<when test="period == 'ALL' ">
</when>
<otherwise>
AND a.period = #{period}
</otherwise>
</choose>
</if>
</select>
<select id="getBlackListDetail" parameterType="java.lang.Long" resultMap="BlackListResultMap">
SELECT a.id
,a.guid
,a.nickname
,a.status
,a.period
,a.sanctions
,a.type
,a.create_dt
,a.start_dt
,a.end_dt
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
FROM black_list a WHERE a.id = #{id}
</select>
<select id="getHistoryByGuid" parameterType="java.lang.String" resultMap="BlackListResultMap">
SELECT a.guid
,a.nickname
,a.status
,a.period
,a.sanctions
,a.type
,a.create_dt
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
,a.start_dt
,a.end_dt
FROM black_list a WHERE guid = #{guid}
</select>
<select id="getCountByGuid" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT COUNT(*) FROM black_list WHERE guid = #{guid} and STATUS &lt;&gt; 'EXPIRATION' AND deleted = 0
</select>
<insert id="postBlackList" parameterType="com.caliverse.admin.domain.request.BlackListRequest">
INSERT INTO black_list (guid, nickname, status, type, sanctions, period, start_dt, end_dt, create_by, create_dt)
VALUES (#{guid},#{nickname}, #{status}, #{type}, #{sanctions},#{period}, #{startDt}, #{endDt}, #{createBy}, NOW())
</insert>
<update id="deleteBlackList" parameterType="map">
UPDATE black_list SET deleted = 1 WHERE id = #{id}
</update>
<select id="getScheduleBlackList" resultMap="BlackListResultMap">
SELECT id,
guid,
nickname,
status,
type,
sanctions,
period,
start_dt,
end_dt
FROM black_list
WHERE STATUS &lt;&gt; 'EXPIRATION'
AND STATUS &lt;&gt; 'FAIL'
AND deleted = false
</select>
<update id="updateStatus" parameterType="map">
UPDATE black_list SET status = #{status} WHERE id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,139 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.CaliumMapper">
<resultMap id="CaliumRequestResultMap" type="com.caliverse.admin.domain.entity.Calium">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="dept" column="dept"/>
<result property="count" column="count"/>
<result property="status" column="status"/>
<result property="content" column="content"/>
<result property="requestId" column="request_id"/>
<result property="createTime" column="create_time"/>
<result property="stateMessage" column="state_message"/>
<result property="stateTime" column="state_time"/>
<result property="createBy" column="create_by"/>
<result property="createDt" column="create_dt"/>
<result property="updateBy" column="update_by"/>
<result property="updateDt" column="update_dt"/>
</resultMap>
<!--칼리움 요청 리스트 조회-->
<select id="getCaliumRequestList" resultMap="CaliumRequestResultMap" parameterType="map">
SELECT (@row_number:=@row_number + 1) AS row_num , c.* FROM
(
SELECT
a.id
, a.dept
, a.count AS count
, a.status
, a.content
, a.create_time
, a.state_time
, a.state_message
, a.create_dt
, (SELECT name FROM admin WHERE id = a.create_by ) AS create_by
FROM calium_request a
WHERE 1 = 1
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
a.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.create_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.create_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
ORDER BY a.create_dt
)c
, (SELECT @row_number:=0) AS t
<if test="orderby != null and orderby != ''">
ORDER BY row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getCaliumTotal" resultType="java.lang.Double">
select ROUND(COALESCE(SUM(count), 0), 2) from calium_request WHERE deleted = 0 AND status = 'FINISH'
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM calium_request WHERE deleted = 0
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM calium_request a
WHERE a.deleted = 0
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
a.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.create_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.create_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
</select>
<select id="getCaliumRequestDetail" parameterType="java.lang.Long" resultMap="CaliumRequestResultMap" >
SELECT
a.id
, a.dept
, a.count
, a.status
, a.content
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
, a.create_by
FROM calium_request a
WHERE a.id = #{id}
</select>
<insert id="postCaliumRequest" parameterType="com.caliverse.admin.domain.request.CaliumRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO calium_request (dept, count, content, request_id, create_time, create_by, update_by)
VALUES (#{dept}, #{count}, #{content}, #{requestId}, #{createTime}, #{createBy}, #{createBy})
</insert>
<update id="updateStatusCaliumRequest" parameterType="map">
UPDATE calium_request
SET status = #{status}
<if test="stateTime != null">
,state_time = #{stateTime}
</if>
<if test="updateBy != null">
, update_by = #{updateBy}
, update_dt = NOW()
</if>
where id = #{id}
</update>
<select id="getScheduleCaliumRequest" resultMap="CaliumRequestResultMap">
SELECT id,
request_id
FROM calium_request
WHERE status = 'WAIT'
AND deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,255 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.EventMapper">
<resultMap id="EventResultMap" type="com.caliverse.admin.domain.entity.Event">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="eventType" column="event_type"/>
<result property="status" column="status"/>
<result property="startDt" column="start_dt"/>
<result property="endDt" column="end_dt"/>
<result property="deleteDesc" column="delete_desc"/>
<result property="addFlag" column="add_flag"/>
<result property="createBy" column="create_by"/>
<result property="createDt" column="create_dt"/>
<result property="updateBy" column="update_by"/>
<result property="updateDt" column="update_dt"/>
</resultMap>
<resultMap id="MessageResultMap" type="com.caliverse.admin.domain.entity.Message">
<result property="title" column="title"/>
<result property="language" column="language"/>
<result property="content" column="content"/>
</resultMap>
<!--이벤트 리스트 조회-->
<select id="getEventList" resultMap="EventResultMap" parameterType="map">
SELECT *
FROM(
SELECT (@row_number:=@row_number + 1) AS row_num , c.* FROM
(
SELECT
a.id
, a.event_type
, a.status
, a.start_dt
, a.end_dt
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
, b.title
, a.add_flag
FROM event a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'EVENT'
AND
(
(b.language = 'KO' AND b.language IS NOT NULL) -- KO인 content
OR
(b.language &lt;&gt; 'KO' AND b.language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language IS NOT NULL
)
)
)
)
WHERE 1 = 1
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
b.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="title != null and title != ''">
AND b.title LIKE CONCAT('%',#{title},'%')
</if>
<if test="event_type != null and event_type != ''">
<choose>
<when test="event_type != 'ALL' ">
AND event_type = #{event_type}
</when>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.start_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.end_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
GROUP BY a.id
ORDER BY a.create_dt
)c
, (SELECT @row_number:=0) AS t
) Z
ORDER BY
CASE WHEN Z.status = 'RUNNING' THEN 0 ELSE 1 END,
<if test="orderby != null and orderby != ''">
row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM event
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM event a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'EVENT'
AND
(
(b.language = 'KO' AND b.language IS NOT NULL) -- KO인 content
OR
(b.language &lt;&gt; 'KO' AND b.language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language IS NOT NULL
)
)
)
)
WHERE 1 = 1
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
b.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="title != null and title != ''">
AND b.title LIKE CONCAT('%',#{title},'%')
</if>
<if test="event_type != null and event_type != ''">
<choose>
<when test="event_type != 'ALL' ">
AND event_type = #{event_type}
</when>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.start_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.end_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
</select>
<!--이벤트 상세 조회-->
<select id="getEventDetail" parameterType="java.lang.Long" resultMap="EventResultMap" >
SELECT
a.id
, a.event_type
, a.status
, a.start_dt
, a.end_dt
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
, a.delete_desc
, a.add_flag
FROM event a
WHERE a.id = #{id}
</select>
<select id="getMessage" parameterType="java.lang.Long" resultMap="MessageResultMap" >
SELECT
*
FROM message
WHERE target_id = #{id}
AND type = 'EVENT'
</select>
<select id="getItem" parameterType="java.lang.Long" resultType="com.caliverse.admin.domain.entity.Item" >
SELECT
reward_group_id AS item
, item_cnt AS itemCnt
FROM item
WHERE mail_id = #{id}
AND type = 'EVENT'
</select>
<!--이벤트 저장-->
<insert id="postEvent" parameterType="com.caliverse.admin.domain.request.EventRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO event (event_type, start_dt, end_dt, create_by)
VALUES (#{eventType}, #{startDt}, #{endDt}, #{createBy})
</insert>
<insert id="insertGuid" parameterType="map">
INSERT INTO guid (mail_id, guid)
VALUES (#{mailId}, #{guid})
</insert>
<insert id="insertMessage" parameterType="map">
INSERT INTO message (target_id, type,title, content, language)
VALUES (#{mailId}, 'EVENT',#{title}, #{content}, #{language})
</insert>
<insert id="insertItem" parameterType="map">
INSERT INTO item (mail_id,reward_group_id,item_cnt,type) VALUES (#{mailId} , #{goodsId}, #{itemCnt}, 'EVENT')
</insert>
<!--이벤트 수정-->
<update id="updateEvent" parameterType="com.caliverse.admin.domain.request.EventRequest">
UPDATE event SET event_type = #{eventType}
, start_dt = #{startDt}
, end_dt = #{endDt}
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<update id="deleteMessage" parameterType="map">
DELETE FROM message
WHERE target_id = #{mailId}
AND type = 'EVENT'
</update>
<update id="deleteItem" parameterType="map">
DELETE FROM item
WHERE mail_id = #{mailId}
AND type = 'EVENT'
</update>
<update id="deleteEvent" parameterType="map">
UPDATE event
SET deleted = 1
,status = 'DELETE'
,delete_desc = #{desc}
WHERE id = #{mailId}
</update>
<update id="updateStatusEvent" parameterType="map">
UPDATE event
SET status = #{status}
where id = #{id}
</update>
<update id="updateAddFlag" parameterType="java.lang.Long">
UPDATE event SET add_flag = true
where id = #{id}
</update>
<select id="getScheduleEventList" resultMap="EventResultMap">
SELECT id,
event_type,
status,
start_dt,
end_dt,
add_flag
FROM event
WHERE (status = 'WAIT' or status = 'RUNNING')
AND deleted = false
</select>
</mapper>

View File

@@ -0,0 +1,87 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.GroupMapper">
<resultMap id="GroupsResultMap" type="com.caliverse.admin.domain.entity.Groups">
<id property="groupId" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="groupNm" column="name"/>
<result property="desc" column="desc"/>
<result property="memberCnt" column="member_cnt"/>
<result property="createDt" column="create_dt"/>
<result property="updateDt" column="update_dt"/>
</resultMap>
<resultMap id="AuthResultMap" type="com.caliverse.admin.domain.entity.Authority">
<id property="id" column="id"/>
<result property="authMenu" column="auth_menu"/>
<result property="authName" column="auth_name"/>
</resultMap>
<!--권한 그룹 조회 by id -->
<select id="getGroupInfo" resultType="map" parameterType="java.lang.Long">
SELECT * FROM groups WHERE id = #{groupId} and deleted = 0
</select>
<!--권한 조회 by admin_id-->
<select id="getGroupAuth" resultMap="AuthResultMap" parameterType="java.lang.Long">
SELECT a.id, a.auth_menu, a.auth_name FROM authority a, group_auth b WHERE a.id = b.auth_id and b.group_id = #{groupId}
</select>
<!--권한 조회 by name-->
<select id="findGroupName" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT count(*) FROM groups WHERE deleted = 0 and name = #{groupNm}
</select>
<select id="getAllCnt" resultType="java.lang.Integer">
SELECT count(*) FROM groups WHERE deleted = 0
</select>
<!--권한 리스트 조회-->
<select id="getGroupList" resultMap="GroupsResultMap" parameterType="map">
SELECT (@row_number:=@row_number + 1) AS row_num ,c.* FROM
(
SELECT
a.*
,COUNT(b.id) AS member_cnt
FROM groups a
LEFT JOIN admin b ON a.id = b.group_id AND b.deleted = 0
WHERE a.deleted = 0
GROUP BY a.id
ORDER BY a.create_dt
) c
,(SELECT @row_number:=0) AS t
<if test="orderby != null and orderby != ''">
ORDER BY row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getGroupDetail" resultMap="AuthResultMap" parameterType="java.lang.String">
SELECT a.*
FROM authority a
,group_auth b
WHERE a.id = b.auth_id
and b.group_id = #{groupId}
</select>
<insert id="postAdminGroup" parameterType="com.caliverse.admin.domain.request.GroupRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO groups (name,description,create_by) values (#{groupNm} ,#{description}, #{createBy})
</insert>
<delete id="deleteGroupAuth" parameterType="java.lang.String">
DELETE FROM group_auth WHERE group_id = #{groupId}
</delete>
<insert id="insertGroupAuth" parameterType="map">
INSERT INTO group_auth (group_id, auth_id) values (#{groupId}, #{authId})
</insert>
<update id="deleteGroup" parameterType="java.lang.Long">
UPDATE groups set deleted = 1 WHERE id = #{groupId}
</update>
</mapper>

View File

@@ -0,0 +1,103 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.HistoryMapper">
<resultMap id="LogResultMap" type="com.caliverse.admin.domain.entity.Log">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="adminId" column="admin_id"/>
<result property="content" column="content"/>
<result property="historyType" column="type"/>
<result property="createDt" column="create_dt"/>
<result property="name" column="name"/>
<result property="mail" column="mail"/>
</resultMap>
<!--사용 이력 리스트 조회-->
<select id="getHistoryList" parameterType="map" resultMap="LogResultMap">
SELECT * FROM
(
SELECT
(@row_number:=@row_number + 1) AS row_num
, a.*
FROM admin_log a
, (SELECT @row_number:=0) AS t
WHERE 1 = 1
<if test="history_type != null and history_type != ''">
<choose>
<when test="history_type == 'ALL' ">
</when>
<otherwise>
AND a.type = #{history_type}
</otherwise>
</choose>
</if>
<choose>
<when test="search_type == 'NAME' || search_type == 'name' ">
<if test="search_key != null and search_key != ''">
AND a.name LIKE CONCAT('%',#{search_key},'%')
</if>
</when>
<otherwise>
<if test="search_key != null and search_key != ''">
AND a.mail LIKE CONCAT('%',#{search_key},'%')
</if>
</otherwise>
</choose>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.create_dt BETWEEN #{start_dt, jdbcType=TIMESTAMP} and #{end_dt, jdbcType=TIMESTAMP}
</if>
ORDER BY a.create_dt
)c
<if test="orderby != null and orderby != ''">
ORDER BY c.row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM admin_log
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM admin_log a
WHERE 1 = 1
<if test="history_type != null and history_type != ''">
<choose>
<when test="history_type == 'ALL' ">
</when>
<otherwise>
AND a.type = #{history_type}
</otherwise>
</choose>
</if>
<choose>
<when test="search_type == 'NAME' || search_type == 'name' ">
<if test="search_key != null and search_key != ''">
AND a.name LIKE CONCAT('%',#{search_key},'%')
</if>
</when>
<otherwise>
<if test="search_key != null and search_key != ''">
AND a.mail LIKE CONCAT('%',#{search_key},'%')
</if>
</otherwise>
</choose>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.create_dt BETWEEN #{start_dt, jdbcType=TIMESTAMP} and #{end_dt, jdbcType=TIMESTAMP}
</if>
</select>
<select id="getLogJson" resultType="String" parameterType="java.lang.String">
SELECT content FROM admin_log WHERE id = #{id}
</select>
<!--로그 기록-->
<insert id="saveLog" parameterType="map">
INSERT INTO admin_log (admin_id,name,mail,type,content) VALUES (#{adminId},#{name},#{mail}, #{type}, #{content});
</insert>
<update id="truncateMetaTable">
TRUNCATE TABLE caliverse_meta_data
</update>
<insert id="insertMetaData" parameterType="map">
INSERT INTO caliverse_meta_data (file_name, data_id, json_data) VALUES (#{fileName}, #{dataId}, #{jsonData})
</insert>
</mapper>

View File

@@ -0,0 +1,301 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.LandMapper">
<resultMap id="LandAuctionResultMap" type="com.caliverse.admin.domain.entity.LandAuction">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="landId" column="land_id"/>
<result property="landName" column="land_name"/>
<result property="landSize" column="land_size"/>
<result property="landSocket" column="land_socket"/>
<result property="auctionSeq" column="auction_seq"/>
<result property="status" column="status"/>
<result property="resvStartDt" column="resv_start_dt"/>
<result property="resvEndDt" column="resv_end_dt"/>
<result property="auctionStartDt" column="auction_start_dt"/>
<result property="auctionEndDt" column="auction_end_dt"/>
<result property="currencyType" column="currency_type"/>
<result property="startPrice" column="start_price"/>
<result property="closeEndDt" column="close_end_dt"/>
<result property="closePrice" column="close_price"/>
<result property="bidderGuid" column="bidder_guid"/>
<result property="bidderNickname" column="bidder_nickname"/>
<result property="createBy" column="create_by"/>
<result property="createDt" column="create_dt"/>
<result property="updateBy" column="update_by"/>
<result property="updateDt" column="update_dt"/>
</resultMap>
<resultMap id="MessageResultMap" type="com.caliverse.admin.domain.entity.Message">
<result property="title" column="title"/>
<result property="language" column="language"/>
<result property="content" column="content"/>
</resultMap>
<!--이벤트 리스트 조회-->
<select id="getLandAuctionList" resultMap="LandAuctionResultMap" parameterType="map">
SELECT *
FROM(
SELECT (@row_number:=@row_number + 1) AS row_num , c.* FROM
(
SELECT
a.id
, a.land_id
, a.land_name
, a.land_size
, a.land_socket
, a.auction_seq
, a.status
, a.resv_start_dt
, a.resv_end_dt
, a.auction_start_dt
, a.auction_end_dt
, a.currency_type
, a.start_price
, a.close_end_dt
, a.close_price
, a.bidder_guid
, a.bidder_nickname
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
FROM land_auction a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'LANDAUCTION'
AND
(
(b.language = 'KO' AND b.language IS NOT NULL) -- KO인 content
OR
(b.language &lt;&gt; 'KO' AND b.language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language IS NOT NULL
)
)
)
)
WHERE 1 = 1
<choose>
<when test="land_type == 'NAME' or land_type == 'name' ">
<if test="land_data != null and land_data != ''">
AND a.land_name LIKE CONCAT('%',#{land_data},'%')
</if>
</when>
<otherwise>
<if test="land_data != null and land_data != ''">
AND a.land_id = #{land_data}
</if>
</otherwise>
</choose>
<choose>
<when test="user_type == 'NAME' or user_type == 'name' ">
<if test="user_data != null and user_data != ''">
AND a.bidder_nickname LIKE CONCAT('%',#{user_data},'%')
</if>
</when>
<otherwise>
<if test="user_data != null and user_data != ''">
AND a.bidder_guid = #{user_data}
</if>
</otherwise>
</choose>
<if test="land_size != null and land_size != ''">
<choose>
<when test="land_size != 'ALL' ">
AND a.land_size = #{land_size}
</when>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.auction_start_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.auction_end_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
GROUP BY a.id
ORDER BY status
)c
, (SELECT @row_number:=0) AS t
) Z
ORDER BY
CASE WHEN Z.status = 'FAIL' OR Z.status = 'CANCEL' THEN 1 ELSE 0 END,
<if test="orderby != null and orderby != ''">
row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM land_auction
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM land_auction a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'LANDAUCTION'
AND
(
(b.language = 'KO' AND b.language IS NOT NULL) -- KO인 content
OR
(b.language &lt;&gt; 'KO' AND b.language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language IS NOT NULL
)
)
)
)
WHERE 1 = 1
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
b.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="title != null and title != ''">
AND b.title LIKE CONCAT('%',#{title},'%')
</if>
<if test="event_type != null and event_type != ''">
<choose>
<when test="event_type != 'ALL' ">
AND event_type = #{event_type}
</when>
</choose>
</if>
<if test="status != null and status != ''">
<choose>
<when test="status != 'ALL' ">
AND a.status = #{status}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.auction_start_dt &gt;= #{start_dt, jdbcType=TIMESTAMP}
AND a.auction_end_dt &lt;= #{end_dt, jdbcType=TIMESTAMP}
</if>
</select>
<select id="getMaxLandSeq" parameterType="integer" resultType="integer">
SELECT COALESCE(MAX(auction_seq), 0)
FROM land_auction
WHERE land_id = #{landId}
</select>
<select id="getPossibleLand" parameterType="integer" resultType="integer">
SELECT count(*)
FROM land_auction
WHERE land_id = #{landId}
AND status NOT IN ('AUCTION_END', 'DELETE', 'FAIL', 'CANCEL')
</select>
<!--이벤트 상세 조회-->
<select id="getLandAuctionDetail" parameterType="java.lang.Long" resultMap="LandAuctionResultMap" >
SELECT
a.id
, a.land_id
, a.land_name
, a.land_size
, a.land_socket
, a.auction_seq
, a.status
, a.resv_start_dt
, a.resv_end_dt
, a.auction_start_dt
, a.auction_end_dt
, a.currency_type
, a.start_price
, a.close_end_dt
, a.close_price
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
FROM land_auction a
WHERE a.id = #{id}
</select>
<select id="getMessage" parameterType="java.lang.Long" resultMap="MessageResultMap" >
SELECT
*
FROM message
WHERE target_id = #{id}
AND type = 'LANDAUCTION'
</select>
<!--랜드경매 저장-->
<insert id="postLandAuction" parameterType="com.caliverse.admin.domain.request.LandRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO land_auction (land_id, land_name, land_size, land_socket, auction_seq, resv_start_dt, resv_end_dt, auction_start_dt, auction_end_dt, currency_type, start_price, create_by, update_by)
VALUES (#{landId}, #{landName}, #{landSize}, #{landSocket}, #{auctionSeq}, #{resvStartDt}, #{resvEndDt}, #{auctionStartDt}, #{auctionEndDt}, #{currencyType}, #{startPrice}, #{createBy}, #{updateBy})
</insert>
<insert id="insertMessage" parameterType="map">
INSERT INTO message (target_id, type, content, language)
VALUES (#{id}, 'LANDAUCTION', #{content}, #{language})
</insert>
<!--랜드경매 수정-->
<update id="updateLandAuction" parameterType="com.caliverse.admin.domain.request.LandRequest">
UPDATE land_auction SET resv_start_dt = #{resvStartDt}
, resv_end_dt = #{resvEndDt}
, auction_start_dt = #{auctionStartDt}
, auction_end_dt = #{auctionEndDt}
, currency_type = #{currencyType}
, start_price = #{startPrice}
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<update id="deleteMessage" parameterType="map">
DELETE FROM message
WHERE target_id = #{id}
AND type = 'LANDAUCTION'
</update>
<update id="deleteLandAuction" parameterType="map">
UPDATE land_auction
SET deleted = 1
,status = 'CANCEL'
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<update id="updateStatusLandAuction" parameterType="map">
UPDATE land_auction
SET status = #{status}
<if test="bidderGuid != null and bidderGuid != ''">
, bidder_guid = #{bidderGuid}
, bidder_nickname = #{bidderNickname}
</if>
<if test="closeEndDt != null and closeEndDt != ''">
, close_end_dt = #{closeEndDt, jdbcType=TIMESTAMP}
</if>
<if test="closePrice != null and closePrice != ''">
, close_price = #{closePrice}
</if>
where id = #{id}
</update>
<select id="getScheduleLandAuctionList" resultMap="LandAuctionResultMap">
SELECT id
, land_id
, auction_seq
, status
, resv_start_dt
, resv_end_dt
, auction_start_dt
, auction_end_dt
, currency_type
, start_price
FROM land_auction
WHERE (status = 'WAIT' or status = 'AUCTION_START' or status = 'RESV_START')
AND deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,272 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.MailMapper">
<resultMap id="MailResultMap" type="com.caliverse.admin.domain.entity.Mail">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="target" column="target"/>
<result property="isReserve" column="is_reserve"/>
<result property="sendType" column="send_type"/>
<result property="sendStatus" column="send_status"/>
<result property="mailType" column="mail_type"/>
<result property="userType" column="user_type"/>
<result property="receiveType" column="receive_type"/>
<result property="sendDt" column="send_dt"/>
<result property="createBy" column="create_by"/>
<result property="createDt" column="create_dt"/>
<result property="updateBy" column="update_by"/>
<result property="updateDt" column="update_dt"/>
</resultMap>
<resultMap id="MessageResultMap" type="com.caliverse.admin.domain.entity.Message">
<result property="title" column="title"/>
<result property="language" column="language"/>
<result property="content" column="content"/>
</resultMap>
<!--우편 리스트 조회-->
<select id="getMailList" resultMap="MailResultMap" parameterType="com.caliverse.admin.domain.request.HistoryRequest">
SELECT (@row_number:=@row_number + 1) AS row_num , c.* FROM
(
SELECT
a.id
, a.is_reserve
, a.send_type
, a.send_status
, a.mail_type
, a.receive_type
, a.send_dt
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
, b.title
FROM mail a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'MAIL'
AND
(
(b.language = 'KO' AND b.language IS NOT NULL) -- KO인 content
OR
(b.language &lt;&gt; 'KO' AND b.language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language IS NOT NULL
)
)
)
)
WHERE 1 = 1
AND a.deleted = 0
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
b.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="mail_title != null and mail_title != ''">
AND b.title LIKE CONCAT('%',#{mail_title},'%')
</if>
<if test="send_type != null and send_type != ''">
<choose>
<when test="send_type != 'ALL' ">
AND send_type = #{send_type}
</when>
</choose>
</if>
<if test="send_status != null and send_status != ''">
<choose>
<when test="send_status != 'ALL' ">
AND a.send_status = #{send_status}
</when>
</choose>
</if>
<if test="mail_type != null and mail_type != ''">
<choose>
<when test="mail_type != 'ALL' ">
AND a.mail_type = #{mail_type}
</when>
</choose>
</if>
<if test="receive_type != null and receive_type != ''">
<choose>
<when test="receive_type != 'ALL' ">
AND a.receive_type = #{receive_type}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.create_dt BETWEEN #{start_dt, jdbcType=TIMESTAMP} and #{end_dt, jdbcType=TIMESTAMP}
</if>
GROUP BY a.id
ORDER BY a.create_dt
)c
, (SELECT @row_number:=0) AS t
<if test="orderby != null and orderby != ''">
ORDER BY row_num ${orderby}
</if>
<if test="pageSize != null and pageSize != ''">
LIMIT ${pageSize} OFFSET ${offset}
</if>
</select>
<select id="getTotal" resultType="java.lang.Integer" parameterType="map">
SELECT count(*) FROM mail WHERE deleted = 0
</select>
<select id="getAllCnt" resultType="java.lang.Integer" parameterType="com.caliverse.admin.domain.request.HistoryRequest">
SELECT count(*) FROM mail a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'MAIL'
AND
(
(b.language = 'KO' AND b.language IS NOT NULL) -- KO인 content
OR
(b.language &lt;&gt; 'KO' AND b.language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language IS NOT NULL
)
)
)
)
WHERE 1 = 1
AND a.deleted = 0
<if test="content != null and content != ''">
<foreach item="content" index="index" collection="content.split(' ')" open="AND (" separator="OR" close=")">
b.content LIKE CONCAT('%', #{content}, '%')
</foreach>
</if>
<if test="mail_title != null and mail_title != ''">
AND b.title LIKE CONCAT('%',#{mail_title},'%')
</if>
<if test="send_type != null and send_type != ''">
<choose>
<when test="send_type != 'ALL' ">
AND a.send_type = #{send_type}
</when>
</choose>
</if>
<if test="send_status != null and send_status != ''">
<choose>
<when test="send_status != 'ALL' ">
AND a.send_status = #{send_status}
</when>
</choose>
</if>
<if test="mail_type != null and mail_type != ''">
<choose>
<when test="mail_type != 'ALL' ">
AND a.mail_type = #{mail_type}
</when>
</choose>
</if>
<if test="receive_type != null and receive_type != ''">
<choose>
<when test="receive_type != 'ALL' ">
AND a.receive_type = #{receive_type}
</when>
</choose>
</if>
<if test="start_dt != null and start_dt != '' and end_dt !=null and end_dt!= ''">
AND a.create_dt BETWEEN #{start_dt, jdbcType=TIMESTAMP} and #{end_dt, jdbcType=TIMESTAMP}
</if>
</select>
<select id="getMailDetail" parameterType="java.lang.Long" resultMap="MailResultMap" >
SELECT
a.id
,a.target
, a.is_reserve
, a.send_type
, a.send_status
, a.mail_type
, a.receive_type
, a.user_type
, a.send_dt
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
, a.create_dt
, (SELECT email FROM admin WHERE id = a.update_by ) AS update_by
, a.update_dt
FROM mail a
WHERE a.id = #{id}
AND deleted = 0
</select>
<select id="getMessage" parameterType="java.lang.Long" resultMap="MessageResultMap" >
SELECT
*
FROM message
WHERE target_id = #{id}
AND type = 'MAIL'
</select>
<select id="getItem" parameterType="java.lang.Long" resultType="com.caliverse.admin.domain.entity.Item" >
SELECT
reward_group_id AS item
, item_cnt AS itemCnt
FROM item
WHERE mail_id = #{id}
</select>
<insert id="postMail" parameterType="com.caliverse.admin.domain.request.MailRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO mail (target,is_reserve, send_type, mail_type ,receive_type,send_dt, create_by, user_type)
VALUES (#{target},#{isReserve},#{sendType}, #{mailType}, #{receiveType},#{sendDt},#{createBy}, #{userType})
</insert>
<insert id="insertGuid" parameterType="map">
INSERT INTO guid (mail_id, guid)
VALUES (#{mailId}, #{guid})
</insert>
<insert id="insertMessage" parameterType="map">
INSERT INTO message (target_id, type,title, content, language)
VALUES (#{mailId}, 'MAIL',#{title}, #{content}, #{language})
</insert>
<insert id="insertItem" parameterType="map">
INSERT INTO item (mail_id,reward_group_id,item_cnt,type) VALUES (#{mailId} , #{goodsId}, #{itemCnt},'MAIL')
</insert>
<update id="updateMail" parameterType="com.caliverse.admin.domain.request.MailRequest">
UPDATE mail SET target = #{target}
, is_reserve = #{isReserve}
, receive_type = #{receiveType}
, send_type =#{sendType}
, mail_type = #{mailType}
, send_dt = #{sendDt}
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<update id="deleteMessage" parameterType="map">
DELETE FROM message
WHERE target_id = #{mailId}
</update>
<update id="deleteItem" parameterType="map">
DELETE FROM item
WHERE mail_id = #{mailId}
AND type = 'MAIL'
</update>
<update id="deleteMail" parameterType="map">
UPDATE mail SET deleted = 1
WHERE id = #{id}
</update>
<select id="getSchesuleMailList" resultMap="MailResultMap">
SELECT id,
receive_type,
is_reserve,
send_type,
send_status,
mail_type,
send_dt,
target,
user_type
FROM mail
WHERE send_status = 'WAIT'
AND deleted = false
</select>
<update id="updateCompleteMail" parameterType="map">
UPDATE mail SET send_status = #{status}
where id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,171 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.NoticeMapper">
<resultMap id="InGameResultMap" type="com.caliverse.admin.domain.entity.InGame">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="messageType" column="message_type"/>
<result property="sendDt" column="send_dt"/>
<result property="endDt" column="end_dt"/>
<result property="sendCnt" column="send_cnt"/>
<result property="isRepeat" column="is_repeat"/>
<result property="repeatType" column="repeat_type"/>
<result property="repeatDt" column="repeat_dt"/>
<result property="repeatCnt" column="repeat_cnt"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
<result property="createDt" column="create_dt"/>
<result property="updateBy" column="update_by"/>
<result property="updateName" column="update_name"/>
<result property="updateDt" column="update_dt"/>
<result property="content" column="content"/>
<result property="sendStatus" column="send_status"/>
</resultMap>
<!--인게임메시지 리스트 조회-->
<select id="getNoticeList" resultMap="InGameResultMap">
SELECT (@row_number:=@row_number + 1) AS row_num, d.*
FROM (SELECT a.id
, a.message_type
, a.send_dt
, a.end_dt
, a.send_cnt
, a.is_repeat
, a.repeat_type
, a.repeat_dt
, a.repeat_cnt
, a.create_dt
, a.update_dt
, a.send_status
,(SELECT email FROM admin WHERE a.create_by = id) AS create_by
,(SELECT email FROM admin WHERE a.update_by = id) AS update_by
,(SELECT name FROM admin WHERE a.create_by = id) AS create_name
,(SELECT name FROM admin WHERE a.update_by = id) AS update_name
, IFNULL(b.content, '') AS content
FROM notice a
LEFT JOIN message b ON (a.id = b.target_id
AND b.type = 'NOTICE'
AND (
(language = 'KO' AND language IS NOT NULL) -- KO인 content
OR
(language &lt;&gt; 'KO' AND language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = a.id AND m2.language = 'KO' AND m2.language IS NOT NULL
)
)
)
)
LEFT JOIN admin c ON(a.create_by = c.email)
WHERE 1 = 1
AND a.deleted = 0
GROUP BY a.id) d
, (SELECT @row_number:=0) AS t
</select>
<select id="getNoticeDetail" parameterType="java.lang.Long" resultMap="InGameResultMap" >
SELECT
a.id
, a.message_type
, a.send_dt
, a.end_dt
, a.send_cnt
, a.is_repeat
, a.repeat_type
, a.repeat_dt
, a.repeat_cnt
, a.create_dt
, a.update_dt
,(SELECT email FROM admin WHERE a.create_by = id) AS create_by
,(SELECT email FROM admin WHERE a.update_by = id) AS update_by
,(SELECT name FROM admin WHERE a.create_by = id) AS create_name
,(SELECT name FROM admin WHERE a.update_by = id) AS update_name
FROM notice a
WHERE a.id = #{id}
AND a.deleted = 0
</select>
<select id="getMessage" parameterType="java.lang.Long" resultType="com.caliverse.admin.domain.entity.Message" >
SELECT
*
FROM message
WHERE target_id = #{id}
AND type = 'NOTICE'
</select>
<insert id="postNotice" parameterType="com.caliverse.admin.domain.request.NoticeRequest" useGeneratedKeys="true" keyProperty="id">
INSERT INTO notice (message_type, send_dt, is_repeat, repeat_dt, repeat_cnt, create_by, end_dt, repeat_type)
VALUES (#{messageType}, #{sendDt}, #{isRepeat}, #{repeatDt}, #{repeatCnt},#{createBy}, #{endDt}, #{repeatType})
</insert>
<insert id="insertMessage" parameterType="map">
INSERT INTO message (target_id, type, content, language)
VALUES (#{id}, 'NOTICE', #{content}, #{language})
</insert>
<update id="updateNotice" parameterType="com.caliverse.admin.domain.request.NoticeRequest">
UPDATE notice SET message_type = #{messageType}
, send_dt = #{sendDt}
, end_dt = #{endDt}
, is_repeat = #{isRepeat}
, repeat_type = #{repeatType}
, repeat_dt = #{repeatDt}
, repeat_cnt = #{repeatCnt}
, update_by = #{updateBy}
, update_dt = NOW()
WHERE id = #{id}
</update>
<update id="deleteMessage" parameterType="java.lang.Long">
DELETE FROM message
WHERE target_id = #{id}
AND type = 'NOTICE'
</update>
<update id="deleteNotice" parameterType="java.lang.Long">
UPDATE notice SET deleted = 1
WHERE id = #{id}
</update>
<select id="getMessageById" parameterType="java.lang.Long" resultType="java.lang.String">
SELECT content
FROM message
WHERE target_id = #{id}
AND TYPE = 'NOTICE'
AND (
(language = 'KO' AND language IS NOT NULL) -- KO인 content
OR
(language &lt;&gt; 'KO' AND language IS NOT NULL AND NOT EXISTS (
SELECT 1 FROM message m2
WHERE m2.target_id = #{id} AND m2.language = 'KO' AND m2.language IS NOT NULL
))
)
</select>
<select id="getSchesuleNoticeList" resultMap="InGameResultMap">
select id,
message_type,
send_dt,
is_repeat,
repeat_dt,
repeat_cnt,
send_cnt,
deleted,
end_dt,
repeat_type
from notice
where send_status in ('WAIT', 'RUNNING')
and deleted = false
</select>
<update id="updateStatusNotice" parameterType="map">
UPDATE notice SET send_status = #{status}
where id = #{id}
</update>
<update id="updateCountNotice" parameterType="java.lang.Long">
UPDATE notice SET send_cnt = send_cnt + 1
where id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,36 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.TokenMapper">
<select id="findAllValidTokenByUser" resultType="com.caliverse.admin.domain.entity.Token" parameterType="java.lang.Long">
SELECT * FROM token WHERE admin_id = #{id} AND expired = false
</select>
<select id="findByToken" resultType="com.caliverse.admin.domain.entity.Token" parameterType="java.lang.String">
SELECT * FROM token WHERE token = #{token}
</select>
<insert id="save" parameterType="com.caliverse.admin.domain.entity.Token">
INSERT INTO token (token, token_type, revoked, expired, admin_id)
VALUES (#{token}, #{tokenType}, #{revoked}, #{expired}, #{adminId})
</insert>
<update id="updateToken" parameterType="com.caliverse.admin.domain.entity.Token">
update token set revoked = #{revoked}, expired = #{expired} where id = #{id}
</update>
<select id="getCount" resultType="java.lang.Integer" parameterType="java.lang.Long">
SELECT count(*) FROM token WHERE admin_id = #{id} AND expired = false
</select>
<update id="updateResetToken" parameterType="java.lang.Long">
UPDATE token
SET expired = true,
revoked = true
WHERE admin_id = #{id}
AND expired = false
AND id &lt; (SELECT MAX(id) FROM token WHERE admin_id = #{id})
</update>
</mapper>

View File

@@ -0,0 +1,28 @@
<!-- AdminMapper.xml -->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.total.WalletUserMapper">
<!-- resultMap 설정 -->
<resultMap id="UserResultMap" type="com.caliverse.admin.domain.entity.WalletUser">
<id property="account_id" column="id"/>
<result property="guid" column="guid"/>
<result property="email" column="email"/>
<result property="region" column="region"/>
<result property="phone" column="phone"/>
<result property="level" column="level"/>
</resultMap>
<select id="getUser" resultMap="UserResultMap" parameterType="java.lang.String">
SELECT id,
guid,
email,
region,
phone,
level
FROM wallet_user
WHERE email = #{email}
</select>
</mapper>

View File

@@ -0,0 +1,59 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.caliverse.admin.domain.dao.admin.WhiteListMapper">
<resultMap id="WhiteListResultMap" type="com.caliverse.admin.domain.entity.WhiteList">
<id property="id" column="id"/>
<result property="rowNum" column="row_num"/>
<result property="guid" column="guid"/>
<result property="nickname" column="nickname"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
</resultMap>
<!--사용 이력 리스트 조회-->
<select id="getWhiteList" parameterType="map" resultMap="WhiteListResultMap">
SELECT
(@row_number:=@row_number + 1) AS row_num
, a.id
, a.guid
, a.nickname
, a.status
, (SELECT email FROM admin WHERE id = a.create_by ) AS create_by
FROM white_list a
, (SELECT @row_number:=0) AS t
WHERE 1 = 1
AND a.deleted = 0
ORDER BY a.create_dt desc
</select>
<select id="getCountByGuid" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
Count(*)
FROM white_list
WHERE guid = #{guid}
AND status = 'PERMITTED'
AND deleted = 0
</select>
<select id="getGuidById" parameterType="java.lang.Long" resultType="map">
SELECT
guid, nickname
FROM white_list
WHERE id = #{id}
</select>
<insert id="postWhiteList" parameterType="com.caliverse.admin.domain.request.WhiteListRequest">
INSERT INTO white_list (guid,nickname, status, create_by)
VALUES (#{guid},#{nickname}, #{status},#{createBy})
</insert>
<update id="updateStatus" parameterType="java.lang.Long">
UPDATE white_list SET status = 'PERMITTED' , update_dt = NOW()
WHERE id = #{id}
</update>
<update id="deleteWhiteList" parameterType="java.lang.Long">
UPDATE white_list SET deleted = 1
WHERE id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,98 @@
-- Autogenerated: do not edit this file
CREATE TABLE BATCH_JOB_INSTANCE (
JOB_INSTANCE_ID BIGINT NOT NULL PRIMARY KEY ,
VERSION BIGINT ,
JOB_NAME VARCHAR(100) NOT NULL,
JOB_KEY VARCHAR(32) NOT NULL,
constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
) ENGINE=InnoDB;
CREATE TABLE BATCH_JOB_EXECUTION (
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY ,
VERSION BIGINT ,
JOB_INSTANCE_ID BIGINT NOT NULL,
CREATE_TIME DATETIME(6) NOT NULL,
START_TIME DATETIME(6) DEFAULT NULL ,
END_TIME DATETIME(6) DEFAULT NULL ,
STATUS VARCHAR(10) ,
EXIT_CODE VARCHAR(2500) ,
EXIT_MESSAGE VARCHAR(2500) ,
LAST_UPDATED DATETIME(6),
constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID)
references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID)
) ENGINE=InnoDB;
CREATE TABLE BATCH_JOB_EXECUTION_PARAMS (
JOB_EXECUTION_ID BIGINT NOT NULL ,
PARAMETER_NAME VARCHAR(100) NOT NULL ,
PARAMETER_TYPE VARCHAR(100) NOT NULL ,
PARAMETER_VALUE VARCHAR(2500) ,
IDENTIFYING CHAR(1) NOT NULL ,
constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID)
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;
CREATE TABLE BATCH_STEP_EXECUTION (
STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY ,
VERSION BIGINT NOT NULL,
STEP_NAME VARCHAR(100) NOT NULL,
JOB_EXECUTION_ID BIGINT NOT NULL,
CREATE_TIME DATETIME(6) NOT NULL,
START_TIME DATETIME(6) DEFAULT NULL ,
END_TIME DATETIME(6) DEFAULT NULL ,
STATUS VARCHAR(10) ,
COMMIT_COUNT BIGINT ,
READ_COUNT BIGINT ,
FILTER_COUNT BIGINT ,
WRITE_COUNT BIGINT ,
READ_SKIP_COUNT BIGINT ,
WRITE_SKIP_COUNT BIGINT ,
PROCESS_SKIP_COUNT BIGINT ,
ROLLBACK_COUNT BIGINT ,
EXIT_CODE VARCHAR(2500) ,
EXIT_MESSAGE VARCHAR(2500) ,
LAST_UPDATED DATETIME(6),
constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID)
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;
CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT (
STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
SHORT_CONTEXT VARCHAR(2500) NOT NULL,
SERIALIZED_CONTEXT TEXT ,
constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID)
references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID)
) ENGINE=InnoDB;
CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT (
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
SHORT_CONTEXT VARCHAR(2500) NOT NULL,
SERIALIZED_CONTEXT TEXT ,
constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID)
references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID)
) ENGINE=InnoDB;
CREATE TABLE BATCH_STEP_EXECUTION_SEQ (
ID BIGINT NOT NULL,
UNIQUE_KEY CHAR(1) NOT NULL,
constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;
INSERT INTO BATCH_STEP_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_STEP_EXECUTION_SEQ);
CREATE TABLE BATCH_JOB_EXECUTION_SEQ (
ID BIGINT NOT NULL,
UNIQUE_KEY CHAR(1) NOT NULL,
constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;
INSERT INTO BATCH_JOB_EXECUTION_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_EXECUTION_SEQ);
CREATE TABLE BATCH_JOB_SEQ (
ID BIGINT NOT NULL,
UNIQUE_KEY CHAR(1) NOT NULL,
constraint UNIQUE_KEY_UN unique (UNIQUE_KEY)
) ENGINE=InnoDB;
INSERT INTO BATCH_JOB_SEQ (ID, UNIQUE_KEY) select * from (select 0 as ID, '0' as UNIQUE_KEY) as tmp where not exists(select * from BATCH_JOB_SEQ);