use of io.nuls.db.dao.impl.mybatis.util.Searchable in project nuls by nuls-io.
the class UtxoOutputDaoImpl method getRewardByBlockHeight.
@Override
public long getRewardByBlockHeight(long height) {
Searchable searchable = new Searchable();
searchable.addCondition("a.type", SearchOperator.eq, TransactionConstant.TX_TYPE_COIN_BASE);
searchable.addCondition("a.block_height", SearchOperator.eq, height);
return getMapper().getCoinBaseReward(searchable);
}
use of io.nuls.db.dao.impl.mybatis.util.Searchable in project nuls by nuls-io.
the class UtxoOutputDaoImpl method getAccountUnSpend.
@Override
public List<UtxoOutputPo> getAccountUnSpend(String address) {
Searchable searchable = new Searchable();
searchable.addCondition("status", SearchOperator.ne, 2);
searchable.addCondition("address", SearchOperator.eq, address);
PageHelper.orderBy("status asc, value asc");
return getMapper().selectList(searchable);
}
use of io.nuls.db.dao.impl.mybatis.util.Searchable in project nuls by nuls-io.
the class UtxoOutputDaoImpl method getAgentReward.
@Override
public long getAgentReward(String address, int type) {
Searchable searchable = new Searchable();
searchable.addCondition("c.type", SearchOperator.eq, TransactionConstant.TX_TYPE_COIN_BASE);
if (type == 1) {
searchable.addCondition("a.agent_address", SearchOperator.eq, address);
} else {
searchable.addCondition("a.packing_address", SearchOperator.eq, address);
}
return getMapper().getAgentReward(searchable);
}
use of io.nuls.db.dao.impl.mybatis.util.Searchable in project nuls by nuls-io.
the class UtxoOutputDaoImpl method deleteByHash.
@Override
public void deleteByHash(String txHash) {
Searchable searchable = new Searchable();
searchable.addCondition("tx_hash", SearchOperator.eq, txHash);
getMapper().deleteBySearchable(searchable);
}
use of io.nuls.db.dao.impl.mybatis.util.Searchable in project nuls by nuls-io.
the class UtxoOutputDaoImpl method getAccountOutputs.
@Override
public List<UtxoOutputPo> getAccountOutputs(int txType, String address, Long beginTime, Long endTime) {
Searchable searchable = new Searchable();
searchable.addCondition("a.type", SearchOperator.eq, txType);
searchable.addCondition("b.address", SearchOperator.eq, address);
if (beginTime != null) {
searchable.addCondition("a.create_time", SearchOperator.gte, beginTime);
}
if (endTime != null) {
searchable.addCondition("a.create_time", SearchOperator.lte, endTime);
}
return getMapper().selectAccountOutput(searchable);
}
Aggregations