package cc.smtweb.framework.core.mvc.service;

import cc.smtweb.framework.core.common.SwMap;

import java.util.HashMap;
import java.util.Map;

//一个sql及其参数，具名参数
public class SqlNamedPara extends SqlPara {
    public SwMap mapParas = new SwMap();
    //字段别名
    public Map<String, String> mapFieldAlias = new HashMap<>();

    public SqlNamedPara(String sql) {
        this.sql = sql;
    }

    public SqlNamedPara(String sql, SwMap paras) {
        this.sql = sql;
        this.mapParas = paras;
    }

    public void addParas(String name, Object value) {
        mapParas.put(name, value);
    }

    public void addFieldAlias(String fieldName, String alias) {
        mapFieldAlias.put(fieldName, alias);
    }
}
