package com.engine.htsc.wdzx.service.imp;

import com.engine.core.impl.Service;

import com.engine.htsc.wdzx.cmd.WdzxTreeNodecmd;
import com.engine.htsc.wdzx.service.WdzxTreeNodeServer;
import org.json.JSONException;
import org.json.JSONObject;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.interfaces.htsc.GlobatTools.JAVATools;

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

/**
 * @author xf
 * @version 1.0.0
 * @ClassName JgxtTreeNodeServerimp.java
 * @createTime 2021年09月17日 16:14:00
 */
public class WdzxTreeNodeServerimp extends Service implements WdzxTreeNodeServer {

    @Override
    public Map<String,Object> createtreenode(User user, Map<String, Object> map) {

        return commandExecutor.execute(new WdzxTreeNodecmd(user,map));
    }

    @Override
    public HashMap<String, Object> getYwcjByid(Map<String, Object> paramsmap) {
        String ywcj = Util.null2String(paramsmap.get("ywcj"));
        JAVATools.writelog("YWCJ=" + ywcj);
        RecordSet rs = new RecordSet();
        String sql = "select * from uf_ywcj where id = (select ywcjsj from uf_ywcj where id = "+ ywcj +")";
        JAVATools.writelog("ywcjsql="+sql);
        rs.execute(sql);
        rs.next();
        HashMap<String, Object> map = new HashMap<>();

        map.put("id",rs.getString("id"));
        map.put("ywcj",rs.getString("ywcj"));
        map.put("ywcjsj",rs.getString("ywcjsj"));

        JAVATools.writelog("obj="+map);
        return map;

    }

    
}
