<?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.ruoyi.iot.mapper.TChargeRecordMapper">
    <!-- List<TChargeRecordVO> ListByUserId(Long userId); -->
    <select id="ListByUserId" resultMap="ListResultMap">
        SELECT
        <include refid="ListQueryFields"/>
        FROM
        t_charge_record
        WHERE
        user_id=#{usreId}
    </select>
    <sql id="ListQueryFields">
        <if test="true">
            id, create_time, end_time, device_id, status, charge_desc
        </if>
    </sql>

    <resultMap id="ListResultMap" type="com.ruoyi.iot.domain.vo.TChargeRecordVO">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="end_time" property="endTime" />
        <result column="device_id" property="deviceId" />
        <result column="status" property="status" />
        <result column="charge_desc" property="chargeDesc" />
    </resultMap>
</mapper>