package com.lideeyunji.core.framework.config.aspect.enhance.strategy.sql;

import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
import com.lideeyunji.core.framework.entity.EnhanceSqlEntity;

import java.util.Map;

/**
 * 编辑策略
 */
public class EditEnhanceSqlStrategy extends BaseEnhanceSqlStrategy  implements EnhanceSqlStrategy {

    @Override
    public void execute(EnhanceContext context, EnhanceSqlEntity enhanceSqlEntity) {
        Long dataId = context.getParam().getDataId();
        Map<String, Object> paramMap = context.getParam().getParams();

        paramMap.put("id", dataId);//把id放到json里面传递

        super.executeSql(enhanceSqlEntity.getExecuteSql(), paramMap);
    }

}
