沙世明
2022-09-13 bfca7a84bec815da594f1d12558535ed06d2490b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
global class DeleteDataTestBatch implements Database.Batchable<sObject> {
    public String query;
 
    global DeleteDataTestBatch() {
        this.query = query;
    }
 
    global Database.QueryLocator start(Database.BatchableContext bc) {
        String query = 'select id ,name,IF_Coverage_Target_Asset__c  from asset where  IF_Coverage_Target_Asset__c  = \'1\' and hospital__c = \'0011000000V9Q8U\'';
        return Database.getQueryLocator(query);
    }
 
    global void execute(Database.BatchableContext BC, list<asset> assetList) {
        List<Asset> asslist = new List<Asset>();
        for(Asset ass1:assetList){
            ass1.IF_Coverage_Target_Asset__c = '0';
            asslist.add(ass1);
        }
        update asslist;
    }
 
    global void finish(Database.BatchableContext BC) {
 
    }
}