| | |
| | | package com.doumee.config.mybatis; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.binding.MapperMethod; |
| | | import org.apache.ibatis.executor.Executor; |
| | |
| | | if (target == null) |
| | | return invocation.proceed(); |
| | | // 创建语句 |
| | | // if (SqlCommandType.INSERT == sqlCommandType) { |
| | | // this.handleOperaStatement(target, CREATE_TIME, CREATE_USER); |
| | | // } |
| | | // // 更新语句 |
| | | // else if (SqlCommandType.UPDATE == sqlCommandType) { |
| | | // this.handleOperaStatement(target, UPDATE_TIME, UPDATE_USER); |
| | | // } |
| | | if (SqlCommandType.INSERT == sqlCommandType) { |
| | | this.handleOperaStatement(target, CREATE_TIME, CREATE_USER); |
| | | } |
| | | // 更新语句 |
| | | else if (SqlCommandType.UPDATE == sqlCommandType) { |
| | | this.handleOperaStatement(target, UPDATE_TIME, UPDATE_USER); |
| | | } |
| | | return invocation.proceed(); |
| | | } |
| | | |
| | |
| | | this.setFieldValue(operaTimeField, target, new Date()); |
| | | } |
| | | } |
| | | // 操作人 |
| | | /* // 操作人 |
| | | Field operaUserField = ReflectionUtils.findField(target.getClass(), fieldNames[1]); |
| | | if (operaUserField != null) { |
| | | Object operaUser = this.getFieldValue(operaUserField, target); |
| | | if (operaUser == null && this.getLoginUser()!=null) { |
| | | this.setFieldValue(operaUserField, target, this.getLoginUser().getId()); |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | /** |