All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hmtools.mapper.plus.mysql.insert.InsertMapperPlusProvider Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
package top.hmtools.mapper.plus.mysql.insert;

import org.apache.ibatis.mapping.MappedStatement;

import tk.mybatis.mapper.mapperhelper.MapperHelper;
import top.hmtools.mapper.plus.mysql.BaseMysql;

/**
 * 通用mapper扩展方法具体实现
 * 
增 * @author Hybomyth * */ public class InsertMapperPlusProvider extends BaseMysql{ public InsertMapperPlusProvider(Class mapperClass, MapperHelper mapperHelper) { super(mapperClass, mapperHelper); } /** * 批量/单个 新增数据 *
注意:本方法不使用主键生成策略 * @param ms * @return */ public String addSome(MappedStatement ms){ final Class entityClass = getEntityClass(ms); return this.mergeToSQLstr(entityClass, "insert/addSome"); } /** * 批量/单个 忽略式新增数据 *
注意:本方法不使用主键生成策略 *
当数据库表中存在相同主键的数据时,则忽略该条记录,继续写入其它记录 * @param ms * @return */ public String addSomeIgnore(MappedStatement ms){ final Class entityClass = getEntityClass(ms); return this.mergeToSQLstr(entityClass, "insert/addSomeIgnore"); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy