<?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.xhpc.charging.station.mapper.XhpcChargingStationPushStatusMapper">

    <update id="editStationsStatus">
        update xhpc_charging_station_push_status set push_status = #{pushStatus}
        <where>
            charging_station_id
            <foreach collection="chargingStationIds" separator="," open="in (" close=")" item="id">
                #{id}
            </foreach>
        </where>
    </update>

    <insert id="insertStationPushStatus">
        insert into xhpc_charging_station_push_status (charging_station_id, station_name, push_status)
        values (#{chargingStationId}, #{stationName}, #{pushStatus})
    </insert>

    <select id="findOne" resultType="Map" parameterType="integer">
        select *
        from xhpc_charging_station_push_status
        where charging_station_id = #{chargingStationId}
    </select>

</mapper>