<?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.m2pool.lease.mapper.LeaseAutoAddressMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.m2pool.lease.entity.LeaseAutoAddress">
        <id column="id" property="id" />
        <result column="address" property="address" />
        <result column="status" property="status" />
        <result column="from_symbol" property="fromSymbol" />
        <result column="from_chain" property="fromChain" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, address, status,from_symbol,from_chain
    </sql>
    <select id="getOneStatusIsNoUse" resultType="com.m2pool.lease.entity.LeaseAutoAddress">
        select address, from_symbol as fromSymbol,from_chain as fromChain from lease_auto_address where status = 0 limit 1
    </select>
    <select id="getValidAddress" resultType="com.m2pool.lease.dto.UserWalletDataDto">
        select address as fromAddress,from_symbol as fromSymbol,from_chain as fromChain from lease_auto_address where status = 1;
    </select>


</mapper>
