package com.eversec.kit.creator.impl;

import com.eversec.common.Kv;
import com.eversec.kit.creator.ICreator;

import java.io.File;
import java.util.List;
import java.util.Map;

public class DaoMapper extends ICreator {

    private String pkg = ICreator.pkg + ".dao";

    @Override
    public File getFile(String clazz) {
        return new File(filePath(pkg) + clazz + "Mapper.java");
    }

    @Override
    public String createStr(String clazz, List<Map> fieldList, Map para) {

        Kv kv = createTplData(clazz);
        kv.set("remark", para.get("remark"));

        return engine.getTemplate(tplPath + "MapperTpl.java").renderToString(kv);
    }
}
