a
554325746@qq.com
2019-12-25 603cb36a5123e46656b06a5deb8d7ac7ff81307f
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
26
package com.basic.security.manager;
 
import com.basic.security.model.Model;
import com.basic.security.model.ModelAdapter;
import com.basic.security.model.SerfToRow;
import com.basic.security.utils.SqlSplit;
 
import java.util.Map;
 
public class SerfToRowManager extends BaseManager {
 
    public static void addSerfToRow(String sql) {
        String row_table = SqlSplit.getTableName(sql);
        String row_operate_type = SqlSplit.getRowSqlOperateType(sql);
        Map<String, String> rowDataMap = SqlSplit.getRowDataMap(sql);
        ModelAdapter serfToRow = new ModelAdapter();
        serfToRow.setString(SerfToRow.company_id, CompanyManager.getCompanyId());
        serfToRow.setString(SerfToRow.device_id, DeviceManager.getDeviceId());
        serfToRow.setString(SerfToRow.row_id, rowDataMap.get(Model.id));
        serfToRow.setString(SerfToRow.row_sql, sql);
        serfToRow.setString(SerfToRow.row_table, row_table);
        serfToRow.setString(SerfToRow.row_operate_type, row_operate_type);
        serfToRow.setString(com.basic.security.utils.Constants.TABLE, SerfToRow.tableName);
    }
 
}