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

top.hmtools.mapper.plus.mysql.update.IMysqlUpdateMapperPlus Maven / Gradle / Ivy

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

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;

import tk.mybatis.mapper.annotation.RegisterMapper;
@RegisterMapper
public interface IMysqlUpdateMapperPlus {
	
	//################################	改
	
		/**
		 *  修改一条数据,如果属性为 null ,或者 为空字符串,则忽略这些属性
		 *  
注意:key 是否为null,是否为空字符串,是否为 不存在的属性;obj 是否为null;obj 主键值是否为null,空字符串; *
入参均不得为null或者为空,为防止造成误修改数据,目前采用SQL语句错误方式处理(“where”后面无内容) * @param key 主键名称(Java类主键属性名称) * @param obj * @return */ @UpdateProvider(type = UpdateMapperPlusProvider.class,method="dynamicSQL") Integer updateOneByPkIgnoreNullEmpty(@Param(value="key")String key,@Param(value="obj")T obj); /** * 修改一条数据,不忽略 null,空字符串 *
注意:key 是否为null,是否为空字符串,是否为 不存在的属性;obj 是否为null;obj 主键值是否为null,空字符串; *
入参均不得为null或者为空,为防止造成误修改数据,目前采用SQL语句错误方式处理(“where”后面无内容) * @param key * @param obj * @return */ @UpdateProvider(type = UpdateMapperPlusProvider.class,method="dynamicSQL") Integer updateOneByPk(@Param(value="key")String key,@Param(value="obj")T obj); /** * 批量修改指定主键名称、指定主键值集合的指定列的指定值 *
主键数据类型为字符串 * @param statekey * @param statevalue * @param key * @param ids * @return */ @UpdateProvider(type = UpdateMapperPlusProvider.class,method="dynamicSQL") Integer updateSomeTheColumnByPk(@Param(value="stateKey")String columnKey,@Param(value="stateValue")Object columnValue,@Param(value="key")String key,@Param(value="ids")String... ids); /** * 批量修改指定主键名称、指定主键值集合的指定列的指定值 *
主键数据类型为整数 * @param columnKey * @param columnValue * @param key * @param ids * @return */ @UpdateProvider(type = UpdateMapperPlusProvider.class,method="dynamicSQL") Integer updateSomeTheColumnByIntPk(@Param(value="stateKey")String columnKey,@Param(value="stateValue")Object columnValue,@Param(value="key")String key,@Param(value="ids")Integer... ids); /** * 批量修改,忽略 为空的字段(属性) *
注意:本方法目前没有经过全面的测试,可能存在误修改数据风险,建议慎重使用!!!! * @param key * @param beans * @return */ @Deprecated @UpdateProvider(type = UpdateMapperPlusProvider.class,method="dynamicSQL") Integer updateSomeByPkIgnoreNullEmpty(@Param(value="key")String key,@Param(value="beans")T... beans); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy