- <?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.iden.common.mapper.IdenAutoincrKeyMapper">
- <update id="updateMaxValue">
- <!-- AFTER:更新语句执行后执行selectKey -->
- <selectKey resultType="java.lang.Long" keyProperty="maxValue" order="AFTER">
- select max_value FROM iden_autoincr_key where key = #{key}
- </selectKey>
- update iden_autoincr_key set max_value = max_value + 1 where key = #{key}
- </update>
- </mapper>
|