<?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.bonus.canteen.core.device.mapper.ParamSettingMapper">
    <update id="update">
        update param_setting
        set ip_address     = #{ipAddress},
            face_pass_rate = #{facePassRate},
            mqtt_address   = #{mqttAddress},
            mqtt_user_name = #{mqttUserName},
            mqtt_pass_word  = #{mqttPassword},
            app_id         = #{appId},
            app_key        = #{appKey},
            photo_prefixes = #{photoPrefixes},
            version        = #{version} + 1
        where id = #{id}
    </update>
    <select id="getInfo" resultType="com.bonus.canteen.core.device.vo.ParamSettingVO">
        select id,
               ip_address     as ipAddress,
               face_pass_rate as facePassRate,
               mqtt_address   as mqttAddress,
               mqtt_user_name as mqttUserName,
               mqtt_pass_word as mqttPassword,
               app_id         as appId,
               app_key        as appKey,
               photo_prefixes as photoPrefixes,
               version
        from param_setting
        limit 1
    </select>
</mapper>
