<?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.smartor.mapper.ShardingMapper">
|
<select id="getTableCount" resultType="long">
|
SELECT count(*)
|
FROM ${tableName}
|
</select>
|
|
<select id="getMaxId" resultType="long">
|
SELECT max(id)
|
FROM ${tableName}
|
</select>
|
|
<update id="renameTable">
|
RENAME
|
TABLE
|
${oldName}
|
TO
|
${newName}
|
</update>
|
|
<update id="createLikeTable">
|
CREATE TABLE ${newTableName} LIKE ${templateTableName}
|
</update>
|
|
<update id="setAutoIncrement">
|
ALTER TABLE ${tableName} AUTO_INCREMENT = #{value}
|
</update>
|
</mapper>
|