<?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.yida.data.device.studentCard.mapper.EduStudentCardJimiAccountMapper">
    <select id="getUseAccount"
            resultType="com.yida.data.common.core.entity.card.EduStudentCardJimiAccount">
        select *
        from edu_student_card_jimi_account
        where fence_num+#{num} <![CDATA[<=]]> 1000
        order by id
        limit 1
    </select>

    <update id="updateJimiAccountFenceNum">
        update edu_student_card_jimi_account
        set fence_num=fence_num+#{num}
        where id=#{id}
    </update>
</mapper>
