<?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.LeaseNexaMachineAvgPowerMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.m2pool.lease.entity.LeaseNexaMachineAvgPower">
        <id column="id" property="id" />
        <result column="user" property="user" />
        <result column="miner" property="miner" />
        <result column="start_time" property="startTime" />
        <result column="end_time" property="endTime" />
        <result column="real_avg_power" property="realAvgPower" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, user, miner, start_time, end_time, real_avg_power
    </sql>
    <insert id="insertBatchDatas">
        insert into lease_nexa_machine_avg_power (user, miner, start_time, end_time, real_avg_power) values
        <foreach collection="list" item="item" separator=",">
            (#{item.user}, #{item.miner}, #{item.startTime}, #{item.endTime}, #{item.realAvgPower})
        </foreach>
        ON DUPLICATE KEY UPDATE
        `start_time` = VALUES(`start_time`),
        `end_time` = VALUES(`end_time`),
        `real_avg_power` = VALUES(`real_avg_power`)
    </insert>
    <select id="selectListByUserAndMiner" resultType="com.m2pool.lease.entity.LeaseNexaMachineAvgPower">

    </select>

</mapper>
