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

    <insert id="insert">
        INSERT INTO xhpc_img(url,terminal_id) VALUES(#{imgUrl},#{terminalId})
    </insert>

    <select id="selectImgUrlByTerminal_id" resultType="map">
        SELECT url,terminal_id as terminalId
        FROM xhpc_img
        where 1=1
        <if test="list!=null">
            and terminal_id in
            <foreach collection="list" item="terminalId" open="(" close=")" separator=",">
                #{terminalId}
            </foreach>
        </if>
    </select>

</mapper>
