package com.imutil.mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Update; /** * 分区表 DDL 执行 Mapper *
* im_message 按月 RANGE 分区,分区名含动态年月(im_message_yyyyMM),无法用静态 SQL, * 故提供 ${sql} 占位的通用执行入口。 *
* SQL 由 {@link com.imutil.service.PartitionService} 按年月在服务端拼装,无外部输入,不存在注入风险。 * * @author imutil */ public interface PartitionMapper { /** * 执行任意 DDL(建分区表) * * @param sql 形如 CREATE TABLE IF NOT EXISTS im_message_yyyyMM PARTITION OF im_message FOR VALUES FROM (...) TO (...) */ @Update("${sql}") void execute(@Param("sql") String sql); }