package com.engine.recruit.service.impl;

import com.engine.core.impl.Service;
import com.engine.recruit.service.MessageTemplateService;
import weaver.conn.RecordSet;
import weaver.general.Util;

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

/**
 * @author:dxfeng
 * @createTime: 2023/09/26
 * @version: 1.0
 */
public class MessageTemplateServiceImpl extends Service implements MessageTemplateService {
    private static final String MESSAGE_TEMPLATE_TABLE = "uf_jcl_yjtzmb";

    @Override
    public Map<String, Object> getMessageContent(Map<String, Object> params) {
        Map<String, Object> resMap = new HashMap<>();
        String id = Util.null2String(params.get("id"));
        String content = "";
        RecordSet rs = new RecordSet();
        rs.executeQuery("select yjnr from " + MESSAGE_TEMPLATE_TABLE + " where id = ?", id);
        if (rs.next()) {
            content = rs.getString("yjnr");
        }
        resMap.put("content", content);
        return resMap;
    }
}
