本帖最后由 iocg 于 2014-10-22 08:36 编辑
回复 8# ly5066113
如果现在数据是这样的。。改怎么调整代码??
A- 京,张三,A,1235,TOYOTA,申请,a,401
- 津,李四,D,1237,HONDA,申请,b,401
- 冀,王五,C,1235,MAZDA,申请,c,402
- 皖,小明,D,1233,BUICK,申请,,501
- 内蒙古,小黄,E,1236,SATURN,申请,,501
- 辽,小黄,F,1236,SUBARU,申请,f,601
- 京,张三,A,1235,LEXUS,申请,g,630
- 津,李四,D,1238,HONDA,申请,,701
- 冀,王五,E,1235,MAZDA,申请,,801
- 皖,小红,D,1233,BUICK,申请,j,910
复制代码 B- 京,张三,A,1235,TOYOTA,调整,a,901
- 津,李四,D,1237,HONDA,撤销,,905
- 沪,小雨,B,1237,CITROEN,添加,,908
- 冀,王五,C,1235,MAZDA,调整,,910
- 京,张三,A,1235,TOYOTA,撤销,,910
- 皖,小明,D,1233,BUICK,调整,f,912
- 吉,小胡,A,1237,Bentley,添加,g,1005
- 沪,小雨,B,1237,CITROEN,撤销,h,1006
复制代码 想要的结果- 京,张三,A,1235,TOYOTA,申请,a,401
- 内蒙古,小黄,E,1236,SATURN,申请,,501
- 辽,小黄,F,1236,SUBARU,申请,f,601
- 京,张三,A,1235,LEXUS,申请,g,630
- 津,李四,D,1238,HONDA,申请,,701
- 冀,王五,E,1235,MAZDA,申请,,801
- 皖,小红,D,1233,BUICK,申请,j,910
- 皖,小明,D,1233,BUICK,调整,f,912
- 冀,王五,C,1235,MAZDA,调整,,910
- 吉,小胡,A,1237,Bentley,添加,g,1005
复制代码 对于本例子执行了如下
津,李四,D,1237,HONDA,申请,b,401
津,李四,D,1237,HONDA,撤销,,905 ==>撤销上一条申请,结果是删除该记录
京,张三,A,1235,TOYOTA,申请,a,401
京,张三,A,1235,TOYOTA,调整,a,901
京,张三,A,1235,TOYOTA,撤销,,910 ==>撤销上一条调整,结果是只保留申请记录
冀,王五,C,1235,MAZDA,申请,c,402
冀,王五,C,1235,MAZDA,调整,,910 ==>将申请改为调整,结果是只保留调整记录
皖,小明,D,1233,BUICK,申请,,501
皖,小明,D,1233,BUICK,调整,f,912 ==>将申请改为调整,结果是只保留调整记录
沪,小雨,B,1237,CITROEN,添加,,908
沪,小雨,B,1237,CITROEN,撤销,h,1006 ==>撤销上一条添加,结果是删除新添加的记录
吉,小胡,A,1237,Bentley,添加,g,1005 ==>添加新记录
大家来帮个忙 @bulletmarquis@李满满@rulebook |