<?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.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterHistoryMapper">
	<select id="sum" resultType="Map">
		SELECT

		sum(power_generation) AS power,

		sum(daily_return) AS dailyReturn,

		sum(generation_hours) AS hours

		FROM house_pv_data.td_hygf_jp_inverter_history
		<where>
			<if test="snCode!=null">
			AND `sn_code` = #{snCode}
		    </if>
			<if test="thirdStationId!=null">
			AND `third_station_id` = #{thirdStationId}
		    </if>
			<if test="date!=null">
			AND `date` LIKE #{date}
			</if>
		</where>
	</select>
</mapper>
