Search in sources :

Example 6 with Searchable

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);
}
Also used : Searchable(io.nuls.db.dao.impl.mybatis.util.Searchable)

Example 7 with 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);
}
Also used : Searchable(io.nuls.db.dao.impl.mybatis.util.Searchable)

Example 8 with 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);
}
Also used : Searchable(io.nuls.db.dao.impl.mybatis.util.Searchable)

Example 9 with 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);
}
Also used : Searchable(io.nuls.db.dao.impl.mybatis.util.Searchable)

Example 10 with 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);
}
Also used : Searchable(io.nuls.db.dao.impl.mybatis.util.Searchable)

Aggregations

Searchable (io.nuls.db.dao.impl.mybatis.util.Searchable)25 Page (io.nuls.core.dto.Page)3 PageInfo (com.github.pagehelper.PageInfo)2 BlockHeaderPo (io.nuls.db.entity.BlockHeaderPo)2 TransactionPo (io.nuls.db.entity.TransactionPo)2 NodePo (io.nuls.db.entity.NodePo)1 TransactionLocalPo (io.nuls.db.entity.TransactionLocalPo)1 DbSession (io.nuls.db.transactional.annotation.DbSession)1