Explorar o código

skip create_date and create_by column for update

liyuan %!s(int64=2) %!d(string=hai) anos
pai
achega
f7d2ff03fe

+ 9 - 0
ibps-form-root/modules/bo-biz/src/main/java/com/lc/ibps/base/bo/handler/impl/PhysicalTableDataHandlerImpl.java

@@ -72,6 +72,9 @@ public class PhysicalTableDataHandlerImpl implements PhysicalTableDataHandler {
 	private static final Logger logger = LoggerFactory.getLogger(PhysicalTableDataHandlerImpl.class);
 	private static final String WHERE_CLAUSE = " WHERE 1 = 1 ";
 
+	private static final List<String> INSERTABLE_COLUMNS = Arrays.asList(BoTableConstants.BUSINESS_COLUMN_CREATE_BY,
+			BoTableConstants.BUSINESS_COLUMN_CREATE_TIME);
+
 	@Resource
 	private BoAttrColumnQueryDao boAttrColumnQueryDao;
 	@Resource
@@ -642,6 +645,12 @@ public class PhysicalTableDataHandlerImpl implements PhysicalTableDataHandler {
 			}
 			
 			String colName = col.getName();
+
+			//skip create_date and create_by column for update
+			if(INSERTABLE_COLUMNS.contains(colName.toUpperCase())){
+				continue;
+			}
+
 			String attrCode = col.getAttrCode();
 			Object colValue = subDataMap.get(attrCode);