/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.apache.commons.lang.StringUtils
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.stereotype.Repository
 *  org.springframework.transaction.annotation.Propagation
 *  org.springframework.transaction.annotation.Transactional
 */
package com.hst.taxService.dao.imp;

import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.framework.common.HstSqlMapClientTemplate;
import com.hst.framework.dao.BaseDao;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.domain.WsxtjsnrAppDomain;
import com.hst.taxService.domain.WsxtjsnrDomain;
import com.hst.taxService.domain.WsxtjsnrReturnDomain;
import com.hst.taxService.domain.WsxtkclbAppDomain;
import com.hst.taxService.domain.WsxtkclbDomain;
import com.hst.taxService.domain.WsxtkclbReturnDomain;
import com.hst.taxService.domain.WsxtkcmxAppDomain;
import com.hst.taxService.domain.WsxtkcmxReturnDomain;
import com.hst.taxService.domain.WsxtspmxDomain;
import com.hst.taxService.domain.WsxtspxzrzAppDomain;
import com.hst.taxService.domain.WsxtspxzrzReturnDomain;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Repository
public class TaxWxWsxtAppDaoImp
implements BaseDao {
    @Autowired
    private HstSqlMapClientTemplate sqlMapClientTemplate;

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryWsxtGetList(WsxtkclbAppDomain domain) throws Exception {
        WsxtkclbReturnDomain returnDomain = null;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("swjgDm", domain.getSwjgDm());
        if (HstToolsUtil.isNullOrEmpty(domain.getKcflbm())) {
            map.put("kcflbm", "");
        } else {
            map.put("kcflbm", domain.getKcflbm());
        }
        if (StringUtils.isBlank((String)domain.getPage())) {
            map.put("index", 1);
        } else {
            map.put("index", Integer.valueOf(domain.getPage()));
        }
        if (StringUtils.isBlank((String)domain.getRows())) {
            map.put("size", 10);
        } else {
            map.put("size", Integer.valueOf(domain.getRows()));
        }
        map.put("count", 0);
        map.put("wsxtGetList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryWsxtGetList", "wsxtGetList", map);
        List<WsxtkclbDomain> dataList = new ArrayList();
        dataList = (List)map.get("wsxtGetList");
        returnDomain = new WsxtkclbReturnDomain();
        returnDomain.setCode("00");
        if (dataList == null || dataList.isEmpty()) {
            return returnDomain;
        }
        returnDomain.setDataList(dataList);
        return returnDomain;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryWsxtGetMess(WsxtkcmxAppDomain domain) throws Exception {
        WsxtkcmxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("spkjXh", domain.getSpkjXh());
        map.put("spkjMc", "");
        map.put("spkjZy", "");
        map.put("newbz", "");
        map.put("fbrq", "");
        map.put("keyword", "");
        map.put("llcs", "");
        map.put("xzcs", "");
        map.put("code", "");
        map.put("mess", "");
        map.put("wsxtGetMess", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryWsxtGetMess", "wsxtGetMess", map);
        returnDomain = new WsxtkcmxReturnDomain();
        ArrayList<WsxtspmxDomain> dataList = new ArrayList();
        dataList = (List)map.get("wsxtGetMess");
        if ("00".equals((String)map.get("code"))) {
            // empty if block
        }
        returnDomain.setDataList(dataList);
        returnDomain.setSpkjXh((String)map.get("spkjXh"));
        returnDomain.setSpkjMc(HstToolsUtil.ISO2GBK((String)map.get("spkjMc")));
        returnDomain.setSpkjZy(HstToolsUtil.ISO2GBK((String)map.get("spkjZy")));
        returnDomain.setNewbz((String)map.get("newbz"));
        returnDomain.setFbrq((String)map.get("fbrq"));
        returnDomain.setKeyWord(HstToolsUtil.ISO2GBK((String)map.get("keyword")));
        returnDomain.setLlcs((String)map.get("llcs"));
        returnDomain.setXzcs((String)map.get("xzcs"));
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }

    public TaxCommonReturnDomain queryWsxtPutDownLog(WsxtspxzrzAppDomain domain) throws Exception {
        WsxtspxzrzReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("spkjXh", domain.getSpkjXh());
        if (StringUtils.isNotBlank((String)domain.getXh())) {
            map.put("xh", domain.getXh());
        } else {
            map.put("xh", "");
        }
        if (StringUtils.isNotBlank((String)domain.getWxh())) {
            map.put("wxh", domain.getWxh());
        } else {
            map.put("wxh", "");
        }
        if (StringUtils.isNotBlank((String)domain.getDownTime())) {
            map.put("downTime", domain.getDownTime());
        } else {
            map.put("downTime", "");
        }
        map.put("code", null);
        map.put("mess", null);
        this.sqlMapClientTemplate.queryForObject("queryWsxtPutDownLog", map);
        returnDomain = new WsxtspxzrzReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }

    public TaxCommonReturnDomain queryWsxtGetJsnr(WsxtjsnrAppDomain domain) throws Exception {
        WsxtjsnrReturnDomain returnDomain = new WsxtjsnrReturnDomain();
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("swjgDm", domain.getSwjgDm());
        WsxtjsnrDomain dom = (WsxtjsnrDomain)this.sqlMapClientTemplate.queryForObject("queryWsxtGetJsnr", map);
        returnDomain.setCode("00");
        if (dom.getNr() != null) {
            returnDomain.setNr(new String(dom.getNr()));
        }
        return returnDomain;
    }
}
