| | |
| | | import com.java110.dto.order.OrderItemDto; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.apache.ibatis.executor.Executor; |
| | | import org.apache.ibatis.mapping.BoundSql; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.ParameterMapping; |
| | | import org.apache.ibatis.mapping.SqlCommandType; |
| | | import org.apache.ibatis.plugin.*; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.plugin.Intercepts; |
| | | import org.apache.ibatis.plugin.Invocation; |
| | | import org.apache.ibatis.plugin.Plugin; |
| | | import org.apache.ibatis.plugin.Signature; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.apache.ibatis.session.Configuration; |
| | | import org.apache.ibatis.type.TypeHandlerRegistry; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.http.*; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.DateFormat; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | |
| | | @Intercepts({ |
| | | @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, |
| | |
| | | |
| | | if (deleteDatas != null && deleteDatas.size() > 0) { |
| | | for (Map<String, Object> map : deleteDatas) { |
| | | dealReturnMap(map); |
| | | preValues.add(map); |
| | | } |
| | | } |
| | |
| | | |
| | | if (deleteDatas != null && deleteDatas.size() > 0) { |
| | | for (Map<String, Object> map : deleteDatas) { |
| | | dealReturnMap(map); |
| | | preValues.add(map); |
| | | afterVaule = new JSONObject(); |
| | | afterVaule.putAll(map); |
| | |
| | | } |
| | | } |
| | | |
| | | private void dealReturnMap(Map<String, Object> map) { |
| | | for (String key : map.keySet()) { |
| | | Object value = map.get(key); |
| | | if (value instanceof String) { |
| | | map.put(key, "'" + map.get(key) + "'"); |
| | | } else if (value instanceof Date) { |
| | | String tmpValue = DateUtil.getFormatTimeString((Date) value, DateUtil.DATE_FORMATE_STRING_A); |
| | | map.put(key, "'" + tmpValue + "'"); |
| | | } else if (value instanceof Timestamp) { |
| | | Date date = new Date(((Timestamp) value).getTime()); |
| | | String tmpValue = DateUtil.getFormatTimeString(date, DateUtil.DATE_FORMATE_STRING_A); |
| | | map.put(key, "'" + tmpValue + "'"); |
| | | } else if(value instanceof Double){ |
| | | map.put(key, "'" + map.get(key) + "'"); |
| | | }else { |
| | | if (value != null) { |
| | | map.put(key, "'" + value.toString() + "'"); |
| | | } else { |
| | | map.put(key, "''"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理insert 语句 |
| | | * |