Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tron-explore
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张建华@五瓣科技
tron-explore
Commits
25af91cc
Commit
25af91cc
authored
Nov 11, 2020
by
jianhua.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
波场浏览器JAVA版
parents
Changes
94
Show whitespace changes
Inline
Side-by-side
Showing
94 changed files
with
9700 additions
and
0 deletions
+9700
-0
wallet-cli.jar
libs/wallet-cli.jar
+0
-0
Bootstrapper.java
src/main/java/com/wuban/tron/explore/Bootstrapper.java
+87
-0
ExploreApplication.java
src/main/java/com/wuban/tron/explore/ExploreApplication.java
+13
-0
Constant.java
src/main/java/com/wuban/tron/explore/constant/Constant.java
+57
-0
HomeSearchTypeEnum.java
...a/com/wuban/tron/explore/constant/HomeSearchTypeEnum.java
+17
-0
PageConstant.java
...in/java/com/wuban/tron/explore/constant/PageConstant.java
+20
-0
CensusController.java
...a/com/wuban/tron/explore/controller/CensusController.java
+28
-0
TransactionController.java
.../wuban/tron/explore/controller/TransactionController.java
+270
-0
AddressRepository.java
...in/java/com/wuban/tron/explore/dao/AddressRepository.java
+37
-0
BlockDayCensusRepository.java
.../com/wuban/tron/explore/dao/BlockDayCensusRepository.java
+41
-0
BlockHeaderRepository.java
...ava/com/wuban/tron/explore/dao/BlockHeaderRepository.java
+37
-0
LastBlockRepository.java
.../java/com/wuban/tron/explore/dao/LastBlockRepository.java
+20
-0
TransactionHexRepository.java
.../com/wuban/tron/explore/dao/TransactionHexRepository.java
+16
-0
TransactionRepository.java
...ava/com/wuban/tron/explore/dao/TransactionRepository.java
+44
-0
DataSourceConfigEX.java
...com/wuban/tron/explore/dao/config/DataSourceConfigEX.java
+66
-0
ActivePermission.java
.../java/com/wuban/tron/explore/domain/ActivePermission.java
+17
-0
BlockHeaderRawData.java
...ava/com/wuban/tron/explore/domain/BlockHeaderRawData.java
+21
-0
Contract.java
src/main/java/com/wuban/tron/explore/domain/Contract.java
+11
-0
ContractParameter.java
...java/com/wuban/tron/explore/domain/ContractParameter.java
+11
-0
ContractParameterValue.java
...com/wuban/tron/explore/domain/ContractParameterValue.java
+16
-0
Keys.java
src/main/java/com/wuban/tron/explore/domain/Keys.java
+9
-0
OwnerPermission.java
...n/java/com/wuban/tron/explore/domain/OwnerPermission.java
+14
-0
Transactions.java
...main/java/com/wuban/tron/explore/domain/Transactions.java
+22
-0
TransactionsRawData.java
...va/com/wuban/tron/explore/domain/TransactionsRawData.java
+17
-0
TransactionsRet.java
...n/java/com/wuban/tron/explore/domain/TransactionsRet.java
+10
-0
TronAccount.java
src/main/java/com/wuban/tron/explore/domain/TronAccount.java
+16
-0
TronBlockHeader.java
...n/java/com/wuban/tron/explore/domain/TronBlockHeader.java
+11
-0
TronResponseArrayData.java
.../com/wuban/tron/explore/domain/TronResponseArrayData.java
+18
-0
TronResponseData.java
.../java/com/wuban/tron/explore/domain/TronResponseData.java
+20
-0
Address.java
src/main/java/com/wuban/tron/explore/entity/Address.java
+38
-0
BlockDayCensus.java
...in/java/com/wuban/tron/explore/entity/BlockDayCensus.java
+67
-0
BlockHeader.java
src/main/java/com/wuban/tron/explore/entity/BlockHeader.java
+89
-0
LastBlock.java
src/main/java/com/wuban/tron/explore/entity/LastBlock.java
+32
-0
Transaction.java
src/main/java/com/wuban/tron/explore/entity/Transaction.java
+116
-0
TransactionHex.java
...in/java/com/wuban/tron/explore/entity/TransactionHex.java
+58
-0
AddressExample.java
...com/wuban/tron/explore/entity/example/AddressExample.java
+386
-0
BlockDayCensusExample.java
...an/tron/explore/entity/example/BlockDayCensusExample.java
+626
-0
BlockHeaderExample.java
...wuban/tron/explore/entity/example/BlockHeaderExample.java
+886
-0
LastBlockExample.java
...m/wuban/tron/explore/entity/example/LastBlockExample.java
+456
-0
TransactionExample.java
...wuban/tron/explore/entity/example/TransactionExample.java
+1246
-0
TransactionHexExample.java
...an/tron/explore/entity/example/TransactionHexExample.java
+596
-0
AccountBalanceTask.java
...java/com/wuban/tron/explore/fetch/AccountBalanceTask.java
+102
-0
BlockDataFetcher.java
...n/java/com/wuban/tron/explore/fetch/BlockDataFetcher.java
+90
-0
BlockDataHandler.java
...n/java/com/wuban/tron/explore/fetch/BlockDataHandler.java
+58
-0
Engine.java
src/main/java/com/wuban/tron/explore/fetch/Engine.java
+73
-0
Executor.java
src/main/java/com/wuban/tron/explore/fetch/Executor.java
+76
-0
IBlockDataFetcher.java
.../java/com/wuban/tron/explore/fetch/IBlockDataFetcher.java
+17
-0
IBlockDataHandler.java
.../java/com/wuban/tron/explore/fetch/IBlockDataHandler.java
+28
-0
Job.java
src/main/java/com/wuban/tron/explore/fetch/Job.java
+42
-0
PersistThreadPool.java
.../java/com/wuban/tron/explore/fetch/PersistThreadPool.java
+78
-0
CensusRequest.java
...a/com/wuban/tron/explore/param/request/CensusRequest.java
+15
-0
PageRequest.java
...ava/com/wuban/tron/explore/param/request/PageRequest.java
+11
-0
SearchRequest.java
...a/com/wuban/tron/explore/param/request/SearchRequest.java
+11
-0
SelfPageInfo.java
...a/com/wuban/tron/explore/param/response/SelfPageInfo.java
+28
-0
TransactionModel.java
...m/wuban/tron/explore/param/response/TransactionModel.java
+14
-0
AddressService.java
...n/java/com/wuban/tron/explore/service/AddressService.java
+33
-0
BaseCommonService.java
...ava/com/wuban/tron/explore/service/BaseCommonService.java
+86
-0
BlockDayCensusService.java
...com/wuban/tron/explore/service/BlockDayCensusService.java
+25
-0
BlockHeaderService.java
...va/com/wuban/tron/explore/service/BlockHeaderService.java
+17
-0
LastBlockService.java
...java/com/wuban/tron/explore/service/LastBlockService.java
+47
-0
TransactionService.java
...va/com/wuban/tron/explore/service/TransactionService.java
+79
-0
TronService.java
...main/java/com/wuban/tron/explore/service/TronService.java
+37
-0
AddressServiceImpl.java
...m/wuban/tron/explore/service/impl/AddressServiceImpl.java
+40
-0
BlockDayCensusServiceImpl.java
.../tron/explore/service/impl/BlockDayCensusServiceImpl.java
+58
-0
BlockHeaderServiceImpl.java
...ban/tron/explore/service/impl/BlockHeaderServiceImpl.java
+29
-0
LastBlockServiceImpl.java
...wuban/tron/explore/service/impl/LastBlockServiceImpl.java
+146
-0
TransactionServiceImpl.java
...ban/tron/explore/service/impl/TransactionServiceImpl.java
+353
-0
TronServiceImpl.java
.../com/wuban/tron/explore/service/impl/TronServiceImpl.java
+73
-0
ApiResponse.java
src/main/java/com/wuban/tron/explore/util/ApiResponse.java
+70
-0
BigDecimalUtil.java
...main/java/com/wuban/tron/explore/util/BigDecimalUtil.java
+36
-0
DateUtil.java
src/main/java/com/wuban/tron/explore/util/DateUtil.java
+290
-0
ErrorResponseData.java
...n/java/com/wuban/tron/explore/util/ErrorResponseData.java
+22
-0
ResponseKit.java
src/main/java/com/wuban/tron/explore/util/ResponseKit.java
+32
-0
SpringContextUtil.java
...n/java/com/wuban/tron/explore/util/SpringContextUtil.java
+39
-0
SuccessResponseData.java
...java/com/wuban/tron/explore/util/SuccessResponseData.java
+25
-0
ThreadPoolUtil.java
...main/java/com/wuban/tron/explore/util/ThreadPoolUtil.java
+48
-0
application.yml
src/main/resources/application.yml
+47
-0
log-tron.xml
src/main/resources/log-tron.xml
+70
-0
AddressMapper.xml
src/main/resources/mapper/AddressMapper.xml
+196
-0
BlockDayCensusMapper.xml
src/main/resources/mapper/BlockDayCensusMapper.xml
+246
-0
BlockHeaderMapper.xml
src/main/resources/mapper/BlockHeaderMapper.xml
+269
-0
LastBlockMapper.xml
src/main/resources/mapper/LastBlockMapper.xml
+223
-0
TransactionHexMapper.xml
src/main/resources/mapper/TransactionHexMapper.xml
+229
-0
TransactionMapper.xml
src/main/resources/mapper/TransactionMapper.xml
+308
-0
mybatis-config.xml
src/main/resources/mybatis/mybatis-config.xml
+17
-0
BaseTest.java
src/test/java/com/wuban/tron/explore/BaseTest.java
+11
-0
ExploreApplicationTests.java
.../java/com/wuban/tron/explore/ExploreApplicationTests.java
+13
-0
AddressRepositoryTest.java
...ava/com/wuban/tron/explore/dao/AddressRepositoryTest.java
+36
-0
BlockHeaderRepositoryTest.java
...com/wuban/tron/explore/dao/BlockHeaderRepositoryTest.java
+73
-0
TransactionRepositoryTest.java
...com/wuban/tron/explore/dao/TransactionRepositoryTest.java
+41
-0
BlockDayCensusServiceImplTest.java
...n/explore/service/impl/BlockDayCensusServiceImplTest.java
+24
-0
LastBlockServiceImplTest.java
...n/tron/explore/service/impl/LastBlockServiceImplTest.java
+33
-0
TransactionServiceImplTest.java
...tron/explore/service/impl/TransactionServiceImplTest.java
+35
-0
TronServiceImplTest.java
.../wuban/tron/explore/service/impl/TronServiceImplTest.java
+39
-0
No files found.
libs/wallet-cli.jar
0 → 100644
View file @
25af91cc
File added
src/main/java/com/wuban/tron/explore/Bootstrapper.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
;
import
com.wuban.tron.explore.fetch.Engine
;
import
com.wuban.tron.explore.service.LastBlockService
;
import
com.wuban.tron.explore.service.TransactionService
;
import
com.wuban.tron.explore.util.DateUtil
;
import
com.wuban.tron.explore.util.SpringContextUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.Date
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* <core>区块服务引导项</core>
*
* @author sky
* @date 2020/11/04
*/
@Slf4j
//@Component
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
Bootstrapper
{
private
final
SpringContextUtil
springContextUtil
;
private
final
LastBlockService
lastBlockService
;
private
final
TransactionService
transactionService
;
/**
* 定时任务 - 业务线程池
*/
private
ScheduledThreadPoolExecutor
executorService
;
private
void
init
()
{
this
.
executorService
=
new
ScheduledThreadPoolExecutor
(
3
,
new
ThreadFactory
()
{
private
final
AtomicInteger
threadNumber
=
new
AtomicInteger
(
1
);
@Override
public
Thread
newThread
(
final
Runnable
r
)
{
final
Thread
t
=
new
Thread
(
r
,
"schedule-business"
+
this
.
threadNumber
.
getAndIncrement
());
if
(
t
.
isDaemon
())
{
t
.
setDaemon
(
false
);
}
if
(
t
.
getPriority
()
!=
Thread
.
NORM_PRIORITY
)
{
t
.
setPriority
(
Thread
.
NORM_PRIORITY
);
}
return
t
;
}
});
}
@PostConstruct
public
synchronized
void
start
()
{
this
.
init
();
this
.
startEngine
();
this
.
executorService
.
scheduleWithFixedDelay
(()
->
this
.
lastBlockService
.
sync
(),
0
,
30
,
TimeUnit
.
MINUTES
);
this
.
executorService
.
scheduleWithFixedDelay
(()
->
this
.
lastBlockService
.
refresh
(),
1
,
1
,
TimeUnit
.
MINUTES
);
this
.
executorService
.
scheduleWithFixedDelay
(()
->
this
.
transactionService
.
censusBlockByLastDay
(),
getInitialDelay
(),
24
*
60
*
60
,
TimeUnit
.
SECONDS
);
}
private
long
getInitialDelay
()
{
Date
nextDate
=
DateUtil
.
addDays
(
new
Date
(),
1
);
String
date
=
DateUtil
.
getFormatDate
(
nextDate
,
DateUtil
.
PATTERN_YMD
)
+
" 00:00:03"
;
long
millis
=
(
DateUtil
.
getDateFromDateStr
(
date
)
-
System
.
currentTimeMillis
())/
1000
;
return
millis
;
}
private
synchronized
void
startEngine
()
{
/*try {
TimeUnit.SECONDS.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}*/
Engine
engine
=
new
Engine
(
"tron"
);
engine
.
start
();
}
}
src/main/java/com/wuban/tron/explore/ExploreApplication.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
ExploreApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ExploreApplication
.
class
,
args
);
}
}
src/main/java/com/wuban/tron/explore/constant/Constant.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
constant
;
import
okhttp3.MediaType
;
/**
* <core>常量定义类</core>
*
* @author sky
* @date 2020/11/02
*/
public
class
Constant
{
/**
* 结果码:
*/
public
static
final
int
SUCCESS_CODE
=
200
;
/**
* 波场API地址
*/
public
static
final
String
HOST
=
"https://api.shasta.trongrid.io"
;
/**
* 请求数据类型:JSON
*/
public
static
final
MediaType
JSON_TYPE
=
MediaType
.
parse
(
"application/json"
);
public
static
final
String
CONTENT_TYPE_KEY
=
"Content-Type"
;
public
static
final
String
CONTENT_TYPE_VAL
=
"application/json"
;
public
static
final
String
OS_NMAE
=
"WINDOWS"
;
public
static
final
long
FIFTY_THOUSAND
=
50000
;
public
static
final
String
BLOCK_NUM_KEY
=
"block_num"
;
public
static
final
String
BLOCK_NUM_LIST_KEY
=
"block_num_list"
;
/**
* 数据同步阀值
*/
public
static
final
long
THRESHOLD
=
30000
;
/**
* 用户地址长度
*/
public
static
final
int
USER_ADDRESS_LEN
=
42
;
/**
* txID长度
*/
public
static
final
int
TX_ID_LEN
=
64
;
public
static
final
String
EXCUTOR_NAME_ACCOUNT
=
"tron.account"
;
public
static
final
String
EXCUTOR_NAME_BLOCK
=
"tron.block"
;
}
src/main/java/com/wuban/tron/explore/constant/HomeSearchTypeEnum.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
constant
;
public
enum
HomeSearchTypeEnum
{
ADDRESS_INFO
(
0
,
"地址详情"
),
TRANSACTION_INFO
(
1
,
"交易详情"
),
BLOCK_INFO
(
2
,
"区块详情"
);
private
int
code
;
private
String
desc
;
HomeSearchTypeEnum
(
int
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
}
src/main/java/com/wuban/tron/explore/constant/PageConstant.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
constant
;
public
class
PageConstant
{
/**
* 页码默认值:1
*/
public
static
final
int
DEFAULT_START_INDEX
=
1
;
/**
* 每页记录数:10
*/
public
static
final
int
DEFAULT_PAGE_SIZE
=
10
;
/**
* 每页记录数最大值:10
*/
public
static
final
int
MAX_PAGE_SIZE
=
100
;
}
src/main/java/com/wuban/tron/explore/controller/CensusController.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
controller
;
import
com.wuban.tron.explore.param.request.CensusRequest
;
import
com.wuban.tron.explore.service.TransactionService
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.Valid
;
@Slf4j
@RestController
@RequestMapping
(
"/census"
)
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
CensusController
{
private
final
TransactionService
transactionService
;
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
void
census
(
@RequestBody
@Valid
CensusRequest
reqParam
)
{
new
Thread
(()->
this
.
transactionService
.
censusBlockByDate
(
reqParam
.
getStartDate
(),
reqParam
.
getEndDate
())).
start
();
}
}
src/main/java/com/wuban/tron/explore/controller/TransactionController.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.constant.Constant
;
import
com.wuban.tron.explore.entity.Address
;
import
com.wuban.tron.explore.entity.BlockDayCensus
;
import
com.wuban.tron.explore.entity.BlockHeader
;
import
com.wuban.tron.explore.entity.Transaction
;
import
com.wuban.tron.explore.entity.example.AddressExample
;
import
com.wuban.tron.explore.entity.example.BlockDayCensusExample
;
import
com.wuban.tron.explore.entity.example.BlockHeaderExample
;
import
com.wuban.tron.explore.entity.example.TransactionExample
;
import
com.wuban.tron.explore.param.request.PageRequest
;
import
com.wuban.tron.explore.param.request.SearchRequest
;
import
com.wuban.tron.explore.param.response.SelfPageInfo
;
import
com.wuban.tron.explore.param.response.TransactionModel
;
import
com.wuban.tron.explore.service.AddressService
;
import
com.wuban.tron.explore.service.BlockDayCensusService
;
import
com.wuban.tron.explore.service.BlockHeaderService
;
import
com.wuban.tron.explore.service.TransactionService
;
import
com.wuban.tron.explore.util.ApiResponse
;
import
com.wuban.tron.explore.util.ResponseKit
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
@Slf4j
@RestController
@RequestMapping
(
"/api/"
)
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
TransactionController
{
private
final
TransactionService
transactionService
;
private
final
BlockDayCensusService
blockDayCensusService
;
private
final
BlockHeaderService
blockHeaderService
;
private
final
AddressService
addressService
;
/**
* 首页 - 搜索
*
* @param reqParam
* @return
*/
@RequestMapping
(
value
=
"index/search"
,
method
=
RequestMethod
.
POST
)
public
ApiResponse
search
(
@RequestBody
SearchRequest
reqParam
)
{
if
(
StringUtils
.
isEmpty
(
reqParam
.
getCondition
()))
{
return
ResponseKit
.
success
();
}
TransactionExample
example
=
new
TransactionExample
();
String
condition
=
StringUtils
.
trimAllWhitespace
(
reqParam
.
getCondition
());
/*
块查询
*/
if
(
isNumeric
(
condition
))
{
BlockHeaderExample
headerExample
=
new
BlockHeaderExample
();
headerExample
.
createCriteria
().
andNumberEqualTo
(
Long
.
valueOf
(
condition
));
BlockHeader
blockHeader
=
this
.
blockHeaderService
.
getOneByExample
(
headerExample
);
example
.
createCriteria
().
andNumberEqualTo
(
Long
.
valueOf
(
condition
));
PageInfo
<
Transaction
>
pageInfo
=
this
.
transactionService
.
getByPageWithCategory
(
reqParam
.
getStartIndex
(),
reqParam
.
getPageSize
(),
example
);
HomeSearchModel
model
=
new
HomeSearchModel
();
model
.
setBlock
(
blockHeader
);
List
<
TransactionModel
>
txList
=
this
.
transfer
(
pageInfo
);
model
.
setTransList
(
txList
);
return
ResponseKit
.
success
(
model
);
}
/*
账户地址
*/
if
(
condition
.
length
()
==
Constant
.
USER_ADDRESS_LEN
)
{
HomeSearchModel
model
=
new
HomeSearchModel
();
AddressExample
addressExample
=
new
AddressExample
();
addressExample
.
createCriteria
().
andAddressEqualTo
(
reqParam
.
getCondition
());
Address
address
=
this
.
addressService
.
selectOneByExample
(
addressExample
);
PageInfo
<
Transaction
>
pageInfo
=
this
.
transactionService
.
selectListByAddress
(
reqParam
.
getCondition
(),
1
,
reqParam
.
getStartIndex
(),
reqParam
.
getPageSize
());
List
<
TransactionModel
>
txList
=
this
.
transfer
(
pageInfo
);
model
.
setTransList
(
txList
);
model
.
setAddress
(
address
);
return
ResponseKit
.
success
(
model
);
}
/*
交易hash
*/
if
(
condition
.
length
()==
Constant
.
TX_ID_LEN
)
{
example
.
createCriteria
().
andTxIdEqualTo
(
condition
);
List
<
Transaction
>
txList
=
this
.
transactionService
.
getByExample
(
example
);
if
(!
CollectionUtils
.
isEmpty
(
txList
))
{
return
ResponseKit
.
success
(
txList
.
get
(
0
));
}
}
return
ResponseKit
.
success
();
}
/**
* 首页 - Latest Blocks
*
* @param reqParam
* @return
*/
@RequestMapping
(
value
=
"index/block"
,
method
=
RequestMethod
.
POST
)
public
ApiResponse
lastBlockList
(
@RequestBody
PageRequest
reqParam
)
{
PageInfo
<
BlockDayCensus
>
pageInfo
=
this
.
blockDayCensusService
.
getByPageWithCategory
(
reqParam
.
getStartIndex
(),
reqParam
.
getPageSize
(),
new
BlockDayCensusExample
());
SelfPageInfo
<
BlockDayCensus
>
selfPageInfo
=
new
SelfPageInfo
<>();
selfPageInfo
.
setTotalPages
(
pageInfo
.
getPages
());
selfPageInfo
.
setTotalItems
(
pageInfo
.
getTotal
());
if
(
pageInfo
.
getList
()
!=
null
)
{
selfPageInfo
.
setList
(
pageInfo
.
getList
());
}
return
ResponseKit
.
success
(
selfPageInfo
);
}
/**
* 首页 - Latest Transactions
*
* @param reqParam
* @return
*/
@RequestMapping
(
value
=
"index/trans"
,
method
=
RequestMethod
.
POST
)
public
ApiResponse
lastTransList
(
@RequestBody
PageRequest
reqParam
)
{
PageInfo
<
Transaction
>
pageInfo
=
this
.
transactionService
.
getByPageWithCategory
(
reqParam
.
getStartIndex
(),
reqParam
.
getPageSize
(),
new
TransactionExample
());
SelfPageInfo
<
TransactionModel
>
selfPageInfo
=
new
SelfPageInfo
<>();
selfPageInfo
.
setTotalPages
(
pageInfo
.
getPages
());
selfPageInfo
.
setTotalItems
(
pageInfo
.
getTotal
());
if
(
pageInfo
.
getList
()
!=
null
)
{
List
<
TransactionModel
>
modelList
=
new
ArrayList
<>();
pageInfo
.
getList
().
forEach
(
o
->{
TransactionModel
model
=
new
TransactionModel
();
model
.
setFrom
(
o
.
getOwnerAddress
());
model
.
setNumber
(
o
.
getNumber
());
model
.
setTxId
(
o
.
getTxId
());
if
(!
StringUtils
.
isEmpty
(
o
.
getContractAddress
()))
{
model
.
setTo
(
o
.
getContractAddress
());
}
if
(!
StringUtils
.
isEmpty
(
o
.
getToAddress
()))
{
model
.
setTo
(
o
.
getToAddress
());
}
if
(
o
.
getAmount
()
==
null
)
{
model
.
setAmount
(
0L
);
}
modelList
.
add
(
model
);
});
selfPageInfo
.
setList
(
modelList
);
}
return
ResponseKit
.
success
(
selfPageInfo
);
}
/**
* 首页 - TRANSACTION HISTORY IN 14 DAYS
*
* @param reqParam
* @return
*/
@RequestMapping
(
value
=
"index/trans/census"
,
method
=
RequestMethod
.
POST
)
public
ApiResponse
transCensusLast
(
@RequestBody
PageRequest
reqParam
)
{
PageInfo
<
BlockDayCensus
>
pageInfo
=
this
.
blockDayCensusService
.
getByPageWithCategory
(
reqParam
.
getStartIndex
(),
reqParam
.
getPageSize
(),
new
BlockDayCensusExample
());
return
ResponseKit
.
success
(
pageInfo
.
getList
());
}
/**
* Daily Transactions Chart Data.
*
* @return
*/
@RequestMapping
(
value
=
"index/trans/census/all"
,
method
=
RequestMethod
.
POST
)
public
ApiResponse
transCensusLast
()
{
List
<
BlockDayCensus
>
list
=
this
.
blockDayCensusService
.
getByExample
(
new
BlockDayCensusExample
());
return
ResponseKit
.
success
(
list
);
}
/**
* 根据用户地址查看用户交易信息
*
* @return
*/
@RequestMapping
(
value
=
"/user/trans"
,
method
=
RequestMethod
.
POST
)
public
ApiResponse
userTrans
(
@RequestBody
SearchRequest
reqParam
)
{
HomeSearchModel
model
=
new
HomeSearchModel
();
AddressExample
addressExample
=
new
AddressExample
();
addressExample
.
createCriteria
().
andAddressEqualTo
(
reqParam
.
getCondition
());
Address
address
=
this
.
addressService
.
selectOneByExample
(
addressExample
);
PageInfo
<
Transaction
>
pageInfo
=
this
.
transactionService
.
selectListByAddress
(
reqParam
.
getCondition
(),
reqParam
.
getType
(),
reqParam
.
getStartIndex
(),
reqParam
.
getPageSize
());
List
<
TransactionModel
>
txList
=
this
.
transfer
(
pageInfo
);
model
.
setTransList
(
txList
);
model
.
setAddress
(
address
);
return
ResponseKit
.
success
(
model
);
}
/**
* 交易详情
*
* @return
*/
@RequestMapping
(
value
=
"/trans/info"
,
method
=
RequestMethod
.
GET
)
public
ApiResponse
userTrans
(
String
txId
)
{
if
(
StringUtils
.
isEmpty
(
txId
))
{
return
ResponseKit
.
success
();
}
TransactionExample
example
=
new
TransactionExample
();
example
.
createCriteria
().
andTxIdEqualTo
(
txId
);
List
<
Transaction
>
txList
=
this
.
transactionService
.
getByExample
(
example
);
if
(!
CollectionUtils
.
isEmpty
(
txList
))
{
return
ResponseKit
.
success
(
txList
.
get
(
0
));
}
return
ResponseKit
.
success
();
}
private
List
<
TransactionModel
>
transfer
(
PageInfo
<
Transaction
>
pageInfo
)
{
List
<
TransactionModel
>
txList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
pageInfo
.
getList
()))
{
return
txList
;
}
pageInfo
.
getList
().
forEach
(
o
->
{
TransactionModel
txModel
=
new
TransactionModel
();
txModel
.
setTxId
(
o
.
getTxId
());
txModel
.
setAmount
(
o
.
getAmount
());
txModel
.
setNumber
(
o
.
getNumber
());
txModel
.
setFrom
(
o
.
getOwnerAddress
());
if
(!
StringUtils
.
isEmpty
(
o
.
getToAddress
()))
{
txModel
.
setTo
(
o
.
getToAddress
());
}
if
(!
StringUtils
.
isEmpty
(
o
.
getContractAddress
()))
{
txModel
.
setTo
(
o
.
getContractAddress
());
}
txList
.
add
(
txModel
);
});
return
txList
;
}
public
final
static
boolean
isNumeric
(
String
s
)
{
if
(
s
!=
null
&&
!
""
.
equals
(
s
.
trim
()))
{
return
s
.
matches
(
"^[0-9]*$"
);
}
else
{
return
false
;
}
}
}
@Data
class
HomeSearchModel
{
private
BlockHeader
block
;
private
List
<
TransactionModel
>
transList
;
private
Address
address
;
}
src/main/java/com/wuban/tron/explore/dao/AddressRepository.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.Address
;
import
com.wuban.tron.explore.entity.example.AddressExample
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
AddressRepository
{
/**
* 批量添加、更新账户地址信息
*
* @param records
*/
void
batchInsertOnDuplicateKey
(
@Param
(
"records"
)
List
<
Address
>
records
);
/**
* 获取账户地址信息
*
* @param example 查询条件参数
* @return 记录
*/
Address
selectOneByExample
(
@Param
(
"example"
)
AddressExample
example
);
/**
* 修改账户信息
*
* @param record
*/
void
updateById
(
@Param
(
"record"
)
Address
record
);
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/dao/BlockDayCensusRepository.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.BlockDayCensus
;
import
com.wuban.tron.explore.entity.example.BlockDayCensusExample
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
BlockDayCensusRepository
{
int
insert
(
@Param
(
"record"
)
BlockDayCensus
record
);
/**
* 按照时间统计区块信息
*
* @param start 开始时间秒
* @param end 结束时间秒
* @return BlockDayCensus
*/
BlockDayCensus
censusBlockByTime
(
@Param
(
"start"
)
Long
start
,
@Param
(
"end"
)
Long
end
);
/**
* 分页查询
*
* @param example 查询条件参数
* @return 分页记录列表
*/
List
<
BlockDayCensus
>
selectByPager
(
@Param
(
"example"
)
BlockDayCensusExample
example
);
/**
* 根据条件检索列表数据
*
* @param example 查询条件参数
* @return 记录列表
*/
List
<
BlockDayCensus
>
selectByExample
(
@Param
(
"example"
)
BlockDayCensusExample
example
);
}
src/main/java/com/wuban/tron/explore/dao/BlockHeaderRepository.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.BlockHeader
;
import
com.wuban.tron.explore.entity.example.BlockHeaderExample
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
BlockHeaderRepository
{
int
insert
(
@Param
(
"record"
)
BlockHeader
record
);
/**
* 批量:持久化区块头信息
* @param records 区块头信息
* @return
*/
int
batchInsert
(
@Param
(
"records"
)
List
<
BlockHeader
>
records
);
/**
* 获取所有区块头中最小时间
*
* @return 时间
*/
Long
selectBlockMinTime
();
/**
* 根据条件检索区块头信息
*
* @param example 检索条件
* @return
*/
BlockHeader
selectOneByExample
(
@Param
(
"example"
)
BlockHeaderExample
example
);
}
src/main/java/com/wuban/tron/explore/dao/LastBlockRepository.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.LastBlock
;
import
com.wuban.tron.explore.entity.example.LastBlockExample
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
LastBlockRepository
{
LastBlock
selectByIdForUpdate
(
@Param
(
"id"
)
Long
id
);
LastBlock
selectOneByExample
(
@Param
(
"example"
)
LastBlockExample
example
);
int
updateById
(
@Param
(
"record"
)
LastBlock
record
);
int
updateCurBlockNumById
(
@Param
(
"record"
)
LastBlock
record
);
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/dao/TransactionHexRepository.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.TransactionHex
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
TransactionHexRepository
{
int
insert
(
@Param
(
"record"
)
TransactionHex
record
);
int
batchInsert
(
@Param
(
"records"
)
List
<
TransactionHex
>
records
);
}
src/main/java/com/wuban/tron/explore/dao/TransactionRepository.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.Transaction
;
import
com.wuban.tron.explore.entity.example.TransactionExample
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
TransactionRepository
{
int
insert
(
@Param
(
"record"
)
Transaction
record
);
int
batchInsert
(
@Param
(
"records"
)
List
<
Transaction
>
records
);
/**
* 分页查询
*
* @param example 查询条件参数
* @return 分页记录列表
*/
List
<
Transaction
>
selectByPagerEx
(
@Param
(
"example"
)
TransactionExample
example
);
/**
* 根据条件检索
*
* @param example 检索条件
* @return
*/
List
<
Transaction
>
selectByExample
(
@Param
(
"example"
)
TransactionExample
example
);
/**
* 根据账户地址查询交易信息
*
* @param address 账户地址
*
* @param timestamp
*
* @return
*/
List
<
Transaction
>
selectListByAddress
(
@Param
(
"address"
)
String
address
,
@Param
(
"t"
)
long
timestamp
);
}
src/main/java/com/wuban/tron/explore/dao/config/DataSourceConfigEX.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
.
config
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
javax.sql.DataSource
;
/**
* @author sky
*
*/
@Configuration
@MapperScan
(
basePackages
=
"com.wuban.tron.explore.dao"
,
sqlSessionTemplateRef
=
"sqlSessionTemplateEX"
)
public
class
DataSourceConfigEX
{
@Value
(
"${spring.datasource.type}"
)
private
Class
<?
extends
DataSource
>
dataSourceType
;
@Bean
(
name
=
"dataSourceEX"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
@Primary
public
DataSource
buildDataSource
()
{
return
DataSourceBuilder
.
create
().
type
(
this
.
dataSourceType
).
build
();
}
@Bean
(
name
=
"sqlSessionFactoryEX"
)
@Primary
public
SqlSessionFactory
buildSqlSessionFactory
(
@Qualifier
(
"dataSourceEX"
)
final
DataSource
dataSource
)
throws
Exception
{
final
SqlSessionFactoryBean
bean
=
new
SqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSource
);
bean
.
setConfigLocation
(
new
PathMatchingResourcePatternResolver
().
getResource
(
"classpath:mybatis/mybatis-config.xml"
));
bean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
"classpath:mapper/*.xml"
));
return
bean
.
getObject
();
}
@Bean
(
name
=
"transactionManagerEX"
)
@Primary
public
DataSourceTransactionManager
buildTransactionManager
(
@Qualifier
(
"dataSourceEX"
)
final
DataSource
dataSource
)
{
return
new
DataSourceTransactionManager
(
dataSource
);
}
@Bean
(
name
=
"sqlSessionTemplateEX"
)
@Primary
public
SqlSessionTemplate
buildSqlSessionTemplate
(
@Qualifier
(
"sqlSessionFactoryEX"
)
final
SqlSessionFactory
sqlSessionFactory
)
{
return
new
SqlSessionTemplate
(
sqlSessionFactory
);
}
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/domain/ActivePermission.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ActivePermission
{
private
String
type
;
private
Integer
id
;
private
String
permission_name
;
private
Integer
threshold
;
private
String
operations
;
private
List
<
Keys
>
keys
;
}
src/main/java/com/wuban/tron/explore/domain/BlockHeaderRawData.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
/**
* <core>区块头信息类</core>
*
* @author sky
* @date 2020/11/02
*/
@Data
public
class
BlockHeaderRawData
{
private
Long
number
;
private
String
txTrieRoot
;
private
String
witness_address
;
private
String
parentHash
;
private
Integer
version
;
private
Long
timestamp
;
}
src/main/java/com/wuban/tron/explore/domain/Contract.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
Contract
{
private
ContractParameter
parameter
;
private
String
type
;
}
src/main/java/com/wuban/tron/explore/domain/ContractParameter.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
ContractParameter
{
private
ContractParameterValue
value
;
private
String
type_url
;
}
src/main/java/com/wuban/tron/explore/domain/ContractParameterValue.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
ContractParameterValue
{
private
String
owner_address
;
private
Long
amount
;
private
String
to_address
;
private
String
data
;
private
String
contract_address
;
}
src/main/java/com/wuban/tron/explore/domain/Keys.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
Keys
{
private
String
address
;
private
Integer
weight
;
}
src/main/java/com/wuban/tron/explore/domain/OwnerPermission.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
OwnerPermission
{
private
String
permission_name
;
private
Integer
threshold
;
private
List
<
Keys
>
keys
;
}
src/main/java/com/wuban/tron/explore/domain/Transactions.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
import
java.util.List
;
/**
* <core>区块交易信息类</core>
*
* @author sky
* @date 2020/11/02
*/
@Data
public
class
Transactions
{
private
List
<
TransactionsRet
>
ret
;
private
List
<
String
>
signature
;
private
String
txID
;
private
String
raw_data_hex
;
private
TransactionsRawData
raw_data
;
}
src/main/java/com/wuban/tron/explore/domain/TransactionsRawData.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
TransactionsRawData
{
private
List
<
Contract
>
contract
;
private
String
ref_block_bytes
;
private
String
ref_block_hash
;
private
Long
expiration
;
private
Long
timestamp
;
private
Long
fee_limit
;
}
src/main/java/com/wuban/tron/explore/domain/TransactionsRet.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
TransactionsRet
{
private
String
contractRet
;
}
src/main/java/com/wuban/tron/explore/domain/TronAccount.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
TronAccount
{
private
String
address
;
private
Long
balance
;
/* private Long create_time;
private Long latest_opration_time;
private Long latest_consume_free_time;
private ActivePermission active_permission;
private OwnerPermission owner_permission;*/
}
src/main/java/com/wuban/tron/explore/domain/TronBlockHeader.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
@Data
public
class
TronBlockHeader
{
private
BlockHeaderRawData
raw_data
;
private
String
witness_signature
;
}
src/main/java/com/wuban/tron/explore/domain/TronResponseArrayData.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
import
java.util.List
;
/**
* <core>波场区块服务响应结果类</core>
*
* @author sky
* @date 2020/11/02
*/
@Data
public
class
TronResponseArrayData
{
private
List
<
TronResponseData
>
block
;
}
src/main/java/com/wuban/tron/explore/domain/TronResponseData.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
domain
;
import
lombok.Data
;
import
java.util.List
;
/**
* <core>波场区块服务响应结果类</core>
*
* @author sky
* @date 2020/11/02
*/
@Data
public
class
TronResponseData
{
private
String
blockID
;
private
TronBlockHeader
block_header
;
private
List
<
Transactions
>
transactions
;
}
src/main/java/com/wuban/tron/explore/entity/Address.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
;
import
lombok.AccessLevel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 账户地址表
* @author sky
* @date 2020-11-09
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
class
Address
{
/**
* 账户地址
*/
private
String
address
;
/**
* 余额
*/
private
Long
balance
;
public
static
Address
getInstance
()
{
return
Address
.
builder
()
.
address
(
""
)
.
balance
(
0L
)
.
build
();
}
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/entity/BlockDayCensus.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.AccessLevel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 按天统计区块表
* @author sky
* @date 2020-11-04
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
class
BlockDayCensus
{
/**
*
*/
private
Long
id
;
/**
* 生成区块的平均时间
*/
private
Long
genBlockAverTime
;
/**
* 生成区块总量
*/
private
Integer
genBlockTotalNum
;
/**
* 总交易量
*/
private
Integer
totalVolume
;
/**
* 统计日期
*/
private
String
censusDate
;
private
Integer
totalBlockBytes
;
private
Integer
averBlockBytes
;
/**
*
*/
@JsonIgnore
private
Date
createTime
;
public
static
BlockDayCensus
getInstance
()
{
return
BlockDayCensus
.
builder
()
.
id
(
0L
)
.
genBlockAverTime
(
0L
)
.
genBlockTotalNum
(
0
)
.
totalVolume
(
0
)
.
censusDate
(
""
)
.
totalBlockBytes
(
0
)
.
averBlockBytes
(
0
)
.
createTime
(
null
)
.
build
();
}
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/entity/BlockHeader.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
;
import
lombok.AccessLevel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 区块头信息表
* @author sky
* @date 2020-11-03
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
class
BlockHeader
{
/**
*
*/
private
Long
id
;
/**
* 区块ID
*/
private
String
blockId
;
/**
* 区块高度
*/
private
Long
number
;
/**
*
*/
private
String
txTrieRoot
;
/**
*
*/
private
String
witnessAddress
;
/**
* 父hash
*/
private
String
parentHash
;
/**
* 版本号
*/
private
Integer
version
;
/**
* 区块时间戳
*/
private
Long
timestamp
;
/**
*
*/
private
String
witnessSignature
;
/**
* 交易量
*/
private
Integer
transactionVolume
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 块大小
*/
private
String
blockBytes
;
public
static
BlockHeader
getInstance
()
{
return
BlockHeader
.
builder
()
.
id
(
0L
)
.
blockId
(
""
)
.
number
(
0L
)
.
txTrieRoot
(
""
)
.
witnessAddress
(
""
)
.
parentHash
(
""
)
.
version
(
0
)
.
timestamp
(
0L
)
.
witnessSignature
(
""
)
.
transactionVolume
(
0
)
.
createTime
(
new
Date
())
.
blockBytes
(
""
)
.
build
();
}
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/entity/LastBlock.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
;
import
lombok.*
;
/**
*
* @author sky
* @date 2020-11-02
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
class
LastBlock
{
/**
* 唯一标识
*/
private
Long
id
;
/**
* 系统已设置的区块高度
*/
private
Long
curBlockNum
;
/**
* 波场最新的区块高度
*/
private
Long
lastBlockNum
;
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/entity/Transaction.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
;
import
lombok.AccessLevel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 区块交易信息表
* @author sky
* @date 2020-11-03
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
class
Transaction
{
/**
*
*/
private
Long
id
;
/**
* 区块ID
*/
private
String
blockId
;
/**
* 交易ID
*/
private
String
txId
;
/**
* 交易结果
*/
private
String
contractRet
;
/**
* 交易地址FROM
*/
private
String
ownerAddress
;
/**
* 合约数据
*/
private
String
data
;
/**
* 合约地址
*/
private
String
contractAddress
;
/**
* 交易额
*/
private
Long
amount
;
/**
* 交易地址TO
*/
private
String
toAddress
;
/**
*
*/
private
String
typeUrl
;
/**
*
*/
private
String
type
;
/**
*
*/
private
String
refBlockBytes
;
/**
*
*/
private
String
refBlockHash
;
/**
*
*/
private
Long
expiration
;
/**
*
*/
private
Long
feeLimit
;
/**
*
*/
private
Long
timestamp
;
/**
* 创建时间
*/
private
Date
createTime
;
private
Long
number
;
public
static
Transaction
getInstance
()
{
return
Transaction
.
builder
()
.
id
(
0L
)
.
blockId
(
""
)
.
txId
(
""
)
.
contractRet
(
""
)
.
ownerAddress
(
""
)
.
data
(
""
)
.
contractAddress
(
""
)
.
amount
(
0L
)
.
toAddress
(
""
)
.
typeUrl
(
""
)
.
type
(
""
)
.
refBlockBytes
(
""
)
.
refBlockHash
(
""
)
.
expiration
(
0L
)
.
feeLimit
(
0L
)
.
timestamp
(
0L
)
.
createTime
(
new
Date
())
.
number
(
0L
)
.
build
();
}
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/entity/TransactionHex.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
;
import
lombok.AccessLevel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 区块交易hex表
* @author sky
* @date 2020-11-03
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
class
TransactionHex
{
/**
*
*/
private
Long
id
;
/**
*
*/
private
String
hex
;
/**
* 区块ID
*/
private
String
blockId
;
/**
* 交易ID
*/
private
String
txId
;
/**
*
*/
private
String
signature
;
/**
* 创建时间
*/
private
Date
createTime
;
public
static
TransactionHex
getInstance
()
{
return
TransactionHex
.
builder
()
.
id
(
0L
)
.
hex
(
""
)
.
blockId
(
""
)
.
txId
(
""
)
.
signature
(
""
)
.
createTime
(
new
Date
())
.
build
();
}
}
\ No newline at end of file
src/main/java/com/wuban/tron/explore/entity/example/AddressExample.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
.
example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 账户地址表 查询条件example类
* @author sky
* @date 2020-11-09
*/
public
class
AddressExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
AddressExample
()
{
oredCriteria
=
new
ArrayList
<>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andAddressIsNull
()
{
addCriterion
(
"address is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressIsNotNull
()
{
addCriterion
(
"address is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressEqualTo
(
String
value
)
{
addCriterion
(
"address ="
,
value
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressNotEqualTo
(
String
value
)
{
addCriterion
(
"address <>"
,
value
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressIn
(
List
<
String
>
values
)
{
addCriterion
(
"address in"
,
values
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"address not in"
,
values
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"address between"
,
value1
,
value2
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"address not between"
,
value1
,
value2
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressLike
(
String
value
)
{
addCriterion
(
"address like"
,
value
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAddressNotLike
(
String
value
)
{
addCriterion
(
"address not like"
,
value
,
"address"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceIsNull
()
{
addCriterion
(
"balance is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceIsNotNull
()
{
addCriterion
(
"balance is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceEqualTo
(
Long
value
)
{
addCriterion
(
"balance ="
,
value
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceNotEqualTo
(
Long
value
)
{
addCriterion
(
"balance <>"
,
value
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceIn
(
List
<
Long
>
values
)
{
addCriterion
(
"balance in"
,
values
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"balance not in"
,
values
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"balance between"
,
value1
,
value2
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"balance not between"
,
value1
,
value2
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceGreaterThan
(
Long
value
)
{
addCriterion
(
"balance >"
,
value
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"balance >="
,
value
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceLessThan
(
Long
value
)
{
addCriterion
(
"balance <"
,
value
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBalanceLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"balance <="
,
value
,
"balance"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNotNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" = "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <> "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" not in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" not between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" > "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" >= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" < "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" not like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
src/main/java/com/wuban/tron/explore/entity/example/BlockDayCensusExample.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
.
example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 按天统计区块表 查询条件example类
* @author sky
* @date 2020-11-04
*/
public
class
BlockDayCensusExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
BlockDayCensusExample
()
{
oredCriteria
=
new
ArrayList
<>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeIsNull
()
{
addCriterion
(
"gen_block_aver_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeIsNotNull
()
{
addCriterion
(
"gen_block_aver_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeEqualTo
(
Long
value
)
{
addCriterion
(
"gen_block_aver_time ="
,
value
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeNotEqualTo
(
Long
value
)
{
addCriterion
(
"gen_block_aver_time <>"
,
value
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeIn
(
List
<
Long
>
values
)
{
addCriterion
(
"gen_block_aver_time in"
,
values
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"gen_block_aver_time not in"
,
values
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"gen_block_aver_time between"
,
value1
,
value2
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"gen_block_aver_time not between"
,
value1
,
value2
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeGreaterThan
(
Long
value
)
{
addCriterion
(
"gen_block_aver_time >"
,
value
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"gen_block_aver_time >="
,
value
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeLessThan
(
Long
value
)
{
addCriterion
(
"gen_block_aver_time <"
,
value
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockAverTimeLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"gen_block_aver_time <="
,
value
,
"genBlockAverTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumIsNull
()
{
addCriterion
(
"gen_block_total_num is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumIsNotNull
()
{
addCriterion
(
"gen_block_total_num is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumEqualTo
(
Integer
value
)
{
addCriterion
(
"gen_block_total_num ="
,
value
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumNotEqualTo
(
Integer
value
)
{
addCriterion
(
"gen_block_total_num <>"
,
value
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"gen_block_total_num in"
,
values
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"gen_block_total_num not in"
,
values
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"gen_block_total_num between"
,
value1
,
value2
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"gen_block_total_num not between"
,
value1
,
value2
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumGreaterThan
(
Integer
value
)
{
addCriterion
(
"gen_block_total_num >"
,
value
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"gen_block_total_num >="
,
value
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumLessThan
(
Integer
value
)
{
addCriterion
(
"gen_block_total_num <"
,
value
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGenBlockTotalNumLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"gen_block_total_num <="
,
value
,
"genBlockTotalNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeIsNull
()
{
addCriterion
(
"total_volume is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeIsNotNull
()
{
addCriterion
(
"total_volume is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeEqualTo
(
Integer
value
)
{
addCriterion
(
"total_volume ="
,
value
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeNotEqualTo
(
Integer
value
)
{
addCriterion
(
"total_volume <>"
,
value
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"total_volume in"
,
values
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"total_volume not in"
,
values
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"total_volume between"
,
value1
,
value2
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"total_volume not between"
,
value1
,
value2
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeGreaterThan
(
Integer
value
)
{
addCriterion
(
"total_volume >"
,
value
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"total_volume >="
,
value
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeLessThan
(
Integer
value
)
{
addCriterion
(
"total_volume <"
,
value
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTotalVolumeLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"total_volume <="
,
value
,
"totalVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateIsNull
()
{
addCriterion
(
"census_date is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateIsNotNull
()
{
addCriterion
(
"census_date is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateEqualTo
(
String
value
)
{
addCriterion
(
"census_date ="
,
value
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateNotEqualTo
(
String
value
)
{
addCriterion
(
"census_date <>"
,
value
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateIn
(
List
<
String
>
values
)
{
addCriterion
(
"census_date in"
,
values
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"census_date not in"
,
values
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"census_date between"
,
value1
,
value2
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"census_date not between"
,
value1
,
value2
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateLike
(
String
value
)
{
addCriterion
(
"census_date like"
,
value
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCensusDateNotLike
(
String
value
)
{
addCriterion
(
"census_date not like"
,
value
,
"censusDate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"create_time ="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <>"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time not in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time not between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"create_time >"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time >="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThan
(
Date
value
)
{
addCriterion
(
"create_time <"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNotNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" = "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <> "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" not in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" not between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" > "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" >= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" < "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" not like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
src/main/java/com/wuban/tron/explore/entity/example/BlockHeaderExample.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
.
example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 区块头信息表 查询条件example类
* @author sky
* @date 2020-11-03
*/
public
class
BlockHeaderExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
BlockHeaderExample
()
{
oredCriteria
=
new
ArrayList
<>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIsNull
()
{
addCriterion
(
"block_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIsNotNull
()
{
addCriterion
(
"block_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdEqualTo
(
String
value
)
{
addCriterion
(
"block_id ="
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotEqualTo
(
String
value
)
{
addCriterion
(
"block_id <>"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"block_id in"
,
values
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"block_id not in"
,
values
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"block_id between"
,
value1
,
value2
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"block_id not between"
,
value1
,
value2
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdLike
(
String
value
)
{
addCriterion
(
"block_id like"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotLike
(
String
value
)
{
addCriterion
(
"block_id not like"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberIsNull
()
{
addCriterion
(
"number is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberIsNotNull
()
{
addCriterion
(
"number is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberEqualTo
(
Long
value
)
{
addCriterion
(
"number ="
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberNotEqualTo
(
Long
value
)
{
addCriterion
(
"number <>"
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberIn
(
List
<
Long
>
values
)
{
addCriterion
(
"number in"
,
values
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"number not in"
,
values
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"number between"
,
value1
,
value2
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"number not between"
,
value1
,
value2
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberGreaterThan
(
Long
value
)
{
addCriterion
(
"number >"
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"number >="
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberLessThan
(
Long
value
)
{
addCriterion
(
"number <"
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"number <="
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootIsNull
()
{
addCriterion
(
"tx_trie_root is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootIsNotNull
()
{
addCriterion
(
"tx_trie_root is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootEqualTo
(
String
value
)
{
addCriterion
(
"tx_trie_root ="
,
value
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootNotEqualTo
(
String
value
)
{
addCriterion
(
"tx_trie_root <>"
,
value
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootIn
(
List
<
String
>
values
)
{
addCriterion
(
"tx_trie_root in"
,
values
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"tx_trie_root not in"
,
values
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"tx_trie_root between"
,
value1
,
value2
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"tx_trie_root not between"
,
value1
,
value2
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootLike
(
String
value
)
{
addCriterion
(
"tx_trie_root like"
,
value
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxTrieRootNotLike
(
String
value
)
{
addCriterion
(
"tx_trie_root not like"
,
value
,
"txTrieRoot"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressIsNull
()
{
addCriterion
(
"witness_address is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressIsNotNull
()
{
addCriterion
(
"witness_address is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressEqualTo
(
String
value
)
{
addCriterion
(
"witness_address ="
,
value
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressNotEqualTo
(
String
value
)
{
addCriterion
(
"witness_address <>"
,
value
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressIn
(
List
<
String
>
values
)
{
addCriterion
(
"witness_address in"
,
values
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"witness_address not in"
,
values
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"witness_address between"
,
value1
,
value2
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"witness_address not between"
,
value1
,
value2
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressLike
(
String
value
)
{
addCriterion
(
"witness_address like"
,
value
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessAddressNotLike
(
String
value
)
{
addCriterion
(
"witness_address not like"
,
value
,
"witnessAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashIsNull
()
{
addCriterion
(
"parentHash is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashIsNotNull
()
{
addCriterion
(
"parentHash is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashEqualTo
(
String
value
)
{
addCriterion
(
"parentHash ="
,
value
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashNotEqualTo
(
String
value
)
{
addCriterion
(
"parentHash <>"
,
value
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashIn
(
List
<
String
>
values
)
{
addCriterion
(
"parentHash in"
,
values
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"parentHash not in"
,
values
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"parentHash between"
,
value1
,
value2
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"parentHash not between"
,
value1
,
value2
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashLike
(
String
value
)
{
addCriterion
(
"parentHash like"
,
value
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andParentHashNotLike
(
String
value
)
{
addCriterion
(
"parentHash not like"
,
value
,
"parentHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionIsNull
()
{
addCriterion
(
"version is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionIsNotNull
()
{
addCriterion
(
"version is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionEqualTo
(
Integer
value
)
{
addCriterion
(
"version ="
,
value
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionNotEqualTo
(
Integer
value
)
{
addCriterion
(
"version <>"
,
value
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"version in"
,
values
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"version not in"
,
values
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"version between"
,
value1
,
value2
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"version not between"
,
value1
,
value2
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionGreaterThan
(
Integer
value
)
{
addCriterion
(
"version >"
,
value
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"version >="
,
value
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionLessThan
(
Integer
value
)
{
addCriterion
(
"version <"
,
value
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andVersionLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"version <="
,
value
,
"version"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampIsNull
()
{
addCriterion
(
"timestamp is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampIsNotNull
()
{
addCriterion
(
"timestamp is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp ="
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampNotEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp <>"
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampIn
(
List
<
Long
>
values
)
{
addCriterion
(
"timestamp in"
,
values
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"timestamp not in"
,
values
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"timestamp between"
,
value1
,
value2
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"timestamp not between"
,
value1
,
value2
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampGreaterThan
(
Long
value
)
{
addCriterion
(
"timestamp >"
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp >="
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampLessThan
(
Long
value
)
{
addCriterion
(
"timestamp <"
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp <="
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureIsNull
()
{
addCriterion
(
"witness_signature is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureIsNotNull
()
{
addCriterion
(
"witness_signature is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureEqualTo
(
String
value
)
{
addCriterion
(
"witness_signature ="
,
value
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureNotEqualTo
(
String
value
)
{
addCriterion
(
"witness_signature <>"
,
value
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureIn
(
List
<
String
>
values
)
{
addCriterion
(
"witness_signature in"
,
values
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"witness_signature not in"
,
values
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"witness_signature between"
,
value1
,
value2
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"witness_signature not between"
,
value1
,
value2
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureLike
(
String
value
)
{
addCriterion
(
"witness_signature like"
,
value
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWitnessSignatureNotLike
(
String
value
)
{
addCriterion
(
"witness_signature not like"
,
value
,
"witnessSignature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeIsNull
()
{
addCriterion
(
"transaction_volume is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeIsNotNull
()
{
addCriterion
(
"transaction_volume is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeEqualTo
(
Integer
value
)
{
addCriterion
(
"transaction_volume ="
,
value
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeNotEqualTo
(
Integer
value
)
{
addCriterion
(
"transaction_volume <>"
,
value
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"transaction_volume in"
,
values
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"transaction_volume not in"
,
values
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"transaction_volume between"
,
value1
,
value2
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"transaction_volume not between"
,
value1
,
value2
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeGreaterThan
(
Integer
value
)
{
addCriterion
(
"transaction_volume >"
,
value
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"transaction_volume >="
,
value
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeLessThan
(
Integer
value
)
{
addCriterion
(
"transaction_volume <"
,
value
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTransactionVolumeLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"transaction_volume <="
,
value
,
"transactionVolume"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"create_time ="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <>"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time not in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time not between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"create_time >"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time >="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThan
(
Date
value
)
{
addCriterion
(
"create_time <"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNotNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" = "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <> "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" not in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" not between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" > "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" >= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" < "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" not like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
src/main/java/com/wuban/tron/explore/entity/example/LastBlockExample.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
.
example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 查询条件example类
* @author sky
* @date 2020-11-02
*/
public
class
LastBlockExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
LastBlockExample
()
{
oredCriteria
=
new
ArrayList
<>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumIsNull
()
{
addCriterion
(
"cur_block_num is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumIsNotNull
()
{
addCriterion
(
"cur_block_num is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumEqualTo
(
Long
value
)
{
addCriterion
(
"cur_block_num ="
,
value
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumNotEqualTo
(
Long
value
)
{
addCriterion
(
"cur_block_num <>"
,
value
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumIn
(
List
<
Long
>
values
)
{
addCriterion
(
"cur_block_num in"
,
values
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"cur_block_num not in"
,
values
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"cur_block_num between"
,
value1
,
value2
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"cur_block_num not between"
,
value1
,
value2
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumGreaterThan
(
Long
value
)
{
addCriterion
(
"cur_block_num >"
,
value
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"cur_block_num >="
,
value
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumLessThan
(
Long
value
)
{
addCriterion
(
"cur_block_num <"
,
value
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCurBlockNumLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"cur_block_num <="
,
value
,
"curBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumIsNull
()
{
addCriterion
(
"last_block_num is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumIsNotNull
()
{
addCriterion
(
"last_block_num is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumEqualTo
(
Long
value
)
{
addCriterion
(
"last_block_num ="
,
value
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumNotEqualTo
(
Long
value
)
{
addCriterion
(
"last_block_num <>"
,
value
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumIn
(
List
<
Long
>
values
)
{
addCriterion
(
"last_block_num in"
,
values
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"last_block_num not in"
,
values
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"last_block_num between"
,
value1
,
value2
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"last_block_num not between"
,
value1
,
value2
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumGreaterThan
(
Long
value
)
{
addCriterion
(
"last_block_num >"
,
value
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"last_block_num >="
,
value
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumLessThan
(
Long
value
)
{
addCriterion
(
"last_block_num <"
,
value
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLastBlockNumLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"last_block_num <="
,
value
,
"lastBlockNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNotNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" = "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <> "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" not in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" not between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" > "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" >= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" < "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" not like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
src/main/java/com/wuban/tron/explore/entity/example/TransactionExample.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
.
example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 区块交易信息表 查询条件example类
* @author sky
* @date 2020-11-06
*/
public
class
TransactionExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
TransactionExample
()
{
oredCriteria
=
new
ArrayList
<>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIsNull
()
{
addCriterion
(
"block_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIsNotNull
()
{
addCriterion
(
"block_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdEqualTo
(
String
value
)
{
addCriterion
(
"block_id ="
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotEqualTo
(
String
value
)
{
addCriterion
(
"block_id <>"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"block_id in"
,
values
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"block_id not in"
,
values
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"block_id between"
,
value1
,
value2
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"block_id not between"
,
value1
,
value2
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdLike
(
String
value
)
{
addCriterion
(
"block_id like"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotLike
(
String
value
)
{
addCriterion
(
"block_id not like"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdIsNull
()
{
addCriterion
(
"tx_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdIsNotNull
()
{
addCriterion
(
"tx_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdEqualTo
(
String
value
)
{
addCriterion
(
"tx_id ="
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotEqualTo
(
String
value
)
{
addCriterion
(
"tx_id <>"
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"tx_id in"
,
values
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"tx_id not in"
,
values
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"tx_id between"
,
value1
,
value2
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"tx_id not between"
,
value1
,
value2
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdLike
(
String
value
)
{
addCriterion
(
"tx_id like"
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotLike
(
String
value
)
{
addCriterion
(
"tx_id not like"
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetIsNull
()
{
addCriterion
(
"contract_ret is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetIsNotNull
()
{
addCriterion
(
"contract_ret is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetEqualTo
(
String
value
)
{
addCriterion
(
"contract_ret ="
,
value
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetNotEqualTo
(
String
value
)
{
addCriterion
(
"contract_ret <>"
,
value
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetIn
(
List
<
String
>
values
)
{
addCriterion
(
"contract_ret in"
,
values
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"contract_ret not in"
,
values
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"contract_ret between"
,
value1
,
value2
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"contract_ret not between"
,
value1
,
value2
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetLike
(
String
value
)
{
addCriterion
(
"contract_ret like"
,
value
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractRetNotLike
(
String
value
)
{
addCriterion
(
"contract_ret not like"
,
value
,
"contractRet"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressIsNull
()
{
addCriterion
(
"owner_address is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressIsNotNull
()
{
addCriterion
(
"owner_address is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressEqualTo
(
String
value
)
{
addCriterion
(
"owner_address ="
,
value
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressNotEqualTo
(
String
value
)
{
addCriterion
(
"owner_address <>"
,
value
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressIn
(
List
<
String
>
values
)
{
addCriterion
(
"owner_address in"
,
values
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"owner_address not in"
,
values
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"owner_address between"
,
value1
,
value2
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"owner_address not between"
,
value1
,
value2
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressLike
(
String
value
)
{
addCriterion
(
"owner_address like"
,
value
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOwnerAddressNotLike
(
String
value
)
{
addCriterion
(
"owner_address not like"
,
value
,
"ownerAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataIsNull
()
{
addCriterion
(
"data is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataIsNotNull
()
{
addCriterion
(
"data is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataEqualTo
(
String
value
)
{
addCriterion
(
"data ="
,
value
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataNotEqualTo
(
String
value
)
{
addCriterion
(
"data <>"
,
value
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataIn
(
List
<
String
>
values
)
{
addCriterion
(
"data in"
,
values
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"data not in"
,
values
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"data between"
,
value1
,
value2
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"data not between"
,
value1
,
value2
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataLike
(
String
value
)
{
addCriterion
(
"data like"
,
value
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataNotLike
(
String
value
)
{
addCriterion
(
"data not like"
,
value
,
"data"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressIsNull
()
{
addCriterion
(
"contract_address is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressIsNotNull
()
{
addCriterion
(
"contract_address is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressEqualTo
(
String
value
)
{
addCriterion
(
"contract_address ="
,
value
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressNotEqualTo
(
String
value
)
{
addCriterion
(
"contract_address <>"
,
value
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressIn
(
List
<
String
>
values
)
{
addCriterion
(
"contract_address in"
,
values
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"contract_address not in"
,
values
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"contract_address between"
,
value1
,
value2
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"contract_address not between"
,
value1
,
value2
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressLike
(
String
value
)
{
addCriterion
(
"contract_address like"
,
value
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andContractAddressNotLike
(
String
value
)
{
addCriterion
(
"contract_address not like"
,
value
,
"contractAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountIsNull
()
{
addCriterion
(
"amount is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountIsNotNull
()
{
addCriterion
(
"amount is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountEqualTo
(
Long
value
)
{
addCriterion
(
"amount ="
,
value
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountNotEqualTo
(
Long
value
)
{
addCriterion
(
"amount <>"
,
value
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountIn
(
List
<
Long
>
values
)
{
addCriterion
(
"amount in"
,
values
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"amount not in"
,
values
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"amount between"
,
value1
,
value2
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"amount not between"
,
value1
,
value2
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountGreaterThan
(
Long
value
)
{
addCriterion
(
"amount >"
,
value
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"amount >="
,
value
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountLessThan
(
Long
value
)
{
addCriterion
(
"amount <"
,
value
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAmountLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"amount <="
,
value
,
"amount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressIsNull
()
{
addCriterion
(
"to_address is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressIsNotNull
()
{
addCriterion
(
"to_address is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressEqualTo
(
String
value
)
{
addCriterion
(
"to_address ="
,
value
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressNotEqualTo
(
String
value
)
{
addCriterion
(
"to_address <>"
,
value
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressIn
(
List
<
String
>
values
)
{
addCriterion
(
"to_address in"
,
values
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"to_address not in"
,
values
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"to_address between"
,
value1
,
value2
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"to_address not between"
,
value1
,
value2
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressLike
(
String
value
)
{
addCriterion
(
"to_address like"
,
value
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andToAddressNotLike
(
String
value
)
{
addCriterion
(
"to_address not like"
,
value
,
"toAddress"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlIsNull
()
{
addCriterion
(
"type_url is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlIsNotNull
()
{
addCriterion
(
"type_url is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlEqualTo
(
String
value
)
{
addCriterion
(
"type_url ="
,
value
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlNotEqualTo
(
String
value
)
{
addCriterion
(
"type_url <>"
,
value
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlIn
(
List
<
String
>
values
)
{
addCriterion
(
"type_url in"
,
values
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"type_url not in"
,
values
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"type_url between"
,
value1
,
value2
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"type_url not between"
,
value1
,
value2
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlLike
(
String
value
)
{
addCriterion
(
"type_url like"
,
value
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeUrlNotLike
(
String
value
)
{
addCriterion
(
"type_url not like"
,
value
,
"typeUrl"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"type is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNotNull
()
{
addCriterion
(
"type is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeEqualTo
(
String
value
)
{
addCriterion
(
"type ="
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotEqualTo
(
String
value
)
{
addCriterion
(
"type <>"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIn
(
List
<
String
>
values
)
{
addCriterion
(
"type in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"type not in"
,
values
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"type between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"type not between"
,
value1
,
value2
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeLike
(
String
value
)
{
addCriterion
(
"type like"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeNotLike
(
String
value
)
{
addCriterion
(
"type not like"
,
value
,
"type"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesIsNull
()
{
addCriterion
(
"ref_block_bytes is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesIsNotNull
()
{
addCriterion
(
"ref_block_bytes is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesEqualTo
(
String
value
)
{
addCriterion
(
"ref_block_bytes ="
,
value
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesNotEqualTo
(
String
value
)
{
addCriterion
(
"ref_block_bytes <>"
,
value
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesIn
(
List
<
String
>
values
)
{
addCriterion
(
"ref_block_bytes in"
,
values
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"ref_block_bytes not in"
,
values
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"ref_block_bytes between"
,
value1
,
value2
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"ref_block_bytes not between"
,
value1
,
value2
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesLike
(
String
value
)
{
addCriterion
(
"ref_block_bytes like"
,
value
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockBytesNotLike
(
String
value
)
{
addCriterion
(
"ref_block_bytes not like"
,
value
,
"refBlockBytes"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashIsNull
()
{
addCriterion
(
"ref_block_hash is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashIsNotNull
()
{
addCriterion
(
"ref_block_hash is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashEqualTo
(
String
value
)
{
addCriterion
(
"ref_block_hash ="
,
value
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashNotEqualTo
(
String
value
)
{
addCriterion
(
"ref_block_hash <>"
,
value
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashIn
(
List
<
String
>
values
)
{
addCriterion
(
"ref_block_hash in"
,
values
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"ref_block_hash not in"
,
values
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"ref_block_hash between"
,
value1
,
value2
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"ref_block_hash not between"
,
value1
,
value2
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashLike
(
String
value
)
{
addCriterion
(
"ref_block_hash like"
,
value
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRefBlockHashNotLike
(
String
value
)
{
addCriterion
(
"ref_block_hash not like"
,
value
,
"refBlockHash"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationIsNull
()
{
addCriterion
(
"expiration is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationIsNotNull
()
{
addCriterion
(
"expiration is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationEqualTo
(
Long
value
)
{
addCriterion
(
"expiration ="
,
value
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationNotEqualTo
(
Long
value
)
{
addCriterion
(
"expiration <>"
,
value
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationIn
(
List
<
Long
>
values
)
{
addCriterion
(
"expiration in"
,
values
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"expiration not in"
,
values
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"expiration between"
,
value1
,
value2
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"expiration not between"
,
value1
,
value2
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationGreaterThan
(
Long
value
)
{
addCriterion
(
"expiration >"
,
value
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"expiration >="
,
value
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationLessThan
(
Long
value
)
{
addCriterion
(
"expiration <"
,
value
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andExpirationLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"expiration <="
,
value
,
"expiration"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitIsNull
()
{
addCriterion
(
"fee_limit is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitIsNotNull
()
{
addCriterion
(
"fee_limit is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitEqualTo
(
Long
value
)
{
addCriterion
(
"fee_limit ="
,
value
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitNotEqualTo
(
Long
value
)
{
addCriterion
(
"fee_limit <>"
,
value
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitIn
(
List
<
Long
>
values
)
{
addCriterion
(
"fee_limit in"
,
values
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"fee_limit not in"
,
values
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"fee_limit between"
,
value1
,
value2
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"fee_limit not between"
,
value1
,
value2
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitGreaterThan
(
Long
value
)
{
addCriterion
(
"fee_limit >"
,
value
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"fee_limit >="
,
value
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitLessThan
(
Long
value
)
{
addCriterion
(
"fee_limit <"
,
value
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFeeLimitLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"fee_limit <="
,
value
,
"feeLimit"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampIsNull
()
{
addCriterion
(
"timestamp is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampIsNotNull
()
{
addCriterion
(
"timestamp is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp ="
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampNotEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp <>"
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampIn
(
List
<
Long
>
values
)
{
addCriterion
(
"timestamp in"
,
values
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"timestamp not in"
,
values
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"timestamp between"
,
value1
,
value2
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"timestamp not between"
,
value1
,
value2
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampGreaterThan
(
Long
value
)
{
addCriterion
(
"timestamp >"
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp >="
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampLessThan
(
Long
value
)
{
addCriterion
(
"timestamp <"
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTimestampLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"timestamp <="
,
value
,
"timestamp"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"create_time ="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <>"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time not in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time not between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"create_time >"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time >="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThan
(
Date
value
)
{
addCriterion
(
"create_time <"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberIsNull
()
{
addCriterion
(
"number is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberIsNotNull
()
{
addCriterion
(
"number is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberEqualTo
(
Long
value
)
{
addCriterion
(
"number ="
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberNotEqualTo
(
Long
value
)
{
addCriterion
(
"number <>"
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberIn
(
List
<
Long
>
values
)
{
addCriterion
(
"number in"
,
values
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"number not in"
,
values
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"number between"
,
value1
,
value2
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"number not between"
,
value1
,
value2
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberGreaterThan
(
Long
value
)
{
addCriterion
(
"number >"
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"number >="
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberLessThan
(
Long
value
)
{
addCriterion
(
"number <"
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andNumberLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"number <="
,
value
,
"number"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNotNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" = "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <> "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" not in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" not between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" > "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" >= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" < "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" not like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
src/main/java/com/wuban/tron/explore/entity/example/TransactionHexExample.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
entity
.
example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 区块交易hex表 查询条件example类
* @author sky
* @date 2020-11-03
*/
public
class
TransactionHexExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
TransactionHexExample
()
{
oredCriteria
=
new
ArrayList
<>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexIsNull
()
{
addCriterion
(
"hex is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexIsNotNull
()
{
addCriterion
(
"hex is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexEqualTo
(
String
value
)
{
addCriterion
(
"hex ="
,
value
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexNotEqualTo
(
String
value
)
{
addCriterion
(
"hex <>"
,
value
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexIn
(
List
<
String
>
values
)
{
addCriterion
(
"hex in"
,
values
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"hex not in"
,
values
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"hex between"
,
value1
,
value2
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"hex not between"
,
value1
,
value2
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexLike
(
String
value
)
{
addCriterion
(
"hex like"
,
value
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andHexNotLike
(
String
value
)
{
addCriterion
(
"hex not like"
,
value
,
"hex"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIsNull
()
{
addCriterion
(
"block_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIsNotNull
()
{
addCriterion
(
"block_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdEqualTo
(
String
value
)
{
addCriterion
(
"block_id ="
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotEqualTo
(
String
value
)
{
addCriterion
(
"block_id <>"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"block_id in"
,
values
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"block_id not in"
,
values
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"block_id between"
,
value1
,
value2
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"block_id not between"
,
value1
,
value2
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdLike
(
String
value
)
{
addCriterion
(
"block_id like"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andBlockIdNotLike
(
String
value
)
{
addCriterion
(
"block_id not like"
,
value
,
"blockId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdIsNull
()
{
addCriterion
(
"tx_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdIsNotNull
()
{
addCriterion
(
"tx_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdEqualTo
(
String
value
)
{
addCriterion
(
"tx_id ="
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotEqualTo
(
String
value
)
{
addCriterion
(
"tx_id <>"
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"tx_id in"
,
values
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"tx_id not in"
,
values
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"tx_id between"
,
value1
,
value2
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"tx_id not between"
,
value1
,
value2
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdLike
(
String
value
)
{
addCriterion
(
"tx_id like"
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTxIdNotLike
(
String
value
)
{
addCriterion
(
"tx_id not like"
,
value
,
"txId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureIsNull
()
{
addCriterion
(
"signature is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureIsNotNull
()
{
addCriterion
(
"signature is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureEqualTo
(
String
value
)
{
addCriterion
(
"signature ="
,
value
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureNotEqualTo
(
String
value
)
{
addCriterion
(
"signature <>"
,
value
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureIn
(
List
<
String
>
values
)
{
addCriterion
(
"signature in"
,
values
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"signature not in"
,
values
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"signature between"
,
value1
,
value2
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"signature not between"
,
value1
,
value2
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureLike
(
String
value
)
{
addCriterion
(
"signature like"
,
value
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSignatureNotLike
(
String
value
)
{
addCriterion
(
"signature not like"
,
value
,
"signature"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"create_time ="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <>"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time not in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time not between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"create_time >"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time >="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThan
(
Date
value
)
{
addCriterion
(
"create_time <"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIsNotNull
(
final
String
fieldName
)
{
addCriterion
(
fieldName
+
" is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" = "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <> "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotIn
(
final
String
fieldName
,
final
List
<
Object
>
values
)
{
addCriterion
(
fieldName
+
" not in "
,
values
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotBetween
(
final
String
fieldName
,
final
Object
fieldValue1
,
final
Object
fieldValue2
)
{
addCriterion
(
fieldName
+
" not between "
,
fieldValue1
,
fieldValue2
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" > "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldGreaterThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" >= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThan
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" < "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLessThanOrEqualTo
(
final
String
fieldName
,
final
Object
fieldValue
)
{
addCriterion
(
fieldName
+
" <= "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
public
Criteria
andFieldNotLike
(
final
String
fieldName
,
final
String
fieldValue
)
{
addCriterion
(
fieldName
+
" not like "
,
fieldValue
,
fieldName
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
src/main/java/com/wuban/tron/explore/fetch/AccountBalanceTask.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
com.wuban.tron.explore.constant.Constant
;
import
com.wuban.tron.explore.domain.TronAccount
;
import
com.wuban.tron.explore.entity.Address
;
import
com.wuban.tron.explore.service.AddressService
;
import
com.wuban.tron.explore.service.TronService
;
import
com.wuban.tron.explore.util.SpringContextUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.CollectionUtils
;
import
java.util.Set
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* <core>账户余额处理者服务接口方法实现类</core>
*
* @author sky
* @date 2020/11/04
*/
@Slf4j
public
class
AccountBalanceTask
extends
Job
{
private
AddressService
addressService
=
SpringContextUtil
.
getBean
(
AddressService
.
class
);
private
static
final
int
SIZE
=
5
;
private
String
name
=
"AccountBalanceThreadPool"
;
private
static
ThreadPoolExecutor
threadPool
;
private
TronService
tronService
=
SpringContextUtil
.
getBean
(
TronService
.
class
);
private
Set
<
String
>
dataSet
;
public
AccountBalanceTask
()
{
}
public
AccountBalanceTask
(
Set
<
String
>
dataSet
)
{
this
.
dataSet
=
dataSet
;
initPool
();
}
public
void
fetch
(
String
address
)
{
TronAccount
tronAccount
=
this
.
tronService
.
getAccount
(
address
);
if
(
tronAccount
!=
null
)
{
if
(
tronAccount
.
getBalance
()
!=
null
)
{
Address
obj
=
new
Address
();
obj
.
setAddress
(
address
);
obj
.
setBalance
(
tronAccount
.
getBalance
());
this
.
addressService
.
updateById
(
obj
);
log
.
info
(
"更新账户余额 account:{}"
,
obj
.
toString
());
}
}
}
@Override
public
boolean
execute
()
{
if
(!
CollectionUtils
.
isEmpty
(
dataSet
))
{
dataSet
.
forEach
(
o
->
threadPool
.
execute
(()
->
fetch
(
o
)));
}
return
true
;
}
public
synchronized
void
initPool
()
{
if
(
threadPool
==
null
)
{
threadPool
=
new
ThreadPoolExecutor
(
SIZE
,
SIZE
*
2
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ExecutorThreadFactory
());
log
.
info
(
"初始化线程池 name:{} coreSize:{} maxSize:{}"
,
name
,
SIZE
,
SIZE
*
2
);
}
}
/**
* The match engine thread factory
*/
private
class
ExecutorThreadFactory
implements
ThreadFactory
{
private
final
ThreadGroup
group
;
private
final
AtomicInteger
threadNumber
=
new
AtomicInteger
(
1
);
private
final
String
namePrefix
;
ExecutorThreadFactory
()
{
final
SecurityManager
s
=
System
.
getSecurityManager
();
this
.
group
=
(
s
!=
null
)
?
s
.
getThreadGroup
()
:
Thread
.
currentThread
().
getThreadGroup
();
this
.
namePrefix
=
"excutor-"
+
AccountBalanceTask
.
this
.
name
+
"-thread-"
;
}
@Override
public
Thread
newThread
(
final
Runnable
r
)
{
final
Thread
t
=
new
Thread
(
this
.
group
,
r
,
this
.
namePrefix
+
this
.
threadNumber
.
getAndIncrement
(),
0
);
if
(
t
.
isDaemon
())
{
t
.
setDaemon
(
false
);
}
if
(
t
.
getPriority
()
!=
Thread
.
NORM_PRIORITY
)
{
t
.
setPriority
(
Thread
.
NORM_PRIORITY
);
}
return
t
;
}
}
}
src/main/java/com/wuban/tron/explore/fetch/BlockDataFetcher.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
com.wuban.tron.explore.constant.Constant
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
com.wuban.tron.explore.service.LastBlockService
;
import
com.wuban.tron.explore.service.TronService
;
import
com.wuban.tron.explore.util.SpringContextUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <core>区块数据抓取者服务接口方法实现类</core>
*
* @author sky
* @date 2020/11/04
*/
@Slf4j
public
class
BlockDataFetcher
<
T
>
extends
Job
implements
IBlockDataFetcher
{
private
TronService
tronService
;
private
LastBlockService
lastBlockService
;
private
IBlockDataHandler
handler
;
private
StringRedisTemplate
stringRedisTemplate
;
BlockDataFetcher
(
final
BlockDataHandler
handler
)
{
this
.
handler
=
handler
;
//lastBlockService = SpringContextUtil.getBean(LastBlockService.class);
tronService
=
SpringContextUtil
.
getBean
(
TronService
.
class
);
stringRedisTemplate
=
SpringContextUtil
.
getBean
(
StringRedisTemplate
.
class
);
}
@Override
public
List
fetch
()
{
List
<
TronResponseData
>
dataList
=
new
ArrayList
<>();
Long
num
=
0L
;
try
{
/* // 数据库获取区块高度
num = this.lastBlockService.getForUpdate(1L);*/
// Redis 获取区块高度
String
blockNumStr
=
this
.
stringRedisTemplate
.
opsForList
().
rightPop
(
Constant
.
BLOCK_NUM_LIST_KEY
);
if
(!
StringUtils
.
isEmpty
(
blockNumStr
))
{
num
=
Long
.
valueOf
(
blockNumStr
);
TronResponseData
data
=
tronService
.
getBlockByNum
(
num
);
if
(
data
!=
null
)
{
log
.
info
(
"已抓取数据区块高度 num:{}"
,
num
);
dataList
.
add
(
data
);
}
}
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
(),
e
);
log
.
error
(
"区块高度 num:{}同步DB失败"
,
num
);
}
return
dataList
;
}
@Override
public
void
send
(
List
list
)
throws
InterruptedException
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
;
}
this
.
handler
.
receive
(
list
);
}
@Override
public
boolean
execute
()
{
try
{
final
List
<
T
>
list
=
fetch
();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
false
;
}
send
(
list
);
return
true
;
}
catch
(
final
Exception
e
)
{
log
.
error
(
"fetch exception"
,
e
);
return
false
;
}
}
}
src/main/java/com/wuban/tron/explore/fetch/BlockDataHandler.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
com.wuban.tron.explore.service.TransactionService
;
import
com.wuban.tron.explore.util.SpringContextUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
import
java.util.concurrent.LinkedBlockingQueue
;
/**
* <core>区块数据处理者服务接口方法实现类</core>
*
* @author sky
* @date 2020/11/04
*/
@Slf4j
public
class
BlockDataHandler
extends
Job
implements
IBlockDataHandler
{
private
TransactionService
transactionService
;
private
PersistThreadPool
threadPool
;
private
final
LinkedBlockingQueue
<
List
<
TronResponseData
>>
dataList
;
BlockDataHandler
()
{
this
.
dataList
=
new
LinkedBlockingQueue
<>();
transactionService
=
SpringContextUtil
.
getBean
(
TransactionService
.
class
);
if
(
transactionService
!=
null
)
{
this
.
transactionService
.
init
();
}
threadPool
=
new
PersistThreadPool
();
}
@Override
public
boolean
execute
()
{
final
List
<
TronResponseData
>
list
=
this
.
dataList
.
poll
();
if
(
list
!=
null
&&
list
.
size
()
!=
0
)
{
threadPool
.
getPool
().
execute
(()
->
flush
(
list
));
}
return
true
;
}
@Override
public
void
receive
(
List
e
)
throws
InterruptedException
{
if
(!
CollectionUtils
.
isEmpty
(
e
))
{
this
.
dataList
.
put
(
e
);
}
}
@Override
public
void
flush
(
List
e
)
{
this
.
transactionService
.
save
(
e
);
}
}
src/main/java/com/wuban/tron/explore/fetch/Engine.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
lombok.extern.slf4j.Slf4j
;
/**
* <core>区块服务引擎</core>
*
* @author sky
* @date 2020/11/04
*/
@Slf4j
public
class
Engine
{
/**
* 线程池
*/
private
Executor
executor
;
/**
* 监控线程,负责异常重启
*/
private
Thread
monitor
;
/**
* 区块数据猎手
*/
private
BlockDataFetcher
<
TronResponseData
>
fetcher
;
/**
* 区块数据处理者
*/
private
BlockDataHandler
handler
;
public
Engine
(
String
name
)
{
this
.
executor
=
new
Executor
(
name
);
this
.
monitor
=
new
Thread
(()
->
{
while
(!
Thread
.
currentThread
().
isInterrupted
())
{
try
{
Thread
.
sleep
(
1000
);
if
(
this
.
handler
!=
null
&&
this
.
handler
.
isShutdown
())
{
log
.
error
(
"{} engine shutdown now restart "
,
name
);
reload
();
}
}
catch
(
final
InterruptedException
e
)
{
log
.
error
(
"{} engine monitor interrupted "
,
name
);
break
;
}
catch
(
final
Exception
e
)
{
log
.
error
(
"{} engine monitor error "
,
name
,
e
);
}
}
},
name
.
concat
(
"_monitor"
));
this
.
monitor
.
start
();
}
public
synchronized
void
start
()
{
this
.
handler
=
new
BlockDataHandler
();
this
.
fetcher
=
new
BlockDataFetcher
(
this
.
handler
);
this
.
executor
.
execute
(
this
.
handler
);
//int cupNum = ThreadPoolUtil.getCupNum()*2;
for
(
int
i
=
0
;
i
<=
10
;
i
++)
{
this
.
executor
.
execute
(
this
.
fetcher
);
}
}
public
synchronized
void
reload
()
{
this
.
executor
.
shutdown
();
this
.
executor
.
rebuild
();
start
();
}
}
src/main/java/com/wuban/tron/explore/fetch/Executor.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
com.wuban.tron.explore.constant.Constant
;
import
com.wuban.tron.explore.util.ThreadPoolUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
@Slf4j
public
class
Executor
{
private
static
final
int
SIZE
=
20
;
private
final
List
<
Job
>
jobList
=
new
ArrayList
<>();
private
final
String
name
;
private
ThreadPoolExecutor
pool
;
public
Executor
(
final
String
name
)
{
this
.
name
=
name
;
this
.
pool
=
new
ThreadPoolExecutor
(
SIZE
,
SIZE
*
2
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ExecutorThreadFactory
());
log
.
info
(
"初始化线程池 name:{} coreSize:{} maxSize:{}"
,
name
,
SIZE
,
SIZE
*
2
);
}
public
Executor
(
final
String
name
,
final
int
size
)
{
this
.
name
=
name
;
this
.
pool
=
new
ThreadPoolExecutor
(
size
,
size
*
2
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ExecutorThreadFactory
());
log
.
info
(
"初始化线程池 name:{} coreSize:{} maxSize:{}"
,
name
,
size
,
size
*
2
);
}
public
void
execute
(
final
Job
r
)
{
this
.
pool
.
execute
(
r
);
this
.
jobList
.
add
(
r
);
}
public
void
shutdown
()
{
this
.
jobList
.
forEach
(
job
->
job
.
shutdown
());
ThreadPoolUtil
.
ensureShutdown
(
this
.
pool
);
}
public
void
rebuild
()
{
this
.
pool
=
new
ThreadPoolExecutor
(
SIZE
,
SIZE
,
0L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
ExecutorThreadFactory
());
}
/**
* The match engine thread factory
*/
private
class
ExecutorThreadFactory
implements
ThreadFactory
{
private
final
ThreadGroup
group
;
private
final
AtomicInteger
threadNumber
=
new
AtomicInteger
(
1
);
private
final
String
namePrefix
;
ExecutorThreadFactory
()
{
final
SecurityManager
s
=
System
.
getSecurityManager
();
this
.
group
=
(
s
!=
null
)
?
s
.
getThreadGroup
()
:
Thread
.
currentThread
().
getThreadGroup
();
this
.
namePrefix
=
"excutor-"
+
Executor
.
this
.
name
+
"-thread-"
;
}
@Override
public
Thread
newThread
(
final
Runnable
r
)
{
final
Thread
t
=
new
Thread
(
this
.
group
,
r
,
this
.
namePrefix
+
this
.
threadNumber
.
getAndIncrement
(),
0
);
if
(
t
.
isDaemon
())
{
t
.
setDaemon
(
false
);
}
if
(
t
.
getPriority
()
!=
Thread
.
NORM_PRIORITY
)
{
t
.
setPriority
(
Thread
.
NORM_PRIORITY
);
}
return
t
;
}
}
}
src/main/java/com/wuban/tron/explore/fetch/IBlockDataFetcher.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
java.util.List
;
/**
* <core>区块数据抓取者服务接口方法</core>
*
* @author sky
* @date 2020/11/04
*/
public
interface
IBlockDataFetcher
<
T
>
{
List
<
T
>
fetch
();
void
send
(
final
List
<
T
>
orders
)
throws
InterruptedException
;
}
src/main/java/com/wuban/tron/explore/fetch/IBlockDataHandler.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
java.util.List
;
/**
* <core>区块数据处理者服务接口方法</core>
*
* @author sky
* @date 2020/11/04
*/
public
interface
IBlockDataHandler
<
T
>
{
/**
* 接收区块数据
*
* @param e 区块数据
* @throws InterruptedException 异常
*/
void
receive
(
List
<
T
>
e
)
throws
InterruptedException
;
/**
* 数据刷入DB
*
* @param e 区块数据
*/
void
flush
(
List
<
T
>
e
);
}
src/main/java/com/wuban/tron/explore/fetch/Job.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
lombok.extern.slf4j.Slf4j
;
/**
* <core>任务类</core>
*
* @author sky
* @date 2020/11/04
*/
@Slf4j
public
abstract
class
Job
implements
Runnable
{
/**
* 是否循环执行
*/
private
volatile
boolean
loop
;
public
Job
()
{
this
.
loop
=
true
;}
public
Job
(
final
boolean
loop
)
{
this
.
loop
=
loop
;
}
@Override
public
void
run
()
{
do
{
execute
();
}
while
(
this
.
loop
&&
!
Thread
.
currentThread
().
isInterrupted
());
}
public
void
shutdown
()
{
this
.
loop
=
false
;
}
public
boolean
isShutdown
()
{
return
!
this
.
loop
;
}
public
abstract
boolean
execute
();
}
src/main/java/com/wuban/tron/explore/fetch/PersistThreadPool.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
fetch
;
import
com.wuban.tron.explore.util.ThreadPoolUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Random
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* @author sky
*
*/
@Slf4j
public
class
PersistThreadPool
{
private
static
final
int
POLL_SIZE
=
ThreadPoolUtil
.
getCupNum
();
public
final
List
<
ThreadPoolExecutor
>
executors
=
new
ArrayList
<>(
POLL_SIZE
);
public
PersistThreadPool
()
{
for
(
int
i
=
0
;
i
<
POLL_SIZE
;
i
++)
{
executors
.
add
(
new
ThreadPoolExecutor
(
POLL_SIZE
,
POLL_SIZE
*
5
,
30L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(),
new
PersistThreadFactory
(
i
)));
}
log
.
info
(
"初始化线程池 name:{} coreSize:{} maxSize:{}"
,
"PersistThreadPool"
,
POLL_SIZE
,
POLL_SIZE
*
5
);
}
public
void
stop
()
{
for
(
final
ThreadPoolExecutor
executor
:
executors
)
{
ThreadPoolUtil
.
ensureShutdown
(
executor
);
}
}
public
ThreadPoolExecutor
getPool
()
{
Random
random
=
new
Random
();
int
index
=
random
.
nextInt
(
POLL_SIZE
);
return
executors
.
get
(
index
);
}
/**
* The persist thread factory
*/
static
class
PersistThreadFactory
implements
ThreadFactory
{
private
static
final
AtomicInteger
poolNumber
=
new
AtomicInteger
(
1
);
private
final
ThreadGroup
group
;
private
final
AtomicInteger
threadNumber
=
new
AtomicInteger
(
1
);
private
final
String
namePrefix
;
PersistThreadFactory
(
final
int
index
)
{
final
SecurityManager
s
=
System
.
getSecurityManager
();
this
.
group
=
(
s
!=
null
)
?
s
.
getThreadGroup
()
:
Thread
.
currentThread
().
getThreadGroup
();
this
.
namePrefix
=
"persist-pool"
+
index
+
"-"
+
poolNumber
.
getAndIncrement
()
+
"-thread-"
;
}
@Override
public
Thread
newThread
(
final
Runnable
r
)
{
final
Thread
t
=
new
Thread
(
this
.
group
,
r
,
this
.
namePrefix
+
this
.
threadNumber
.
getAndIncrement
(),
0
);
if
(
t
.
isDaemon
())
{
t
.
setDaemon
(
false
);
}
if
(
t
.
getPriority
()
!=
Thread
.
NORM_PRIORITY
)
{
t
.
setPriority
(
Thread
.
NORM_PRIORITY
);
}
return
t
;
}
}
}
src/main/java/com/wuban/tron/explore/param/request/CensusRequest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
param
.
request
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
CensusRequest
{
@NotNull
private
String
startDate
;
private
String
endDate
;
}
src/main/java/com/wuban/tron/explore/param/request/PageRequest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
param
.
request
;
import
lombok.Data
;
@Data
public
class
PageRequest
{
private
Integer
startIndex
;
private
Integer
pageSize
;
}
src/main/java/com/wuban/tron/explore/param/request/SearchRequest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
param
.
request
;
import
lombok.Data
;
@Data
public
class
SearchRequest
extends
PageRequest
{
private
String
condition
;
private
int
type
;
}
src/main/java/com/wuban/tron/explore/param/response/SelfPageInfo.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
param
.
response
;
import
lombok.Data
;
import
java.util.List
;
/**
* 分页结果类
* @author wuban-team
* @date 2020-10-15
*/
@Data
public
class
SelfPageInfo
<
T
>
{
/**
* 总记录数
*/
private
Long
totalItems
;
/**
* 总页数
*/
private
Integer
totalPages
;
/**
* 列表数据
*/
private
List
<
T
>
list
;
}
src/main/java/com/wuban/tron/explore/param/response/TransactionModel.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
param
.
response
;
import
lombok.Data
;
@Data
public
class
TransactionModel
{
private
Long
number
;
private
String
txId
;
private
String
from
;
private
String
to
;
private
Long
amount
;
}
src/main/java/com/wuban/tron/explore/service/AddressService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.wuban.tron.explore.entity.Address
;
import
com.wuban.tron.explore.entity.example.AddressExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
AddressService
{
/**
* 批量添加、更新账户地址信息
*
* @param records
*/
void
batchInsertOnDuplicateKey
(
@Param
(
"records"
)
List
<
Address
>
records
);
/**
* 修改账户信息
*
* @param record
*/
void
updateById
(
@Param
(
"record"
)
Address
record
);
/**
* 获取账户地址信息
*
* @param example 查询条件参数
* @return 记录
*/
Address
selectOneByExample
(
@Param
(
"example"
)
AddressExample
example
);
}
src/main/java/com/wuban/tron/explore/service/BaseCommonService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.wuban.tron.explore.constant.Constant
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.*
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* <core>公用服务接口方法</core>
*
* @author sky
* @date 2020/11/02
*/
@Slf4j
public
abstract
class
BaseCommonService
{
private
static
final
String
PREFIX
=
"/walletsolidity"
;
/**
* 按照高度查询block API
*/
protected
static
final
String
GET_BLOCK_BYNUM
=
PREFIX
+
"/getblockbynum"
;
/**
* 查询最新的几个块
*/
protected
static
final
String
GET_BLOCK_BYLATESTNUM
=
PREFIX
+
"/getblockbylatestnum"
;
/**
* 查询账户信息
*/
protected
static
final
String
GET_ACCOUNT
=
PREFIX
+
"/getaccount"
;
/**
* http请求
*
* @param executeRequest Request
*
* @return String
*/
protected
String
execute
(
Request
executeRequest
)
{
Response
response
=
null
;
String
str
=
null
;
try
{
OkHttpClient
okHttpClient
=
new
OkHttpClient
();
okHttpClient
.
newBuilder
()
.
connectTimeout
(
1
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
2
,
TimeUnit
.
SECONDS
);
response
=
okHttpClient
.
newCall
(
executeRequest
).
execute
();
ResponseBody
body
=
response
.
body
();
if
(
response
.
code
()
==
Constant
.
SUCCESS_CODE
&&
body
!=
null
)
{
str
=
body
.
string
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
if
(
response
!=
null
)
{
response
.
close
();
}
}
return
str
;
}
/**
* 构建签名
*
* @param uri 合约方法名称
* @param paramMap 请求参数
* @return Request
*/
protected
Request
builder
(
String
uri
,
Map
<
String
,
Object
>
paramMap
)
{
String
param
=
JSON
.
toJSONString
(
paramMap
);
RequestBody
postBody
=
RequestBody
.
create
(
param
,
Constant
.
JSON_TYPE
);
return
new
Request
.
Builder
().
url
(
Constant
.
HOST
+
uri
).
post
(
postBody
)
.
addHeader
(
Constant
.
CONTENT_TYPE_KEY
,
Constant
.
CONTENT_TYPE_VAL
).
build
();
}
}
src/main/java/com/wuban/tron/explore/service/BlockDayCensusService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.entity.BlockDayCensus
;
import
com.wuban.tron.explore.entity.example.BlockDayCensusExample
;
import
java.util.List
;
public
interface
BlockDayCensusService
{
/**
* 分页查询
*
* @param startIndex 页码
* @param pageSize 每页记录数
* @param example 检索条件
* @return 分页列表
*/
PageInfo
<
BlockDayCensus
>
getByPageWithCategory
(
Integer
startIndex
,
Integer
pageSize
,
BlockDayCensusExample
example
);
List
<
BlockDayCensus
>
getByExample
(
BlockDayCensusExample
example
);
}
src/main/java/com/wuban/tron/explore/service/BlockHeaderService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.wuban.tron.explore.entity.BlockHeader
;
import
com.wuban.tron.explore.entity.example.BlockHeaderExample
;
import
org.apache.ibatis.annotations.Param
;
public
interface
BlockHeaderService
{
/**
* 根据条件检索区块头信息
*
* @param example 检索条件
* @return
*/
BlockHeader
getOneByExample
(
@Param
(
"example"
)
BlockHeaderExample
example
);
}
src/main/java/com/wuban/tron/explore/service/LastBlockService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.wuban.tron.explore.entity.LastBlock
;
/**
* <core>区块高度服务接口</core>
*
* @author sky
* @date 2020/11/02
*/
public
interface
LastBlockService
{
/**
* 获取区块高度信息
* @param id 唯一标识
* @return LastBlock
*/
LastBlock
getByIdForUpdate
(
Long
id
);
/**
* 获取区块高度信息:并且更新此高度+1
* @param id 唯一标识
* @return Long
*/
Long
getForUpdate
(
Long
id
);
/**
* 获取区块高度信息
* @return LastBlock
*/
LastBlock
getOneByExample
();
/**
* 刷新区块高度:
* <ul>
* <li>1.系统已设置的区块高度</li>
* <li>2.波场最新的区块高度</li>
* </ul>
*/
void
refresh
();
/**
* 根据DB cur_block_num 同步固定批次的区块号
*/
void
sync
();
}
src/main/java/com/wuban/tron/explore/service/TransactionService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
com.wuban.tron.explore.entity.Transaction
;
import
com.wuban.tron.explore.entity.example.TransactionExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <core>区块服务接口方法</core>
*
* @author sky
* @date 2020/11/02
*/
public
interface
TransactionService
{
/**
* 持久化区块头、交易、hex信息
*
* @param dataList
*/
void
save
(
List
<
TronResponseData
>
dataList
);
Long
getBlockMinTime
();
/**
* 统计区块信息:前一天数据
*/
void
censusBlockByLastDay
();
/**
* 统计区块信息:根据具体日期统计
*
* @param startDate 开始日期:yyyy-MM-dd
* @param endDate 结束日期:yyyy-MM-dd
*/
void
censusBlockByDate
(
String
startDate
,
String
endDate
);
/**
* 分页查询
*
* @param startIndex 页码
* @param pageSize 每页记录数
* @param example 检索条件
* @return 分页列表
*/
PageInfo
<
Transaction
>
getByPageWithCategory
(
Integer
startIndex
,
Integer
pageSize
,
TransactionExample
example
);
/**
* 根据条件检索
*
* @param example 检索条件
* @return
*/
List
<
Transaction
>
getByExample
(
@Param
(
"example"
)
TransactionExample
example
);
/**
* 根据账户地址查询交易信息
*
* @param address 账户地址
*
* @param type
* <ul>
* <li>1: 7天交易</li>
* <li>2: 14天交易</li>
* <li>3: 30内交易</li>
* </ul>
*
* @param startIndex
* @param pageSize
* @return
*/
PageInfo
<
Transaction
>
selectListByAddress
(
String
address
,
int
type
,
Integer
startIndex
,
Integer
pageSize
);
void
init
();
}
src/main/java/com/wuban/tron/explore/service/TronService.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
;
import
com.wuban.tron.explore.domain.TronAccount
;
import
com.wuban.tron.explore.domain.TronResponseArrayData
;
import
com.wuban.tron.explore.domain.TronResponseData
;
/**
* <core>波场区块服务接口</core>
*
* @author sky
* @date 2020/11/02
*/
public
interface
TronService
{
/**
* 按照高度查询block
*
* @param blockNum 是块的高度
*/
TronResponseData
getBlockByNum
(
Long
blockNum
);
/**
* 查询最新的几个块
*
* @param num 块的数量
*/
TronResponseArrayData
getBlockByLatestNum
(
Integer
num
);
/**
* 根据地址获取账户信息
*
* @param address 账户地址
* @return 账号信息
*/
TronAccount
getAccount
(
String
address
);
}
src/main/java/com/wuban/tron/explore/service/impl/AddressServiceImpl.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.wuban.tron.explore.dao.AddressRepository
;
import
com.wuban.tron.explore.entity.Address
;
import
com.wuban.tron.explore.entity.example.AddressExample
;
import
com.wuban.tron.explore.service.AddressService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
AddressServiceImpl
implements
AddressService
{
private
final
AddressRepository
addressRepository
;
@Override
public
void
batchInsertOnDuplicateKey
(
List
<
Address
>
records
)
{
this
.
addressRepository
.
batchInsertOnDuplicateKey
(
records
);
}
@Override
public
void
updateById
(
Address
record
)
{
this
.
addressRepository
.
updateById
(
record
);
}
/**
* 获取账户地址信息
*
* @param example 查询条件参数
* @return 记录
*/
@Override
public
Address
selectOneByExample
(
AddressExample
example
)
{
return
this
.
addressRepository
.
selectOneByExample
(
example
);
}
}
src/main/java/com/wuban/tron/explore/service/impl/BlockDayCensusServiceImpl.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.constant.PageConstant
;
import
com.wuban.tron.explore.dao.BlockDayCensusRepository
;
import
com.wuban.tron.explore.entity.BlockDayCensus
;
import
com.wuban.tron.explore.entity.example.BlockDayCensusExample
;
import
com.wuban.tron.explore.service.BlockDayCensusService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
BlockDayCensusServiceImpl
implements
BlockDayCensusService
{
private
final
BlockDayCensusRepository
blockDayCensusRepository
;
/**
* 分页查询
*
* @param startIndex 页码
* @param pageSize 每页记录数
* @param example 检索条件
* @return 分页列表
*/
@Override
public
PageInfo
<
BlockDayCensus
>
getByPageWithCategory
(
Integer
startIndex
,
Integer
pageSize
,
BlockDayCensusExample
example
)
{
if
(
startIndex
==
null
)
{
startIndex
=
PageConstant
.
DEFAULT_START_INDEX
;
}
if
(
pageSize
==
null
)
{
pageSize
=
PageConstant
.
DEFAULT_PAGE_SIZE
;
}
if
(
pageSize
>
PageConstant
.
MAX_PAGE_SIZE
)
{
pageSize
=
PageConstant
.
MAX_PAGE_SIZE
;
}
PageHelper
.
startPage
(
startIndex
,
pageSize
);
example
.
setOrderByClause
(
"`census_date` DESC"
);
List
<
BlockDayCensus
>
list
=
this
.
blockDayCensusRepository
.
selectByPager
(
example
);
PageInfo
<
BlockDayCensus
>
pageInfo
=
new
PageInfo
<>(
list
);
return
pageInfo
;
}
@Override
public
List
<
BlockDayCensus
>
getByExample
(
BlockDayCensusExample
example
)
{
example
.
setOrderByClause
(
"`census_date`"
);
return
this
.
blockDayCensusRepository
.
selectByExample
(
example
);
}
}
src/main/java/com/wuban/tron/explore/service/impl/BlockHeaderServiceImpl.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.wuban.tron.explore.dao.BlockHeaderRepository
;
import
com.wuban.tron.explore.entity.BlockHeader
;
import
com.wuban.tron.explore.entity.example.BlockHeaderExample
;
import
com.wuban.tron.explore.service.BlockHeaderService
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
BlockHeaderServiceImpl
implements
BlockHeaderService
{
private
final
BlockHeaderRepository
blockHeaderRepository
;
/**
* 根据条件检索区块头信息
*
* @param example 检索条件
* @return
*/
@Override
public
BlockHeader
getOneByExample
(
BlockHeaderExample
example
)
{
return
blockHeaderRepository
.
selectOneByExample
(
example
);
}
}
src/main/java/com/wuban/tron/explore/service/impl/LastBlockServiceImpl.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.wuban.tron.explore.constant.Constant
;
import
com.wuban.tron.explore.dao.LastBlockRepository
;
import
com.wuban.tron.explore.domain.TronResponseArrayData
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
com.wuban.tron.explore.entity.LastBlock
;
import
com.wuban.tron.explore.entity.example.LastBlockExample
;
import
com.wuban.tron.explore.service.LastBlockService
;
import
com.wuban.tron.explore.service.TronService
;
import
com.wuban.tron.explore.util.BigDecimalUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.data.redis.connection.RedisConnection
;
import
org.springframework.data.redis.connection.StringRedisConnection
;
import
org.springframework.data.redis.core.RedisCallback
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.math.BigDecimal
;
/**
* <core>区块高度服务接口实现类</core>
*
* @author sky
* @date 2020/11/02
*/
@Service
@Slf4j
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
LastBlockServiceImpl
implements
LastBlockService
{
private
final
LastBlockRepository
lastBlockRepository
;
private
final
TronService
tronService
;
private
final
StringRedisTemplate
stringRedisTemplate
;
@Override
public
LastBlock
getByIdForUpdate
(
Long
id
)
{
return
lastBlockRepository
.
selectByIdForUpdate
(
id
);
}
/**
* 获取区块高度信息:并且更新此高度+1
*
* @param id 唯一标识
* @return Long
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
getForUpdate
(
Long
id
)
{
LastBlock
lastBlock
=
lastBlockRepository
.
selectByIdForUpdate
(
id
);
long
curBlockNum
=
lastBlock
.
getCurBlockNum
()
+
1
;
LastBlock
obj
=
new
LastBlock
();
obj
.
setId
(
lastBlock
.
getId
());
obj
.
setCurBlockNum
(
curBlockNum
);
this
.
lastBlockRepository
.
updateCurBlockNumById
(
obj
);
return
curBlockNum
;
}
/**
* 获取区块高度信息
*
* @return LastBlock
*/
@Override
public
LastBlock
getOneByExample
()
{
LastBlockExample
example
=
new
LastBlockExample
();
return
this
.
lastBlockRepository
.
selectOneByExample
(
example
);
}
@Override
public
void
refresh
()
{
Integer
latestNum
=
1
;
TronResponseArrayData
ret
=
this
.
tronService
.
getBlockByLatestNum
(
latestNum
);
if
(
ret
!=
null
&&
!
CollectionUtils
.
isEmpty
(
ret
.
getBlock
()))
{
TronResponseData
data
=
ret
.
getBlock
().
get
(
0
);
LastBlock
record
=
new
LastBlock
();
record
.
setId
(
1L
);
record
.
setLastBlockNum
(
data
.
getBlock_header
().
getRaw_data
().
getNumber
());
this
.
lastBlockRepository
.
updateById
(
record
);
log
.
info
(
"定时任务-已更新区块高度num:{}"
,
data
.
getBlock_header
().
getRaw_data
().
getNumber
());
}
}
/**
* 根据DB cur_block_num 同步固定批次的区块号
*/
@Override
public
void
sync
()
{
LastBlock
lastBlock
=
this
.
lastBlockRepository
.
selectOneByExample
(
null
);
if
(
lastBlock
==
null
)
{
return
;
}
/*
如果redis未缓存blockNum,从DB中获取
*/
BigDecimal
bg
;
BigDecimal
diff
;
long
startNum
;
long
endNum
;
String
redisBlockNum
=
this
.
stringRedisTemplate
.
opsForValue
().
get
(
Constant
.
BLOCK_NUM_KEY
);
if
(
StringUtils
.
isEmpty
(
redisBlockNum
))
{
startNum
=
lastBlock
.
getCurBlockNum
();
bg
=
BigDecimalUtil
.
getAdd
(
new
BigDecimal
(
lastBlock
.
getCurBlockNum
()),
new
BigDecimal
(
Constant
.
FIFTY_THOUSAND
));
}
else
{
startNum
=
Long
.
parseLong
(
redisBlockNum
);
if
(
startNum
-
Constant
.
THRESHOLD
>
0
)
{
return
;
}
bg
=
BigDecimalUtil
.
getAdd
(
new
BigDecimal
(
redisBlockNum
),
new
BigDecimal
(
Constant
.
FIFTY_THOUSAND
));
}
diff
=
BigDecimalUtil
.
getSubtract
(
bg
,
new
BigDecimal
(
lastBlock
.
getLastBlockNum
()));
// 判断已缓存 + BLOCK_NUM_KEY 是否超过区块的最大高度值
if
(
diff
.
longValue
()
<
0
)
{
this
.
stringRedisTemplate
.
opsForValue
().
set
(
Constant
.
BLOCK_NUM_KEY
,
bg
.
toPlainString
());
endNum
=
bg
.
longValue
();
}
else
{
// 替换掉"-"号,相当于去绝对值
this
.
stringRedisTemplate
.
opsForValue
().
set
(
Constant
.
BLOCK_NUM_KEY
,
lastBlock
.
getLastBlockNum
().
toString
());
endNum
=
lastBlock
.
getLastBlockNum
();
}
// 将区块高度同步到redis list中
this
.
stringRedisTemplate
.
executePipelined
(
new
RedisCallback
<
Object
>()
{
@Override
public
Object
doInRedis
(
RedisConnection
redisConnection
)
throws
DataAccessException
{
StringRedisConnection
conn
=
(
StringRedisConnection
)
redisConnection
;
for
(
long
i
=
startNum
;
i
<=
endNum
;
i
++)
{
conn
.
lPush
(
Constant
.
BLOCK_NUM_LIST_KEY
,
Long
.
toString
(
i
));
}
log
.
info
(
"sync redis block num start={},end={}"
,
startNum
,
endNum
);
return
null
;
}
});
}
}
src/main/java/com/wuban/tron/explore/service/impl/TransactionServiceImpl.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.constant.Constant
;
import
com.wuban.tron.explore.constant.PageConstant
;
import
com.wuban.tron.explore.dao.*
;
import
com.wuban.tron.explore.domain.*
;
import
com.wuban.tron.explore.entity.*
;
import
com.wuban.tron.explore.entity.example.TransactionExample
;
import
com.wuban.tron.explore.fetch.AccountBalanceTask
;
import
com.wuban.tron.explore.fetch.Executor
;
import
com.wuban.tron.explore.service.TransactionService
;
import
com.wuban.tron.explore.util.BigDecimalUtil
;
import
com.wuban.tron.explore.util.DateUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.*
;
@Slf4j
@Service
@RequiredArgsConstructor
(
onConstructor_
=
@Autowired
)
public
class
TransactionServiceImpl
implements
TransactionService
{
private
final
BlockHeaderRepository
blockHeaderRepository
;
private
final
TransactionRepository
transactionRepository
;
private
final
TransactionHexRepository
transactionHexRepository
;
private
final
BlockDayCensusRepository
blockDayCensusRepository
;
private
final
LastBlockRepository
lastBlockRepository
;
private
final
AddressRepository
addressRepository
;
private
Executor
excutor
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
save
(
List
<
TronResponseData
>
dataList
)
{
if
(!
CollectionUtils
.
isEmpty
(
dataList
))
{
List
<
BlockHeader
>
headerList
=
new
ArrayList
<>(
dataList
.
size
());
List
<
Transaction
>
transactionList
=
new
ArrayList
<>(
dataList
.
size
());
List
<
TransactionHex
>
hexList
=
new
ArrayList
<>(
dataList
.
size
());
dataList
.
forEach
(
o
->
{
TronBlockHeader
tronBlockHeader
=
o
.
getBlock_header
();
BlockHeader
header
=
transferBlockHeader
(
o
.
getBlockID
(),
tronBlockHeader
);
List
<
Transactions
>
trList
=
o
.
getTransactions
();
if
(
CollectionUtils
.
isEmpty
(
trList
))
{
header
.
setTransactionVolume
(
0
);
}
else
{
header
.
setTransactionVolume
(
trList
.
size
());
List
<
Transaction
>
list
=
transferTransaction
(
o
.
getBlockID
(),
trList
,
header
.
getNumber
());
transactionList
.
addAll
(
list
);
// hex设置
TransactionHex
hex
=
new
TransactionHex
();
trList
.
forEach
(
obj
->
{
hex
.
setBlockId
(
o
.
getBlockID
());
hex
.
setTxId
(
obj
.
getTxID
());
hex
.
setHex
(
obj
.
getRaw_data_hex
());
hex
.
setSignature
(
obj
.
getSignature
().
get
(
0
));
hex
.
setCreateTime
(
new
Date
());
hexList
.
add
(
hex
);
});
}
// 区块bytes设置
if
(!
CollectionUtils
.
isEmpty
(
transactionList
))
{
String
refBlockBytes
=
transactionList
.
get
(
0
).
getRefBlockBytes
();
String
blockBytes
=
new
BigInteger
(
refBlockBytes
,
16
).
toString
();
header
.
setBlockBytes
(
blockBytes
);
}
else
{
header
.
setBlockBytes
(
"0"
);
}
headerList
.
add
(
header
);
});
/*
区块头、区块交易、hex持久化
*/
this
.
blockHeaderRepository
.
batchInsert
(
headerList
);
Set
<
String
>
set
=
new
HashSet
<>();
if
(
transactionList
.
size
()
!=
0
)
{
transactionList
.
forEach
(
o
->
{
if
(!
StringUtils
.
isEmpty
(
o
.
getOwnerAddress
()))
{
set
.
add
(
o
.
getOwnerAddress
());
}
if
(!
StringUtils
.
isEmpty
(
o
.
getToAddress
()))
{
set
.
add
(
o
.
getToAddress
());
}
if
(!
StringUtils
.
isEmpty
(
o
.
getContractAddress
()))
{
set
.
add
(
o
.
getContractAddress
());
}
});
this
.
transactionRepository
.
batchInsert
(
transactionList
);
this
.
transactionHexRepository
.
batchInsert
(
hexList
);
}
// 更新区块高度
LastBlock
lastBlock
=
new
LastBlock
();
lastBlock
.
setId
(
1L
);
lastBlock
.
setCurBlockNum
(
headerList
.
get
(
0
).
getNumber
());
this
.
lastBlockRepository
.
updateCurBlockNumById
(
lastBlock
);
log
.
info
(
"已同步数据区块高度num:{}"
,
headerList
.
get
(
0
).
getNumber
());
List
<
Address
>
records
=
transferAddress
(
set
);
if
(!
CollectionUtils
.
isEmpty
(
records
))
{
this
.
addressRepository
.
batchInsertOnDuplicateKey
(
records
);
AccountBalanceTask
task
=
new
AccountBalanceTask
(
set
);
excutor
.
execute
(
task
);
}
}
}
/**
* 封装账户地址信息
*
* @param set 账户地址
* @return
*/
private
List
<
Address
>
transferAddress
(
Set
<
String
>
set
)
{
List
<
Address
>
list
=
new
ArrayList
<>();
set
.
forEach
(
o
->
{
Address
address
=
Address
.
builder
().
address
(
o
).
balance
(
0L
).
build
();
list
.
add
(
address
);
});
return
list
;
}
/**
* 封装区块头信息
*
* @param blockId 区块ID
* @param tronBlockHeader 区块头信息
* @return
*/
private
BlockHeader
transferBlockHeader
(
String
blockId
,
TronBlockHeader
tronBlockHeader
)
{
BlockHeader
header
=
new
BlockHeader
();
header
.
setBlockId
(
blockId
);
BlockHeaderRawData
rawData
=
tronBlockHeader
.
getRaw_data
();
header
.
setNumber
(
rawData
.
getNumber
());
header
.
setParentHash
(
rawData
.
getParentHash
());
header
.
setTxTrieRoot
(
rawData
.
getTxTrieRoot
());
header
.
setVersion
(
rawData
.
getVersion
());
header
.
setWitnessAddress
(
rawData
.
getWitness_address
());
header
.
setWitnessSignature
(
tronBlockHeader
.
getWitness_signature
());
header
.
setTimestamp
(
rawData
.
getTimestamp
());
header
.
setCreateTime
(
new
Date
());
return
header
;
}
/**
* 封装区块交易信息
*
* @param blockId 区块ID
* @param transactionsList 交易数据
* @param number 块高度
* @return
*/
private
List
<
Transaction
>
transferTransaction
(
String
blockId
,
List
<
Transactions
>
transactionsList
,
Long
number
)
{
List
<
Transaction
>
retList
=
new
ArrayList
<>(
transactionsList
.
size
());
transactionsList
.
forEach
(
o
->
{
TransactionsRawData
rawData
=
o
.
getRaw_data
();
Contract
contract
=
rawData
.
getContract
().
get
(
0
);
ContractParameter
contractParameter
=
contract
.
getParameter
();
ContractParameterValue
val
=
contractParameter
.
getValue
();
Transaction
tr
=
Transaction
.
builder
()
.
blockId
(
blockId
)
.
txId
(
o
.
getTxID
())
.
contractRet
(
o
.
getRet
().
get
(
0
).
getContractRet
())
.
expiration
(
rawData
.
getExpiration
())
.
timestamp
(
rawData
.
getTimestamp
())
.
refBlockBytes
(
rawData
.
getRef_block_bytes
())
.
refBlockHash
(
rawData
.
getRef_block_hash
())
.
feeLimit
(
rawData
.
getFee_limit
())
.
type
(
contract
.
getType
())
.
typeUrl
(
contractParameter
.
getType_url
())
.
amount
(
val
.
getAmount
())
.
data
(
val
.
getData
())
.
contractAddress
(
val
.
getContract_address
())
.
ownerAddress
(
val
.
getOwner_address
())
.
toAddress
(
val
.
getTo_address
())
.
createTime
(
new
Date
())
.
number
(
number
)
.
build
();
retList
.
add
(
tr
);
});
return
retList
;
}
public
synchronized
void
initExcutor
()
{
if
(
excutor
==
null
)
{
excutor
=
new
Executor
(
Constant
.
EXCUTOR_NAME_ACCOUNT
,
2
);
}
}
@Override
public
Long
getBlockMinTime
()
{
return
this
.
blockHeaderRepository
.
selectBlockMinTime
();
}
@Override
public
void
censusBlockByLastDay
()
{
Date
nextDate
=
DateUtil
.
addDays
(
new
Date
(),
-
1
);
String
date
=
DateUtil
.
getFormatDate
(
nextDate
,
DateUtil
.
PATTERN_YMD
);
String
startDate
=
date
+
" 00:00:00"
;
String
endDate
=
date
+
" 23:59:59"
;
this
.
census
(
date
,
startDate
,
endDate
);
}
@Override
public
void
censusBlockByDate
(
String
startDate
,
String
endDate
)
{
if
(
StringUtils
.
isEmpty
(
endDate
)
||
(
startDate
.
equals
(
endDate
)))
{
String
_startDate
=
startDate
+
" 00:00:00"
;
String
_endDate
=
startDate
+
" 23:59:59"
;
this
.
census
(
startDate
,
_startDate
,
_endDate
);
return
;
}
String
date
=
startDate
;
while
(
true
)
{
String
_startDate
=
date
+
" 00:00:00"
;
String
_endDate
=
date
+
" 23:59:59"
;
this
.
census
(
startDate
,
_startDate
,
_endDate
);
if
(
date
==
endDate
)
{
break
;
}
Date
nextDate
=
DateUtil
.
addDays
(
new
Date
(),
1
);
date
=
DateUtil
.
getFormatDate
(
nextDate
,
DateUtil
.
PATTERN_YMD
);
}
}
/**
* 分页查询
*
* @param startIndex 页码
* @param pageSize 每页记录数
* @param example 检索条件
* @return 分页列表
*/
@Override
public
PageInfo
<
Transaction
>
getByPageWithCategory
(
Integer
startIndex
,
Integer
pageSize
,
TransactionExample
example
)
{
if
(
startIndex
==
null
)
{
startIndex
=
PageConstant
.
DEFAULT_START_INDEX
;
}
if
(
pageSize
==
null
)
{
pageSize
=
PageConstant
.
DEFAULT_PAGE_SIZE
;
}
if
(
pageSize
>
PageConstant
.
MAX_PAGE_SIZE
)
{
pageSize
=
PageConstant
.
MAX_PAGE_SIZE
;
}
example
.
setOrderByClause
(
"`timestamp` DESC"
);
PageHelper
.
startPage
(
startIndex
,
pageSize
);
List
<
Transaction
>
list
=
this
.
transactionRepository
.
selectByPagerEx
(
example
);
PageInfo
<
Transaction
>
pageInfo
=
new
PageInfo
<>(
list
);
return
pageInfo
;
}
/**
* 根据条件检索
*
* @param example 检索条件
* @return
*/
@Override
public
List
<
Transaction
>
getByExample
(
TransactionExample
example
)
{
return
this
.
transactionRepository
.
selectByExample
(
example
);
}
@Override
public
PageInfo
<
Transaction
>
selectListByAddress
(
String
address
,
int
type
,
Integer
startIndex
,
Integer
pageSize
)
{
Date
date
;
switch
(
type
)
{
case
1
:
date
=
DateUtil
.
addDays
(
new
Date
(),
-
7
);
break
;
case
2
:
date
=
DateUtil
.
addDays
(
new
Date
(),
-
14
);
break
;
case
3
:
date
=
DateUtil
.
addDays
(
new
Date
(),
-
30
);
break
;
default
:
date
=
DateUtil
.
addDays
(
new
Date
(),
-
7
);
}
String
str
=
DateUtil
.
getFormatDate
(
date
,
DateUtil
.
PATTERN_YMD_HMS
);
long
t
=
DateUtil
.
getDateFromDateStr
(
str
);
if
(
startIndex
==
null
)
{
startIndex
=
PageConstant
.
DEFAULT_START_INDEX
;
}
if
(
pageSize
==
null
)
{
pageSize
=
PageConstant
.
DEFAULT_PAGE_SIZE
;
}
if
(
pageSize
>
PageConstant
.
MAX_PAGE_SIZE
)
{
pageSize
=
PageConstant
.
MAX_PAGE_SIZE
;
}
PageHelper
.
startPage
(
startIndex
,
pageSize
);
List
<
Transaction
>
list
=
this
.
transactionRepository
.
selectListByAddress
(
address
,
t
);
PageInfo
<
Transaction
>
pageInfo
=
new
PageInfo
<>(
list
);
return
pageInfo
;
}
@Override
public
void
init
()
{
initExcutor
();
}
private
void
census
(
String
date
,
String
startDate
,
String
endDate
)
{
Long
startDateSeconds
=
DateUtil
.
getDateFromDateStr
(
startDate
);
Long
endDateSeconds
=
DateUtil
.
getDateFromDateStr
(
endDate
);
BlockDayCensus
data
=
this
.
blockDayCensusRepository
.
censusBlockByTime
(
startDateSeconds
,
endDateSeconds
);
if
(
data
!=
null
)
{
Long
totalSeconds
=
24
*
60
*
60L
;
BigDecimal
aver
=
BigDecimalUtil
.
getDevide
(
new
BigDecimal
(
totalSeconds
),
new
BigDecimal
(
data
.
getGenBlockTotalNum
()));
data
.
setGenBlockAverTime
(
aver
.
longValue
());
data
.
setCensusDate
(
date
);
data
.
setCreateTime
(
new
Date
());
BigDecimal
averBlockBytes
=
BigDecimalUtil
.
getDevide
(
new
BigDecimal
(
data
.
getTotalBlockBytes
()),
new
BigDecimal
(
data
.
getGenBlockTotalNum
()));
data
.
setAverBlockBytes
(
averBlockBytes
.
intValue
());
this
.
blockDayCensusRepository
.
insert
(
data
);
}
}
}
src/main/java/com/wuban/tron/explore/service/impl/TronServiceImpl.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.wuban.tron.explore.domain.TronAccount
;
import
com.wuban.tron.explore.domain.TronResponseArrayData
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
com.wuban.tron.explore.service.BaseCommonService
;
import
com.wuban.tron.explore.service.TronService
;
import
okhttp3.Request
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* <core>波场区块服务接口实现类</core>
*
* @author sky
* @date 2020/11/02
*/
@Service
public
class
TronServiceImpl
extends
BaseCommonService
implements
TronService
{
@Override
public
TronResponseData
getBlockByNum
(
Long
blockNum
)
{
String
str
=
this
.
analysisBlock
(
blockNum
);
if
(
StringUtils
.
isEmpty
(
str
))
{
return
null
;
}
return
JSONObject
.
parseObject
(
str
,
TronResponseData
.
class
);
}
@Override
public
TronResponseArrayData
getBlockByLatestNum
(
Integer
num
)
{
String
str
=
this
.
analysisBlock
(
num
);
if
(
StringUtils
.
isEmpty
(
str
))
{
return
null
;
}
return
JSONObject
.
parseObject
(
str
,
TronResponseArrayData
.
class
);
}
private
String
analysisBlock
(
Object
param
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
1
);
map
.
put
(
"num"
,
param
);
Request
request
=
this
.
builder
(
GET_BLOCK_BYNUM
,
map
);
String
str
=
this
.
execute
(
request
);
return
str
;
}
/**
* 根据地址获取账户信息
*
* @param address 账户地址
*/
@Override
public
TronAccount
getAccount
(
String
address
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
1
);
map
.
put
(
"address"
,
address
);
Request
request
=
this
.
builder
(
GET_ACCOUNT
,
map
);
String
str
=
this
.
execute
(
request
);
if
(
StringUtils
.
isEmpty
(
str
))
{
return
null
;
}
return
JSONObject
.
parseObject
(
str
,
TronAccount
.
class
);
}
}
src/main/java/com/wuban/tron/explore/util/ApiResponse.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
/**
* ClassName:ApiResponse <br/>
* Function: API返回结果 <br/>
* Date: 2018年9月17日 下午4:51:24 <br/>
* @author Jack Bai
* @version 1.0.0
* @see
*/
public
class
ApiResponse
<
T
>
{
/**
* 执行成功.
*/
public
static
final
Integer
OK
=
200
;
/**
* 内部异常.
*/
public
static
final
Integer
INNER_ERROR
=
500
;
public
static
final
String
DEFAULT_SUCCESS_MESSAGE
=
"操作成功"
;
private
Boolean
success
;
private
Integer
code
;
private
String
msg
;
private
T
data
;
public
ApiResponse
()
{
}
public
ApiResponse
(
Boolean
success
,
Integer
code
,
String
message
,
T
data
)
{
this
.
success
=
success
;
this
.
code
=
code
;
this
.
msg
=
message
;
this
.
data
=
data
;
}
public
Boolean
getSuccess
()
{
return
success
;
}
public
void
setSuccess
(
Boolean
success
)
{
this
.
success
=
success
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
Object
getData
()
{
return
data
;
}
public
void
setData
(
T
data
)
{
this
.
data
=
data
;
}
}
src/main/java/com/wuban/tron/explore/util/BigDecimalUtil.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
import
java.math.BigDecimal
;
import
java.math.MathContext
;
import
java.math.RoundingMode
;
public
class
BigDecimalUtil
{
public
static
final
int
SCALE
=
32
;
public
static
BigDecimal
getDevide
(
BigDecimal
bg1
,
BigDecimal
bg2
){
MathContext
mc
=
new
MathContext
(
SCALE
,
RoundingMode
.
HALF_DOWN
);
return
bg1
.
divide
(
bg2
,
mc
);
}
public
static
BigDecimal
getMultiply
(
BigDecimal
bg1
,
BigDecimal
bg2
){
MathContext
mc
=
new
MathContext
(
SCALE
,
RoundingMode
.
HALF_UP
);
return
bg1
.
multiply
(
bg2
,
mc
);
}
public
static
BigDecimal
getMultiply
(
BigDecimal
bg1
,
BigDecimal
bg2
,
int
scale
){
MathContext
mc
=
new
MathContext
(
SCALE
,
RoundingMode
.
DOWN
);
return
bg1
.
multiply
(
bg2
,
mc
).
setScale
(
scale
,
RoundingMode
.
DOWN
);
}
public
static
BigDecimal
getAdd
(
BigDecimal
bg1
,
BigDecimal
bg2
){
MathContext
mc
=
new
MathContext
(
SCALE
,
RoundingMode
.
HALF_UP
);
return
bg1
.
add
(
bg2
,
mc
);
}
public
static
BigDecimal
getSubtract
(
BigDecimal
bg1
,
BigDecimal
bg2
){
MathContext
mc
=
new
MathContext
(
SCALE
,
RoundingMode
.
HALF_UP
);
return
bg1
.
subtract
(
bg2
,
mc
);
}
}
src/main/java/com/wuban/tron/explore/util/DateUtil.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.Instant
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.TemporalAccessor
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
* @author sky
*
**/
public
class
DateUtil
{
private
final
static
int
WEEK_DAY_NUM
=
7
;
private
final
static
int
HOUR_16_PM
=
16
;
private
final
static
int
MINTUES_10
=
10
;
public
static
final
String
PATTERN_YMD
=
"yyyy-MM-dd"
;
public
static
final
String
PATTERN_YMD_HMS
=
"yyyy-MM-dd HH:mm:ss"
;
/***
* 毫秒数据格式化时间
* @param date 时间毫秒
* @return 格式为(HH mm ss)的时间字符串
*/
public
static
String
getFormatTime
(
final
long
date
)
{
return
getFormatTime
(
new
Date
(
date
));
}
/**
* 格式化为时间(HH:mm:ss)
*
* @param date 日期类型
* @return 格式为(HH mm ss)的时间字符串
*/
public
static
String
getFormatTime
(
final
Date
date
)
{
return
getFormatDate
(
date
,
"HH:mm:ss"
);
}
/**
* 格式化为时间(yyyy-MM-dd HH:mm)
*
* @param date
* @return
*/
public
static
String
getFormatDateTimeMinute
(
final
Date
date
)
{
return
getFormatDate
(
date
,
"yyyy-MM-dd HH:mm"
);
}
/**
* 格式化为时间(yyyy-MM-dd HH:mm) 获取分钟数
*
* @param date
* @return
*/
public
static
Date
getDateTimeMinute
(
final
Date
date
)
{
final
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
return
calendar
.
getTime
();
}
/**
* 就获取今天今天0点时间
*
* @return
*/
public
static
Date
getToday
()
{
final
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
return
calendar
.
getTime
();
}
/**
* 获取时间A与B之间的分钟差
*
* @param dateA
* @param dateB
* @return
*/
public
static
long
betweenMinute
(
final
Date
dateA
,
final
Date
dateB
)
{
final
long
between
=
dateB
.
getTime
()
-
dateA
.
getTime
();
return
between
/
(
60
*
1000
);
}
/**
* 获取当前格式化时间(HH:mm:ss)
*
* @return HH:mm:ss格式的时间字符串
*/
public
static
String
getCurrentFormatTime
()
{
return
getFormatDate
(
new
Date
());
}
/**
* 格式化日期为(yyyyMMdd)
*
* @param date 日期类型
* @return 格式为(yyyyMMdd)的日期字符串
*/
public
static
String
getFormatDate
(
final
Date
date
)
{
return
getFormatDate
(
date
,
"yyyyMMdd"
);
}
/**
* 格式化日期为(yyyyMMdd)
*
* @param date 整型日期
* @return 格式为(yyyy - MM - dd HH : mm : ss)的日期字符串
*/
public
static
String
getFormatDate
(
final
long
date
)
{
final
Date
d
=
new
Date
(
date
);
return
getFormatDate
(
d
,
"yyyy-MM-dd HH:mm:ss"
);
}
/**
* 格式化为日期(pattern)
*
* @param date 日期类型
* @param pattern 日期时间模式
* @return 格式为(pattern)的日期字符串
*/
public
static
String
getFormatDate
(
final
Date
date
,
final
String
pattern
)
{
final
SimpleDateFormat
format
=
new
SimpleDateFormat
(
pattern
);
return
format
.
format
(
date
);
}
/**
* @param date
* @return
*/
public
static
int
getWeekOfDate
(
final
Date
date
)
{
final
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
int
w
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
if
(
w
<=
0
)
{
w
=
WEEK_DAY_NUM
;
}
return
w
;
}
/**
* @param hour
* @return
*/
public
static
long
getTodayForHour
(
final
int
hour
)
{
final
Calendar
beginningOfDayCalendar
=
Calendar
.
getInstance
();
beginningOfDayCalendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
hour
);
beginningOfDayCalendar
.
set
(
Calendar
.
MINUTE
,
0
);
beginningOfDayCalendar
.
set
(
Calendar
.
SECOND
,
0
);
final
long
beginningOfDayInMillis
=
beginningOfDayCalendar
.
getTimeInMillis
();
final
Date
beginningOfDayDate
=
new
Date
(
beginningOfDayInMillis
);
return
beginningOfDayDate
.
getTime
();
}
/**
* 获得当前星期五
*
* @return
*/
public
static
Date
getFriday
()
{
//获取当前时间
final
Calendar
calendar
=
Calendar
.
getInstance
();
switch
(
calendar
.
get
(
Calendar
.
DAY_OF_WEEK
))
{
case
Calendar
.
FRIDAY
:
final
int
hour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
);
final
int
min
=
calendar
.
get
(
Calendar
.
MINUTE
);
if
(
hour
>
HOUR_16_PM
||
(
hour
==
HOUR_16_PM
&&
min
>=
MINTUES_10
))
{
calendar
.
add
(
Calendar
.
DAY_OF_WEEK
,
7
);
}
break
;
//周6设置
case
Calendar
.
SATURDAY
:
calendar
.
add
(
Calendar
.
DAY_OF_WEEK
,
WEEK_DAY_NUM
);
break
;
default
:
break
;
}
calendar
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
FRIDAY
);
return
calendar
.
getTime
();
}
/**
* date 日期加上或减去几天
*
* @param date
* @param days
* @return
*/
public
static
Date
addDays
(
final
Date
date
,
final
int
days
)
{
final
Calendar
cal
=
Calendar
.
getInstance
();
if
(
date
!=
null
)
{
cal
.
setTime
(
date
);
}
cal
.
add
(
Calendar
.
DATE
,
days
);
return
cal
.
getTime
();
}
/***
* 获取季度月最后一个周5
* @return
*/
public
static
String
getSeasonFriday
()
{
final
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
MONTH
,
getSeason
(
calendar
.
getTime
())
+
1
);
//获取前一个月4月1日
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
//3月31日
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
Calendar
.
FRIDAY
-
calendar
.
get
(
Calendar
.
DAY_OF_WEEK
));
return
getFormatDate
(
calendar
.
getTime
());
}
/**
* 获取当前月所属的季度
* <p>
* 1 第一季度
* 2 第二季度
* 3 第三季度
* 4 第四季度
*
* @param date
* @return 1|2|3|4
*/
public
static
int
getSeason
(
final
Date
date
)
{
final
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
final
int
month
=
c
.
get
(
Calendar
.
MONTH
);
switch
(
month
)
{
case
Calendar
.
JANUARY
:
case
Calendar
.
FEBRUARY
:
case
Calendar
.
MARCH
:
return
Calendar
.
MARCH
;
case
Calendar
.
APRIL
:
case
Calendar
.
MAY
:
case
Calendar
.
JUNE
:
return
Calendar
.
JUNE
;
case
Calendar
.
JULY
:
case
Calendar
.
AUGUST
:
case
Calendar
.
SEPTEMBER
:
return
Calendar
.
SEPTEMBER
;
case
Calendar
.
OCTOBER
:
case
Calendar
.
NOVEMBER
:
case
Calendar
.
DECEMBER
:
return
Calendar
.
DECEMBER
;
default
:
return
Calendar
.
MARCH
;
}
}
/**
* 格式化时间
*
* @param date
* @return
*/
public
static
Long
getDateFromDateStr
(
String
date
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
try
{
Date
dateTime
=
format
.
parse
(
date
);
return
dateTime
.
getTime
();
}
catch
(
ParseException
e
)
{
return
null
;
}
}
public
static
String
regularDateTimeFromDate
(
final
Date
date
)
{
final
DateTimeFormatter
isoLocalDateTime
=
DateTimeFormatter
.
ISO_INSTANT
;
return
isoLocalDateTime
.
format
(
date
.
toInstant
());
}
public
static
String
regularDateTimeFromLong
(
final
Long
date
)
{
return
regularDateTimeFromDate
(
new
Date
(
date
));
}
public
static
Long
getTimestampFromISODateStr
(
final
String
isoDate
)
{
return
getDateFromISODateStr
(
isoDate
).
getTime
();
}
public
static
Date
getDateFromISODateStr
(
final
String
isoDate
)
{
final
DateTimeFormatter
timeFormatter
=
DateTimeFormatter
.
ISO_INSTANT
;
final
TemporalAccessor
accessor
=
timeFormatter
.
parse
(
isoDate
);
return
Date
.
from
(
Instant
.
from
(
accessor
));
}
}
src/main/java/com/wuban/tron/explore/util/ErrorResponseData.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
/**
* @{# ErrorResponseData.java Create on 2020年7月23日 下午4:18:57
* <p>
* 失败操作返回的数据模型定义.
* </p>
* @author <a href="mailto:baiyujie@gmail.com">baiyujie</a>
* @version v 0.1
*/
public
class
ErrorResponseData
extends
ApiResponse
{
public
ErrorResponseData
(
Integer
code
,
String
message
)
{
super
(
false
,
code
,
message
,
null
);
}
public
ErrorResponseData
(
Integer
code
,
String
message
,
Object
object
)
{
super
(
false
,
code
,
message
,
object
);
}
}
src/main/java/com/wuban/tron/explore/util/ResponseKit.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
/**
* ClassName:ResponseKit <br/>
* Function: API返回结果组装工具. <br/>
* Date: 2018年9月20日 下午4:20:42 <br/>
* @author Jack Bai
* @version 1.0.0
* @see
*/
public
class
ResponseKit
{
public
static
SuccessResponseData
success
()
{
return
new
SuccessResponseData
();
}
public
static
<
T
>
SuccessResponseData
success
(
T
object
)
{
return
new
SuccessResponseData
(
object
);
}
public
static
<
T
>
SuccessResponseData
success
(
String
message
,
T
object
)
{
return
new
SuccessResponseData
(
message
,
object
);
}
public
static
ErrorResponseData
fail
(
Integer
code
,
String
message
)
{
return
new
ErrorResponseData
(
code
,
message
);
}
public
static
ErrorResponseData
fail
(
Integer
code
,
String
message
,
Object
object
)
{
return
new
ErrorResponseData
(
code
,
message
,
object
);
}
}
src/main/java/com/wuban/tron/explore/util/SpringContextUtil.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.stereotype.Component
;
/**
* <core>SpringContextUtil</core>
*
* @author sky
* @date 2020/11/04
*/
@Component
public
class
SpringContextUtil
implements
ApplicationContextAware
{
/**
* Spring应用上下文环境
*/
private
static
ApplicationContext
applicationContext
;
public
static
ApplicationContext
getApplicationContext
()
{
return
applicationContext
;
}
@Override
public
void
setApplicationContext
(
final
ApplicationContext
applicationContext
)
throws
BeansException
{
SpringContextUtil
.
applicationContext
=
applicationContext
;
}
public
static
<
T
>
T
getBean
(
final
String
name
)
throws
BeansException
{
return
(
T
)
applicationContext
.
getBean
(
name
);
}
public
static
<
T
>
T
getBean
(
final
Class
<
T
>
clazz
)
throws
BeansException
{
return
applicationContext
.
getBean
(
clazz
);
}
}
src/main/java/com/wuban/tron/explore/util/SuccessResponseData.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
/**
* @{# SuccessResponseData.java Create on 2020年7月23日 下午4:14:56
* <p>
* 成功操作返回的数据模型定义.
* </p>
* @author <a href="mailto:baiyujie@gmail.com">baiyujie</a>
* @version v 0.1
*/
public
class
SuccessResponseData
<
T
>
extends
ApiResponse
{
public
SuccessResponseData
()
{
super
(
true
,
OK
,
DEFAULT_SUCCESS_MESSAGE
,
null
);
}
public
SuccessResponseData
(
T
object
)
{
super
(
true
,
OK
,
DEFAULT_SUCCESS_MESSAGE
,
object
);
}
public
SuccessResponseData
(
String
message
,
Object
object
)
{
super
(
true
,
OK
,
message
,
object
);
}
}
src/main/java/com/wuban/tron/explore/util/ThreadPoolUtil.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
util
;
import
com.wuban.tron.explore.constant.Constant
;
import
lombok.extern.slf4j.Slf4j
;
import
sun.awt.OSInfo
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
/**
* @author sky
*
*/
@Slf4j
public
class
ThreadPoolUtil
{
private
static
final
Long
TIMEOUT
=
1000L
;
/**
* 确保关闭线程池
*
* @param pool 线程池
*/
public
static
void
ensureShutdown
(
final
ThreadPoolExecutor
pool
)
{
pool
.
shutdownNow
();
try
{
while
(!
pool
.
awaitTermination
(
TIMEOUT
,
TimeUnit
.
MILLISECONDS
))
{
log
.
info
(
"still not shutdown"
);
}
}
catch
(
final
InterruptedException
e
)
{
log
.
error
(
"interrepted"
,
e
);
}
log
.
info
(
"shutdown over"
);
}
public
static
int
getCupNum
()
{
int
cupNum
;
String
osName
=
OSInfo
.
getOSType
().
name
();
if
(
osName
.
equals
(
Constant
.
OS_NMAE
))
{
cupNum
=
Runtime
.
getRuntime
().
availableProcessors
();
}
else
{
cupNum
=
Runtime
.
getRuntime
().
availableProcessors
()
*
2
;
}
return
cupNum
;
}
}
src/main/resources/application.yml
0 → 100644
View file @
25af91cc
server
:
port
:
8080
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://123.56.5.114:13306/test_tron?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
root
password
:
root123456
# 初始化大小,最小,最大
initialSize
:
5
minIdle
:
5
maxActive
:
20
# 配置获取连接等待超时的时间
maxWait
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
60000
# 配置一个连接在池中最小生存的时间,单位是毫秒St
minEvictableIdleTimeMillis
:
300000
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements
:
true
maxPoolPreparedStatementPerConnectionSize
:
20
redis
:
host
:
123.56.5.114
port
:
6379
jedis
:
pool
:
max-active
:
1024
max-idle
:
200
max-wait
:
10000
min-idle
:
100
timeout
:
10000
password
:
123456
database
:
2
mybatis
:
mapper-locations
:
classpath:*.xml
type-aliases-package
:
com.wuban.tron.explore.entity
logging
:
level
:
com.wuban.tron.explore.dao
:
error
\ No newline at end of file
src/main/resources/log-tron.xml
0 → 100644
View file @
25af91cc
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration
scan=
"true"
scanPeriod=
"10 seconds"
>
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
<File>
${LOG_PATH}/info.log
</File>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${LOG_PATH}/info-%d{yyyyMMdd}.log.%i
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
10MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>
2
</maxHistory>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<Pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
</appender>
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
ERROR
</level>
</filter>
<File>
${LOG_PATH}/error.log
</File>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${LOG_PATH}/error-%d{yyyyMMdd}.log.%i
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
10MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>
2
</maxHistory>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<Pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
</appender>
<appender
name=
"TRACE_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
TRACE
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
<File>
${LOG_PATH}/trace.log
</File>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${LOG_PATH}/trace-%d{yyyyMMdd}.log.%i
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
10MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>
2
</maxHistory>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<Pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
</Pattern>
</layout>
</appender>
<root
level=
"INFO"
>
<appender-ref
ref=
"INFO_FILE"
></appender-ref>
<appender-ref
ref=
"ERROR_FILE"
/>
<appender-ref
ref=
"TRACE_FILE"
/>
</root>
</configuration>
\ No newline at end of file
src/main/resources/mapper/AddressMapper.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.wuban.tron.explore.dao.AddressRepository"
>
<!-- CodeBuilder Generated-->
<resultMap
id=
"AddressMap"
type=
"com.wuban.tron.explore.entity.Address"
>
<result
column=
"address"
property=
"address"
jdbcType=
"VARCHAR"
/>
<result
column=
"balance"
property=
"balance"
jdbcType=
"BIGINT"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Table_Name"
>
tron_address
</sql>
<sql
id=
"Base_Column_List_Without_Id"
>
address
</sql>
<sql
id=
"Base_Column_List"
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</sql>
<sql
id=
"Insert_Columns"
>
<if
test=
"record.address != null"
>
address,
</if>
<if
test=
"record.balance != null"
>
balance,
</if>
</sql>
<sql
id=
"Insert_Values"
>
<if
test=
"record.address != null"
>
#{record.address,jdbcType=VARCHAR},
</if>
</sql>
<sql
id=
"Batch_Insert_Values"
>
#{record.address,jdbcType=VARCHAR}
</sql>
<sql
id=
"Batch_Insert_Values_On_DuplicateKey"
>
<include
refid=
"Batch_Insert_Values"
/>
</sql>
<sql
id=
"Update_Set_From_Bean"
>
<if
test=
"record.address != null"
>
address = #{record.address,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.balance != null"
>
balance = #{record.balance,jdbcType=BIGINT} ,
</if>
</sql>
<!-- insert -->
<insert
id=
"insert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Columns"
/>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Values"
/>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values"
/>
</trim>
</foreach>
</insert>
<insert
id=
"batchInsertOnDuplicateKey"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
selectByPagerEx
<include
refid=
"Base_Column_List"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values_On_DuplicateKey"
/>
</trim>
</foreach>
ON DUPLICATE KEY UPDATE address = VALUES(address)
</insert>
<!-- end insert -->
<!-- delete -->
<delete
id=
"deleteById"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where address = #{id,jdbcType=VARCHAR}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<delete
id=
"deleteIn"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where address in
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.address,jdbcType=VARCHAR}
</foreach>
</delete>
<!-- end delete -->
<!-- update -->
<update
id=
"updateById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where address = #{record.address,jdbcType=VARCHAR}
</update>
<update
id=
"updateByExample"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</update>
<update
id=
"batchUpdate"
parameterType=
"java.util.Map"
>
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
""
close=
""
separator=
";"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where address=#{record.address,jdbcType=VARCHAR}
</foreach>
</update>
<!-- end update -->
<!-- select -->
<select
id=
"selectById"
resultMap=
"AddressMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where address = #{id,jdbcType=VARCHAR}
</select>
<select
id=
"selectByExample"
resultMap=
"AddressMap"
parameterType=
"java.util.Map"
>
select
<if
test=
"example != null and example.distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example != null and example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectOneByExample"
resultMap=
"AddressMap"
parameterType=
"java.util.Map"
>
select
address,balance
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
limit 1
</select>
<select
id=
"selectIn"
resultMap=
"AddressMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where address IN
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.address,jdbcType=VARCHAR}
</foreach>
</select>
<select
id=
"countByExample"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"countByPager"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<!-- end select -->
<!-- My Custom Interfaces -->
</mapper>
src/main/resources/mapper/BlockDayCensusMapper.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.wuban.tron.explore.dao.BlockDayCensusRepository"
>
<!-- CodeBuilder Generated-->
<resultMap
id=
"BlockDayCensusMap"
type=
"com.wuban.tron.explore.entity.BlockDayCensus"
>
<result
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"gen_block_aver_time"
property=
"genBlockAverTime"
jdbcType=
"BIGINT"
/>
<result
column=
"gen_block_total_num"
property=
"genBlockTotalNum"
jdbcType=
"INTEGER"
/>
<result
column=
"total_volume"
property=
"totalVolume"
jdbcType=
"INTEGER"
/>
<result
column=
"census_date"
property=
"censusDate"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"total_block_bytes"
property=
"totalBlockBytes"
jdbcType=
"INTEGER"
/>
<result
column=
"aver_block_bytes"
property=
"averBlockBytes"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Table_Name"
>
tron_block_day_census
</sql>
<sql
id=
"Base_Column_List_Without_Id"
>
id , gen_block_aver_time , gen_block_total_num , total_volume , census_date , create_time,total_block_bytes,aver_block_bytes
</sql>
<sql
id=
"Base_Column_List"
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</sql>
<sql
id=
"Insert_Columns"
>
<if
test=
"record.id != null"
>
id,
</if>
<if
test=
"record.genBlockAverTime != null"
>
gen_block_aver_time,
</if>
<if
test=
"record.genBlockTotalNum != null"
>
gen_block_total_num,
</if>
<if
test=
"record.totalVolume != null"
>
total_volume,
</if>
<if
test=
"record.censusDate != null"
>
census_date,
</if>
<if
test=
"record.createTime != null"
>
create_time,
</if>
<if
test=
"record.totalBlockBytes != null"
>
total_block_bytes,
</if>
<if
test=
"record.averBlockBytes != null"
>
aver_block_bytes,
</if>
</sql>
<sql
id=
"Insert_Values"
>
<if
test=
"record.id != null"
>
#{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.genBlockAverTime != null"
>
#{record.genBlockAverTime,jdbcType=BIGINT},
</if>
<if
test=
"record.genBlockTotalNum != null"
>
#{record.genBlockTotalNum,jdbcType=INTEGER},
</if>
<if
test=
"record.totalVolume != null"
>
#{record.totalVolume,jdbcType=INTEGER},
</if>
<if
test=
"record.censusDate != null"
>
#{record.censusDate,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
#{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.totalBlockBytes != null"
>
#{record.totalBlockBytes,jdbcType=INTEGER},
</if>
<if
test=
"record.averBlockBytes != null"
>
#{record.averBlockBytes,jdbcType=INTEGER},
</if>
</sql>
<sql
id=
"Batch_Insert_Values"
>
#{record.id,jdbcType=BIGINT},
#{record.genBlockAverTime,jdbcType=BIGINT},
#{record.genBlockTotalNum,jdbcType=INTEGER},
#{record.totalVolume,jdbcType=INTEGER},
#{record.censusDate,jdbcType=VARCHAR},
#{record.createTime,jdbcType=TIMESTAMP},
#{record.totalBlockBytes,jdbcType=INTEGER},
#{record.averBlockBytes,jdbcType=INTEGER},
</sql>
<sql
id=
"Batch_Insert_Values_On_DuplicateKey"
>
<include
refid=
"Batch_Insert_Values"
/>
</sql>
<sql
id=
"Update_Set_From_Bean"
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT} ,
</if>
<if
test=
"record.genBlockAverTime != null"
>
gen_block_aver_time = #{record.genBlockAverTime,jdbcType=BIGINT} ,
</if>
<if
test=
"record.genBlockTotalNum != null"
>
gen_block_total_num = #{record.genBlockTotalNum,jdbcType=INTEGER} ,
</if>
<if
test=
"record.totalVolume != null"
>
total_volume = #{record.totalVolume,jdbcType=INTEGER} ,
</if>
<if
test=
"record.censusDate != null"
>
census_date = #{record.censusDate,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP} ,
</if>
</sql>
<!-- insert -->
<insert
id=
"insert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Columns"
/>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Values"
/>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values"
/>
</trim>
</foreach>
</insert>
<insert
id=
"batchInsertOnDuplicateKey"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values_On_DuplicateKey"
/>
</trim>
</foreach>
ON DUPLICATE KEY UPDATE
id = VALUES(id) , gen_block_aver_time = VALUES(gen_block_aver_time) , gen_block_total_num = VALUES(gen_block_total_num) , total_volume = VALUES(total_volume) , census_date = VALUES(census_date) , create_time = VALUES(create_time)
</insert>
<!-- end insert -->
<!-- delete -->
<delete
id=
"deleteById"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<delete
id=
"deleteIn"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id in
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</delete>
<!-- end delete -->
<!-- update -->
<update
id=
"updateById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id = #{record.id,jdbcType=BIGINT}
</update>
<update
id=
"updateByExample"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</update>
<update
id=
"batchUpdate"
parameterType=
"java.util.Map"
>
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
""
close=
""
separator=
";"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id=#{record.id,jdbcType=BIGINT}
</foreach>
</update>
<!-- end update -->
<!-- select -->
<select
id=
"selectById"
resultMap=
"BlockDayCensusMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByExample"
resultMap=
"BlockDayCensusMap"
parameterType=
"java.util.Map"
>
select
<if
test=
"example != null and example.distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example != null and example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectOneByExample"
resultMap=
"BlockDayCensusMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
limit 1
</select>
<select
id=
"selectIn"
resultMap=
"BlockDayCensusMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id IN
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</select>
<select
id=
"countByExample"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"countByPager"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"selectByPager"
resultMap=
"BlockDayCensusMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<!-- end select -->
<!-- My Custom Interfaces -->
<select
id=
"censusBlockByTime"
resultMap=
"BlockDayCensusMap"
parameterType=
"java.util.Map"
>
select
(max(number)-min(number))as gen_block_total_num,sum(transaction_volume) as total_volume,
sum(block_bytes) as total_block_bytes
from tron_block_header
<where>
`timestamp` between ${start} and ${end}
</where>
</select>
</mapper>
src/main/resources/mapper/BlockHeaderMapper.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.wuban.tron.explore.dao.BlockHeaderRepository"
>
<!-- CodeBuilder Generated-->
<resultMap
id=
"BlockHeaderMap"
type=
"com.wuban.tron.explore.entity.BlockHeader"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"block_id"
property=
"blockId"
jdbcType=
"VARCHAR"
/>
<result
column=
"number"
property=
"number"
jdbcType=
"BIGINT"
/>
<result
column=
"tx_trie_root"
property=
"txTrieRoot"
jdbcType=
"VARCHAR"
/>
<result
column=
"witness_address"
property=
"witnessAddress"
jdbcType=
"VARCHAR"
/>
<result
column=
"parentHash"
property=
"parentHash"
jdbcType=
"VARCHAR"
/>
<result
column=
"version"
property=
"version"
jdbcType=
"INTEGER"
/>
<result
column=
"timestamp"
property=
"timestamp"
jdbcType=
"BIGINT"
/>
<result
column=
"witness_signature"
property=
"witnessSignature"
jdbcType=
"VARCHAR"
/>
<result
column=
"transaction_volume"
property=
"transactionVolume"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"block_bytes"
property=
"blockBytes"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Table_Name"
>
tron_block_header
</sql>
<sql
id=
"Base_Column_List_Without_Id"
>
block_id , number , tx_trie_root , witness_address , parentHash , version , `timestamp` , witness_signature , transaction_volume , create_time,block_bytes
</sql>
<sql
id=
"Base_Column_List"
>
id ,
<include
refid=
"Base_Column_List_Without_Id"
/>
</sql>
<sql
id=
"Insert_Columns"
>
<if
test=
"record.blockId != null"
>
block_id,
</if>
<if
test=
"record.number != null"
>
number,
</if>
<if
test=
"record.txTrieRoot != null"
>
tx_trie_root,
</if>
<if
test=
"record.witnessAddress != null"
>
witness_address,
</if>
<if
test=
"record.parentHash != null"
>
parentHash,
</if>
<if
test=
"record.version != null"
>
version,
</if>
<if
test=
"record.timestamp != null"
>
`timestamp`,
</if>
<if
test=
"record.witnessSignature != null"
>
witness_signature,
</if>
<if
test=
"record.transactionVolume != null"
>
transaction_volume,
</if>
<if
test=
"record.createTime != null"
>
create_time,
</if>
<if
test=
"record.blockBytes != null"
>
block_bytes,
</if>
</sql>
<sql
id=
"Insert_Values"
>
<if
test=
"record.blockId != null"
>
#{record.blockId,jdbcType=VARCHAR},
</if>
<if
test=
"record.number != null"
>
#{record.number,jdbcType=BIGINT},
</if>
<if
test=
"record.txTrieRoot != null"
>
#{record.txTrieRoot,jdbcType=VARCHAR},
</if>
<if
test=
"record.witnessAddress != null"
>
#{record.witnessAddress,jdbcType=VARCHAR},
</if>
<if
test=
"record.parentHash != null"
>
#{record.parentHash,jdbcType=VARCHAR},
</if>
<if
test=
"record.version != null"
>
#{record.version,jdbcType=INTEGER},
</if>
<if
test=
"record.timestamp != null"
>
#{record.timestamp,jdbcType=BIGINT},
</if>
<if
test=
"record.witnessSignature != null"
>
#{record.witnessSignature,jdbcType=VARCHAR},
</if>
<if
test=
"record.transactionVolume != null"
>
#{record.transactionVolume,jdbcType=INTEGER},
</if>
<if
test=
"record.createTime != null"
>
#{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.blockBytes != null"
>
#{record.blockBytes,jdbcType=VARCHAR},
</if>
</sql>
<sql
id=
"Batch_Insert_Values"
>
#{record.blockId,jdbcType=VARCHAR},
#{record.number,jdbcType=BIGINT},
#{record.txTrieRoot,jdbcType=VARCHAR},
#{record.witnessAddress,jdbcType=VARCHAR},
#{record.parentHash,jdbcType=VARCHAR},
#{record.version,jdbcType=INTEGER},
#{record.timestamp,jdbcType=BIGINT},
#{record.witnessSignature,jdbcType=VARCHAR},
#{record.transactionVolume,jdbcType=INTEGER},
#{record.createTime,jdbcType=TIMESTAMP},
#{record.blockBytes,jdbcType=VARCHAR},
</sql>
<sql
id=
"Batch_Insert_Values_On_DuplicateKey"
>
#{record.id,jdbcType=BIGINT},
<include
refid=
"Batch_Insert_Values"
/>
</sql>
<sql
id=
"Update_Set_From_Bean"
>
<if
test=
"record.blockId != null"
>
block_id = #{record.blockId,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.number != null"
>
number = #{record.number,jdbcType=BIGINT} ,
</if>
<if
test=
"record.txTrieRoot != null"
>
tx_trie_root = #{record.txTrieRoot,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.witnessAddress != null"
>
witness_address = #{record.witnessAddress,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.parentHash != null"
>
parentHash = #{record.parentHash,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.version != null"
>
version = #{record.version,jdbcType=INTEGER} ,
</if>
<if
test=
"record.timestamp != null"
>
`timestamp` = #{record.timestamp,jdbcType=BIGINT} ,
</if>
<if
test=
"record.witnessSignature != null"
>
witness_signature = #{record.witnessSignature,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.transactionVolume != null"
>
transaction_volume = #{record.transactionVolume,jdbcType=INTEGER} ,
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP} ,
</if>
</sql>
<!-- insert -->
<insert
id=
"insert"
parameterType=
"java.util.Map"
>
<selectKey
resultType=
"java.lang.Long"
keyProperty=
"record.id"
order=
"AFTER"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Columns"
/>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Values"
/>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values"
/>
</trim>
</foreach>
</insert>
<insert
id=
"batchInsertOnDuplicateKey"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values_On_DuplicateKey"
/>
</trim>
</foreach>
ON DUPLICATE KEY UPDATE
block_id = VALUES(block_id) ,number = VALUES(number) ,tx_trie_root = VALUES(tx_trie_root) ,witness_address = VALUES(witness_address) ,
parentHash = VALUES(parentHash) ,version = VALUES(version) ,`timestamp` = VALUES(timestamp) ,witness_signature = VALUES(witness_signature) ,
transaction_volume = VALUES(transaction_volume) ,create_time = VALUES(create_time)
</insert>
<!-- end insert -->
<!-- delete -->
<delete
id=
"deleteById"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<delete
id=
"deleteIn"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id in
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</delete>
<!-- end delete -->
<!-- update -->
<update
id=
"updateById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id = #{record.id,jdbcType=BIGINT}
</update>
<update
id=
"updateByExample"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</update>
<update
id=
"batchUpdate"
parameterType=
"java.util.Map"
>
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
""
close=
""
separator=
";"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id=#{record.id,jdbcType=BIGINT}
</foreach>
</update>
<!-- end update -->
<!-- select -->
<select
id=
"selectById"
resultMap=
"BlockHeaderMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByExample"
resultMap=
"BlockHeaderMap"
parameterType=
"java.util.Map"
>
select
<if
test=
"example != null and example.distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example != null and example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectOneByExample"
resultMap=
"BlockHeaderMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
limit 1
</select>
<select
id=
"selectIn"
resultMap=
"BlockHeaderMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id IN
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</select>
<select
id=
"countByExample"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"countByPager"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"selectByPager"
resultMap=
"BlockHeaderMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"pager.sortItem != null and pager.sortItem != '' "
>
order by ${pager.sortItem} ${pager.sortType}
</if>
limit #{pager.startIndex} , #{pager.pageSize}
</select>
<!-- end select -->
<!-- My Custom Interfaces -->
<select
id=
"selectBlockMinTime"
resultType=
"java.lang.Long"
>
select
min (`timestamp`)
from
<include
refid=
"Table_Name"
/>
</select>
</mapper>
src/main/resources/mapper/LastBlockMapper.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.wuban.tron.explore.dao.LastBlockRepository"
>
<!-- CodeBuilder Generated-->
<resultMap
id=
"LastBlockMap"
type=
"com.wuban.tron.explore.entity.LastBlock"
>
<result
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"cur_block_num"
property=
"curBlockNum"
jdbcType=
"BIGINT"
/>
<result
column=
"last_block_num"
property=
"lastBlockNum"
jdbcType=
"BIGINT"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Table_Name"
>
tron_last_block
</sql>
<sql
id=
"Base_Column_List_Without_Id"
>
id , cur_block_num , last_block_num
</sql>
<sql
id=
"Base_Column_List"
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</sql>
<sql
id=
"Insert_Columns"
>
<if
test=
"record.id != null"
>
id,
</if>
<if
test=
"record.curBlockNum != null"
>
cur_block_num,
</if>
<if
test=
"record.lastBlockNum != null"
>
last_block_num,
</if>
</sql>
<sql
id=
"Insert_Values"
>
<if
test=
"record.id != null"
>
#{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.curBlockNum != null"
>
#{record.curBlockNum,jdbcType=BIGINT},
</if>
<if
test=
"record.lastBlockNum != null"
>
#{record.lastBlockNum,jdbcType=BIGINT},
</if>
</sql>
<sql
id=
"Batch_Insert_Values"
>
#{record.id,jdbcType=BIGINT},
#{record.curBlockNum,jdbcType=BIGINT},
#{record.lastBlockNum,jdbcType=BIGINT},
</sql>
<sql
id=
"Batch_Insert_Values_On_DuplicateKey"
>
<include
refid=
"Batch_Insert_Values"
/>
</sql>
<sql
id=
"Update_Set_From_Bean"
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT} ,
</if>
<if
test=
"record.curBlockNum != null"
>
cur_block_num = #{record.curBlockNum,jdbcType=BIGINT} ,
</if>
<if
test=
"record.lastBlockNum != null"
>
last_block_num = #{record.lastBlockNum,jdbcType=BIGINT} ,
</if>
</sql>
<!-- insert -->
<insert
id=
"insert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Columns"
/>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Values"
/>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values"
/>
</trim>
</foreach>
</insert>
<insert
id=
"batchInsertOnDuplicateKey"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values_On_DuplicateKey"
/>
</trim>
</foreach>
ON DUPLICATE KEY UPDATE
id = VALUES(id) , cur_block_num = VALUES(cur_block_num) , last_block_num = VALUES(last_block_num)
</insert>
<!-- end insert -->
<!-- delete -->
<delete
id=
"deleteById"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<delete
id=
"deleteIn"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id in
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</delete>
<!-- end delete -->
<!-- update -->
<update
id=
"updateById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id = #{record.id,jdbcType=BIGINT}
</update>
<update
id=
"updateCurBlockNumById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id = #{record.id,jdbcType=BIGINT} and (#{record.curBlockNum,jdbcType=BIGINT} - cur_block_num) > 0
</update>
<update
id=
"updateByExample"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</update>
<update
id=
"batchUpdate"
parameterType=
"java.util.Map"
>
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
""
close=
""
separator=
";"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id=#{record.id,jdbcType=BIGINT}
</foreach>
</update>
<!-- end update -->
<!-- select -->
<select
id=
"selectByIdForUpdate"
resultMap=
"LastBlockMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
for update
</select>
<select
id=
"selectByExample"
resultMap=
"LastBlockMap"
parameterType=
"java.util.Map"
>
select
<if
test=
"example != null and example.distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example != null and example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectOneByExample"
resultMap=
"LastBlockMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
limit 1
</select>
<select
id=
"selectIn"
resultMap=
"LastBlockMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id IN
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</select>
<select
id=
"countByExample"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"countByPager"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"selectByPager"
resultMap=
"LastBlockMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"pager.sortItem != null and pager.sortItem != '' "
>
order by ${pager.sortItem} ${pager.sortType}
</if>
limit #{pager.startIndex} , #{pager.pageSize}
</select>
<!-- end select -->
<!-- My Custom Interfaces -->
</mapper>
src/main/resources/mapper/TransactionHexMapper.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.wuban.tron.explore.dao.TransactionHexRepository"
>
<!-- CodeBuilder Generated-->
<resultMap
id=
"TransactionHexMap"
type=
"com.wuban.tron.explore.entity.TransactionHex"
>
<result
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"hex"
property=
"hex"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"block_id"
property=
"blockId"
jdbcType=
"VARCHAR"
/>
<result
column=
"tx_id"
property=
"txId"
jdbcType=
"VARCHAR"
/>
<result
column=
"signature"
property=
"signature"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Table_Name"
>
tron_transaction_hex
</sql>
<sql
id=
"Base_Column_List_Without_Id"
>
id , hex , block_id , tx_id , signature , create_time
</sql>
<sql
id=
"Base_Column_List"
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</sql>
<sql
id=
"Insert_Columns"
>
<if
test=
"record.id != null"
>
id,
</if>
<if
test=
"record.hex != null"
>
hex,
</if>
<if
test=
"record.blockId != null"
>
block_id,
</if>
<if
test=
"record.txId != null"
>
tx_id,
</if>
<if
test=
"record.signature != null"
>
signature,
</if>
<if
test=
"record.createTime != null"
>
create_time,
</if>
</sql>
<sql
id=
"Insert_Values"
>
<if
test=
"record.id != null"
>
#{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.hex != null"
>
#{record.hex,jdbcType=LONGVARCHAR},
</if>
<if
test=
"record.blockId != null"
>
#{record.blockId,jdbcType=VARCHAR},
</if>
<if
test=
"record.txId != null"
>
#{record.txId,jdbcType=VARCHAR},
</if>
<if
test=
"record.signature != null"
>
#{record.signature,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
#{record.createTime,jdbcType=TIMESTAMP},
</if>
</sql>
<sql
id=
"Batch_Insert_Values"
>
#{record.id,jdbcType=BIGINT},
#{record.hex,jdbcType=LONGVARCHAR},
#{record.blockId,jdbcType=VARCHAR},
#{record.txId,jdbcType=VARCHAR},
#{record.signature,jdbcType=VARCHAR},
#{record.createTime,jdbcType=TIMESTAMP},
</sql>
<sql
id=
"Batch_Insert_Values_On_DuplicateKey"
>
<include
refid=
"Batch_Insert_Values"
/>
</sql>
<sql
id=
"Update_Set_From_Bean"
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT} ,
</if>
<if
test=
"record.hex != null"
>
hex = #{record.hex,jdbcType=LONGVARCHAR} ,
</if>
<if
test=
"record.blockId != null"
>
block_id = #{record.blockId,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.txId != null"
>
tx_id = #{record.txId,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.signature != null"
>
signature = #{record.signature,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP} ,
</if>
</sql>
<!-- insert -->
<insert
id=
"insert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Columns"
/>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Values"
/>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values"
/>
</trim>
</foreach>
</insert>
<insert
id=
"batchInsertOnDuplicateKey"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values_On_DuplicateKey"
/>
</trim>
</foreach>
ON DUPLICATE KEY UPDATE
id = VALUES(id) , hex = VALUES(hex) , block_id = VALUES(block_id) , tx_id = VALUES(tx_id) , signature = VALUES(signature) , create_time = VALUES(create_time)
</insert>
<!-- end insert -->
<!-- delete -->
<delete
id=
"deleteById"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<delete
id=
"deleteIn"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id in
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</delete>
<!-- end delete -->
<!-- update -->
<update
id=
"updateById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id = #{record.id,jdbcType=BIGINT}
</update>
<update
id=
"updateByExample"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</update>
<update
id=
"batchUpdate"
parameterType=
"java.util.Map"
>
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
""
close=
""
separator=
";"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id=#{record.id,jdbcType=BIGINT}
</foreach>
</update>
<!-- end update -->
<!-- select -->
<select
id=
"selectById"
resultMap=
"TransactionHexMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByExample"
resultMap=
"TransactionHexMap"
parameterType=
"java.util.Map"
>
select
<if
test=
"example != null and example.distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example != null and example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectOneByExample"
resultMap=
"TransactionHexMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
limit 1
</select>
<select
id=
"selectIn"
resultMap=
"TransactionHexMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id IN
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</select>
<select
id=
"countByExample"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"countByPager"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"selectByPager"
resultMap=
"TransactionHexMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"pager.sortItem != null and pager.sortItem != '' "
>
order by ${pager.sortItem} ${pager.sortType}
</if>
limit #{pager.startIndex} , #{pager.pageSize}
</select>
<!-- end select -->
<!-- My Custom Interfaces -->
</mapper>
src/main/resources/mapper/TransactionMapper.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.wuban.tron.explore.dao.TransactionRepository"
>
<!-- CodeBuilder Generated-->
<resultMap
id=
"TransactionMap"
type=
"com.wuban.tron.explore.entity.Transaction"
>
<result
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"block_id"
property=
"blockId"
jdbcType=
"VARCHAR"
/>
<result
column=
"tx_id"
property=
"txId"
jdbcType=
"VARCHAR"
/>
<result
column=
"contract_ret"
property=
"contractRet"
jdbcType=
"VARCHAR"
/>
<result
column=
"owner_address"
property=
"ownerAddress"
jdbcType=
"VARCHAR"
/>
<result
column=
"data"
property=
"data"
jdbcType=
"LONGVARCHAR"
/>
<result
column=
"contract_address"
property=
"contractAddress"
jdbcType=
"VARCHAR"
/>
<result
column=
"amount"
property=
"amount"
jdbcType=
"BIGINT"
/>
<result
column=
"to_address"
property=
"toAddress"
jdbcType=
"VARCHAR"
/>
<result
column=
"type_url"
property=
"typeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"VARCHAR"
/>
<result
column=
"ref_block_bytes"
property=
"refBlockBytes"
jdbcType=
"VARCHAR"
/>
<result
column=
"ref_block_hash"
property=
"refBlockHash"
jdbcType=
"VARCHAR"
/>
<result
column=
"expiration"
property=
"expiration"
jdbcType=
"BIGINT"
/>
<result
column=
"fee_limit"
property=
"feeLimit"
jdbcType=
"BIGINT"
/>
<result
column=
"timestamp"
property=
"timestamp"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"number"
property=
"number"
jdbcType=
"BIGINT"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
suffix=
")"
prefixOverrides=
"and"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
collection=
"criterion.value"
item=
"listItem"
open=
"("
close=
")"
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Table_Name"
>
tron_transaction
</sql>
<sql
id=
"Base_Column_List_Without_Id"
>
id , block_id , tx_id , contract_ret , owner_address , data , contract_address , amount , to_address , type_url , type , ref_block_bytes , ref_block_hash , expiration , fee_limit , `timestamp` , create_time,`number`
</sql>
<sql
id=
"Base_Column_List"
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</sql>
<sql
id=
"Insert_Columns"
>
<if
test=
"record.id != null"
>
id,
</if>
<if
test=
"record.blockId != null"
>
block_id,
</if>
<if
test=
"record.txId != null"
>
tx_id,
</if>
<if
test=
"record.contractRet != null"
>
contract_ret,
</if>
<if
test=
"record.ownerAddress != null"
>
owner_address,
</if>
<if
test=
"record.data != null"
>
data,
</if>
<if
test=
"record.contractAddress != null"
>
contract_address,
</if>
<if
test=
"record.amount != null"
>
amount,
</if>
<if
test=
"record.toAddress != null"
>
to_address,
</if>
<if
test=
"record.typeUrl != null"
>
type_url,
</if>
<if
test=
"record.type != null"
>
type,
</if>
<if
test=
"record.refBlockBytes != null"
>
ref_block_bytes,
</if>
<if
test=
"record.refBlockHash != null"
>
ref_block_hash,
</if>
<if
test=
"record.expiration != null"
>
expiration,
</if>
<if
test=
"record.feeLimit != null"
>
fee_limit,
</if>
<if
test=
"record.timestamp != null"
>
`timestamp`,
</if>
<if
test=
"record.createTime != null"
>
create_time,
</if>
<if
test=
"record.number != null"
>
number,
</if>
</sql>
<sql
id=
"Insert_Values"
>
<if
test=
"record.id != null"
>
#{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.blockId != null"
>
#{record.blockId,jdbcType=VARCHAR},
</if>
<if
test=
"record.txId != null"
>
#{record.txId,jdbcType=VARCHAR},
</if>
<if
test=
"record.contractRet != null"
>
#{record.contractRet,jdbcType=VARCHAR},
</if>
<if
test=
"record.ownerAddress != null"
>
#{record.ownerAddress,jdbcType=VARCHAR},
</if>
<if
test=
"record.data != null"
>
#{record.data,jdbcType=LONGVARCHAR},
</if>
<if
test=
"record.contractAddress != null"
>
#{record.contractAddress,jdbcType=VARCHAR},
</if>
<if
test=
"record.amount != null"
>
#{record.amount,jdbcType=BIGINT},
</if>
<if
test=
"record.toAddress != null"
>
#{record.toAddress,jdbcType=VARCHAR},
</if>
<if
test=
"record.typeUrl != null"
>
#{record.typeUrl,jdbcType=VARCHAR},
</if>
<if
test=
"record.type != null"
>
#{record.type,jdbcType=VARCHAR},
</if>
<if
test=
"record.refBlockBytes != null"
>
#{record.refBlockBytes,jdbcType=VARCHAR},
</if>
<if
test=
"record.refBlockHash != null"
>
#{record.refBlockHash,jdbcType=VARCHAR},
</if>
<if
test=
"record.expiration != null"
>
#{record.expiration,jdbcType=BIGINT},
</if>
<if
test=
"record.feeLimit != null"
>
#{record.feeLimit,jdbcType=BIGINT},
</if>
<if
test=
"record.timestamp != null"
>
#{record.timestamp,jdbcType=BIGINT},
</if>
<if
test=
"record.createTime != null"
>
#{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.number != null"
>
#{record.number,jdbcType=BIGINT},
</if>
</sql>
<sql
id=
"Batch_Insert_Values"
>
#{record.id,jdbcType=BIGINT},
#{record.blockId,jdbcType=VARCHAR},
#{record.txId,jdbcType=VARCHAR},
#{record.contractRet,jdbcType=VARCHAR},
#{record.ownerAddress,jdbcType=VARCHAR},
#{record.data,jdbcType=LONGVARCHAR},
#{record.contractAddress,jdbcType=VARCHAR},
#{record.amount,jdbcType=BIGINT},
#{record.toAddress,jdbcType=VARCHAR},
#{record.typeUrl,jdbcType=VARCHAR},
#{record.type,jdbcType=VARCHAR},
#{record.refBlockBytes,jdbcType=VARCHAR},
#{record.refBlockHash,jdbcType=VARCHAR},
#{record.expiration,jdbcType=BIGINT},
#{record.feeLimit,jdbcType=BIGINT},
#{record.timestamp,jdbcType=BIGINT},
#{record.createTime,jdbcType=TIMESTAMP},
#{record.number,jdbcType=BIGINT},
</sql>
<sql
id=
"Batch_Insert_Values_On_DuplicateKey"
>
<include
refid=
"Batch_Insert_Values"
/>
</sql>
<sql
id=
"Update_Set_From_Bean"
>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT} ,
</if>
<if
test=
"record.blockId != null"
>
block_id = #{record.blockId,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.txId != null"
>
tx_id = #{record.txId,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.contractRet != null"
>
contract_ret = #{record.contractRet,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.ownerAddress != null"
>
owner_address = #{record.ownerAddress,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.data != null"
>
data = #{record.data,jdbcType=LONGVARCHAR} ,
</if>
<if
test=
"record.contractAddress != null"
>
contract_address = #{record.contractAddress,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.amount != null"
>
amount = #{record.amount,jdbcType=BIGINT} ,
</if>
<if
test=
"record.toAddress != null"
>
to_address = #{record.toAddress,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.typeUrl != null"
>
type_url = #{record.typeUrl,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.type != null"
>
type = #{record.type,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.refBlockBytes != null"
>
ref_block_bytes = #{record.refBlockBytes,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.refBlockHash != null"
>
ref_block_hash = #{record.refBlockHash,jdbcType=VARCHAR} ,
</if>
<if
test=
"record.expiration != null"
>
expiration = #{record.expiration,jdbcType=BIGINT} ,
</if>
<if
test=
"record.feeLimit != null"
>
fee_limit = #{record.feeLimit,jdbcType=BIGINT} ,
</if>
<if
test=
"record.timestamp != null"
>
`timestamp` = #{record.timestamp,jdbcType=BIGINT} ,
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP} ,
</if>
<if
test=
"record.number != null"
>
number = #{record.number,jdbcType=BIGINT} ,
</if>
</sql>
<!-- insert -->
<insert
id=
"insert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Columns"
/>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Insert_Values"
/>
</trim>
</insert>
<insert
id=
"batchInsert"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List_Without_Id"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values"
/>
</trim>
</foreach>
</insert>
<insert
id=
"batchInsertOnDuplicateKey"
parameterType=
"java.util.Map"
>
insert into
<include
refid=
"Table_Name"
/>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Base_Column_List"
/>
</trim>
values
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<include
refid=
"Batch_Insert_Values_On_DuplicateKey"
/>
</trim>
</foreach>
ON DUPLICATE KEY UPDATE
id = VALUES(id), block_id = VALUES(block_id) , tx_id = VALUES(tx_id) ,contract_ret = VALUES(contract_ret) , owner_address = VALUES(owner_address) , data = VALUES(data) , contract_address = VALUES(contract_address) , amount = VALUES(amount) , to_address = VALUES(to_address) , type_url = VALUES(type_url) , type = VALUES(type) , ref_block_bytes = VALUES(ref_block_bytes) , ref_block_hash = VALUES(ref_block_hash) , expiration = VALUES(expiration) , fee_limit = VALUES(fee_limit) , `timestamp` = VALUES(timestamp) , create_time = VALUES(create_time)
</insert>
<!-- end insert -->
<!-- delete -->
<delete
id=
"deleteById"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<delete
id=
"deleteIn"
parameterType=
"java.util.Map"
>
delete from
<include
refid=
"Table_Name"
/>
where id in
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</delete>
<!-- end delete -->
<!-- update -->
<update
id=
"updateById"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id = #{record.id,jdbcType=BIGINT}
</update>
<update
id=
"updateByExample"
parameterType=
"java.util.Map"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</update>
<update
id=
"batchUpdate"
parameterType=
"java.util.Map"
>
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
""
close=
""
separator=
";"
>
update
<include
refid=
"Table_Name"
/>
<set>
<include
refid=
"Update_Set_From_Bean"
/>
</set>
where id=#{record.id,jdbcType=BIGINT}
</foreach>
</update>
<!-- end update -->
<!-- select -->
<select
id=
"selectById"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByExample"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
<if
test=
"example != null and example.distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example != null and example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectOneByExample"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
limit 1
</select>
<select
id=
"selectIn"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
where id IN
<foreach
collection=
"records"
item=
"record"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{record.id,jdbcType=BIGINT}
</foreach>
</select>
<select
id=
"countByExample"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"countByPager"
resultType=
"java.lang.Integer"
parameterType=
"java.util.Map"
>
select count(*) as total from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<select
id=
"selectByPager"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
<include
refid=
"Base_Column_List"
/>
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<!-- end select -->
<!-- My Custom Interfaces -->
<select
id=
"selectByPagerEx"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
tx_id,owner_address,contract_address,to_address,`number`,`timestamp`,amount
from
<include
refid=
"Table_Name"
/>
<if
test=
"example != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectListByAddress"
resultMap=
"TransactionMap"
parameterType=
"java.util.Map"
>
select
tx_id,owner_address,contract_address,to_address,`number`,`timestamp`,amount
from
<include
refid=
"Table_Name"
/>
where (`timestamp`
>
#{t}) and (owner_address = #{address} or to_address = #{address})
order by `timestamp` desc
</select>
</mapper>
src/main/resources/mybatis/mybatis-config.xml
0 → 100644
View file @
25af91cc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting
name=
"cacheEnabled"
value=
"true"
/>
<setting
name=
"lazyLoadingEnabled"
value=
"true"
/>
<setting
name=
"multipleResultSetsEnabled"
value=
"true"
/>
<setting
name=
"useColumnLabel"
value=
"true"
/>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
<setting
name=
"defaultExecutorType"
value=
"REUSE"
/>
<setting
name=
"defaultStatementTimeout"
value=
"25000"
/>
<!-- <setting name="logImpl" value="LOG4J"/>-->
</settings>
</configuration>
\ No newline at end of file
src/test/java/com/wuban/tron/explore/BaseTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
BaseTest
{
}
src/test/java/com/wuban/tron/explore/ExploreApplicationTests.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
ExploreApplicationTests
{
@Test
void
contextLoads
()
{
}
}
src/test/java/com/wuban/tron/explore/dao/AddressRepositoryTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.BaseTest
;
import
com.wuban.tron.explore.entity.Address
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.ArrayList
;
import
java.util.List
;
class
AddressRepositoryTest
extends
BaseTest
{
@Autowired
private
AddressRepository
addressRepository
;
List
<
Address
>
records
=
null
;
@BeforeEach
void
setUp
()
{
records
=
new
ArrayList
<>();
Address
addr
=
Address
.
builder
().
address
(
"4142d5087e49e930fc4ff81308e9b7bd1b2b7c914c"
).
balance
(
0L
).
build
();
Address
addr2
=
Address
.
builder
().
address
(
"a2"
).
balance
(
0L
).
build
();
records
.
add
(
addr
);
//records.add(addr2);
}
@Test
void
test
()
{
this
.
addressRepository
.
batchInsertOnDuplicateKey
(
records
);
System
.
out
.
println
(
"**************"
);
}
}
\ No newline at end of file
src/test/java/com/wuban/tron/explore/dao/BlockHeaderRepositoryTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.entity.BlockDayCensus
;
import
com.wuban.tron.explore.entity.BlockHeader
;
import
com.wuban.tron.explore.util.DateUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@Slf4j
class
BlockHeaderRepositoryTest
{
@Autowired
private
BlockHeaderRepository
dao
;
@Autowired
private
BlockDayCensusRepository
censusDao
;
BlockHeader
blockHeader
=
null
;
@BeforeEach
void
setUp
()
{
blockHeader
=
new
BlockHeader
();
blockHeader
.
setCreateTime
(
new
Date
());
blockHeader
.
setTransactionVolume
(
0
);
blockHeader
.
setWitnessSignature
(
"ssssssssss"
);
blockHeader
.
setVersion
(
1
);
blockHeader
.
setTxTrieRoot
(
"rrrrrrrrrr"
);
blockHeader
.
setParentHash
(
"hhhhhhhhhhhh"
);
blockHeader
.
setNumber
(
1L
);
blockHeader
.
setBlockId
(
"bbbbbbbbbbbbbbbb"
);
}
@Test
void
testBatchInsert
()
{
List
<
BlockHeader
>
list
=
new
ArrayList
<>();
list
.
add
(
blockHeader
);
this
.
dao
.
batchInsert
(
list
);
}
@Test
void
testDateDely
()
{
Date
nextDate
=
DateUtil
.
addDays
(
new
Date
(),
1
);
String
date
=
DateUtil
.
getFormatDate
(
nextDate
,
"yyyy-MM-dd"
)
+
" 00:00:01"
;
Long
millis
=
(
DateUtil
.
getDateFromDateStr
(
date
)
-
System
.
currentTimeMillis
())/
1000
;
System
.
out
.
println
(
millis
+
"--------------------"
);
}
@Test
void
testCensusBlockByTime
()
{
BlockDayCensus
data
=
this
.
censusDao
.
censusBlockByTime
(
1600112139000L
,
1600113051000L
);
System
.
out
.
println
(
data
);
}
@Test
void
test
()
{
String
str
=
new
BigInteger
(
"34ff"
,
16
).
toString
();
System
.
out
.
println
(
str
);
}
}
\ No newline at end of file
src/test/java/com/wuban/tron/explore/dao/TransactionRepositoryTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
dao
;
import
com.wuban.tron.explore.BaseTest
;
import
com.wuban.tron.explore.entity.Transaction
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.tron.common.utils.ByteArray
;
import
org.tron.walletserver.WalletApi
;
import
java.util.List
;
class
TransactionRepositoryTest
extends
BaseTest
{
@Autowired
private
TransactionRepository
transactionRepository
;
@BeforeEach
void
setUp
()
{
}
@Test
void
testSelectListByAddress
()
{
String
address
=
"41af2f523da93df32ca91bf387c5cc95b02c1a6635"
;
long
t
=
1600124514272L
;
/* TransactionExample example = new TransactionExample();
example.createCriteria().andOwnerAddressEqualTo(address).andTimestampEqualTo(t);*/
List
<
Transaction
>
list
=
this
.
transactionRepository
.
selectListByAddress
(
address
,
t
);
System
.
out
.
println
(
list
.
size
()
+
"***************************"
+
list
.
toString
());
}
@Test
void
test
()
{
String
hexString
=
"416c4858d8d3435d278a34146d49dd7e126879ba0d"
;
String
base58check
=
WalletApi
.
encode58Check
(
ByteArray
.
fromHexString
(
hexString
));
System
.
out
.
println
(
base58check
);
}
}
\ No newline at end of file
src/test/java/com/wuban/tron/explore/service/impl/BlockDayCensusServiceImplTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.BaseTest
;
import
com.wuban.tron.explore.entity.BlockDayCensus
;
import
com.wuban.tron.explore.entity.example.BlockDayCensusExample
;
import
com.wuban.tron.explore.service.BlockDayCensusService
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
class
BlockDayCensusServiceImplTest
extends
BaseTest
{
@Autowired
private
BlockDayCensusService
service
;
@Test
void
getByPageWithCategory
()
{
BlockDayCensusExample
example
=
new
BlockDayCensusExample
();
PageInfo
<
BlockDayCensus
>
pageInfo
=
this
.
service
.
getByPageWithCategory
(
1
,
10
,
example
);
System
.
out
.
println
(
pageInfo
.
getList
().
toString
());
}
}
\ No newline at end of file
src/test/java/com/wuban/tron/explore/service/impl/LastBlockServiceImplTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.wuban.tron.explore.entity.LastBlock
;
import
com.wuban.tron.explore.service.LastBlockService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@Slf4j
class
LastBlockServiceImplTest
{
@Autowired
private
LastBlockService
lastBlockService
;
@Test
void
getById
()
{
this
.
lastBlockService
.
getByIdForUpdate
(
1L
);
}
@Test
void
getOneByExample
()
{
LastBlock
obj
=
this
.
lastBlockService
.
getOneByExample
();
System
.
out
.
println
();
}
}
\ No newline at end of file
src/test/java/com/wuban/tron/explore/service/impl/TransactionServiceImplTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.github.pagehelper.PageInfo
;
import
com.wuban.tron.explore.BaseTest
;
import
com.wuban.tron.explore.entity.Transaction
;
import
com.wuban.tron.explore.service.TransactionService
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.List
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
TransactionServiceImplTest
extends
BaseTest
{
@Autowired
private
TransactionService
service
;
@Test
void
getByPageWithCategory
()
{
}
@Test
void
getByExample
()
{
}
@Test
void
selectListByAddress
()
{
String
address
=
"41af2f523da93df32ca91bf387c5cc95b02c1a6635"
;
int
type
=
1
;
PageInfo
<
Transaction
>
pageInfo
=
this
.
service
.
selectListByAddress
(
address
,
type
,
1
,
10
);
System
.
out
.
println
(
pageInfo
.
getList
().
toString
());
}
}
\ No newline at end of file
src/test/java/com/wuban/tron/explore/service/impl/TronServiceImplTest.java
0 → 100644
View file @
25af91cc
package
com
.
wuban
.
tron
.
explore
.
service
.
impl
;
import
com.wuban.tron.explore.domain.TronResponseArrayData
;
import
com.wuban.tron.explore.domain.TronResponseData
;
import
com.wuban.tron.explore.service.TronService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@Slf4j
class
TronServiceImplTest
{
@Autowired
private
TronService
tronService
;
@Test
void
getBlockByNum
()
{
TronResponseData
data
=
this
.
tronService
.
getBlockByNum
(
850000L
);
log
.
info
(
data
.
toString
());
}
@Test
void
getBlockByLatestNum
()
{
TronResponseArrayData
data
=
this
.
tronService
.
getBlockByLatestNum
(
1
);
log
.
info
(
data
.
toString
());
}
@Test
void
getAccount
()
{
this
.
tronService
.
getAccount
(
"41705b35c6bb37387cd4cfb57bfc83b74d4374a78a"
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment