/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.apache.commons.beanutils.BeanUtils
 *  org.apache.log4j.Logger
 *  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.HstEncodeUtil;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.dao.imp.TaxWxfwhWycxAppDaoImp;
import com.hst.taxService.domain.wxfwh.GzhSytzggListAppDomain;
import com.hst.taxService.domain.wxfwh.GzhSytzggListDomain;
import com.hst.taxService.domain.wxfwh.GzhSytzggListReturnDomain;
import com.hst.taxService.domain.wxfwh.GzhTzggListAppDomain;
import com.hst.taxService.domain.wxfwh.GzhTzggListDomain;
import com.hst.taxService.domain.wxfwh.GzhTzggListReturnDomain;
import com.hst.taxService.domain.wxfwh.GzhTzggNrAppDomain;
import com.hst.taxService.domain.wxfwh.GzhTzggNrReturnDomain;
import com.hst.taxService.domain.wxfwh.GzhTzggNrfjDomain;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;
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 TaxWxGzhAppDaoImp
implements BaseDao {
    @Autowired
    private HstSqlMapClientTemplate sqlMapClientTemplate;
    private static Logger _log = Logger.getLogger(TaxWxfwhWycxAppDaoImp.class);

    public TaxCommonReturnDomain gzhTzggList(GzhTzggListAppDomain domain) throws Exception {
        GzhTzggListReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("swjgDm", domain.getSwjgDm());
        map.put("openId", domain.getOpenId());
        if (HstToolsUtil.isNullOrEmpty(domain.getStr())) {
            map.put("str", "");
        } else {
            map.put("str", HstEncodeUtil.GBK2ISO(domain.getStr()));
        }
        if (HstToolsUtil.isNullOrEmpty(domain.getRows())) {
            map.put("rows", "10");
        } else {
            map.put("rows", domain.getRows());
        }
        if (HstToolsUtil.isNullOrEmpty(domain.getPage())) {
            map.put("page", "1");
        } else {
            map.put("page", domain.getPage());
        }
        map.put("code", "");
        map.put("mess", "");
        map.put("dataList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("gzhTzggListCurr", "dataList", map);
        ArrayList<GzhTzggListDomain> dataList = new ArrayList();
        dataList = (List)map.get("dataList");
        returnDomain = new GzhTzggListReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        returnDomain.setDataList(dataList);
        return returnDomain;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain gzhTzggNr(GzhTzggNrAppDomain domain) throws Exception {
        GzhTzggNrReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("swjgDm", domain.getSwjgDm());
        map.put("openId", domain.getOpenId());
        map.put("tzggXh", domain.getTzggXh());
        map.put("code", "");
        map.put("mess", "");
        map.put("dataList", null);
        map.put("fjDataList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("gzhTzggNrCurr", map, "dataList", "fjDataList");
        List dataList = new ArrayList();
        ArrayList<GzhTzggNrfjDomain> fjDataList = new ArrayList();
        dataList = (List)map.get("dataList");
        fjDataList = (List)map.get("fjDataList");
        returnDomain = new GzhTzggNrReturnDomain();
        if (dataList.size() > 0) {
            BeanUtils.copyProperties((Object)returnDomain, dataList.get(0));
            returnDomain.setCode((String)map.get("code"));
            returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
            returnDomain.setFjDataList(fjDataList);
        } else {
            returnDomain.setCode("01");
            returnDomain.setMess("\u4e0d\u5b58\u5728\u8be5\u5e8f\u53f7\u901a\u77e5\u516c\u544a\uff01");
        }
        return returnDomain;
    }

    public TaxCommonReturnDomain gzhSytzggList(GzhSytzggListAppDomain domain) throws Exception {
        GzhSytzggListReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("swjgDm", domain.getSwjgDm());
        map.put("openId", domain.getOpenId());
        if (HstToolsUtil.isNullOrEmpty(domain.getStr())) {
            map.put("str", "");
        } else {
            map.put("str", HstEncodeUtil.GBK2ISO(domain.getStr()));
        }
        if (HstToolsUtil.isNullOrEmpty(domain.getRows())) {
            map.put("rows", "10");
        } else {
            map.put("rows", domain.getRows());
        }
        if (HstToolsUtil.isNullOrEmpty(domain.getPage())) {
            map.put("page", "1");
        } else {
            map.put("page", domain.getPage());
        }
        this.sqlMapClientTemplate.queryForObjectByCurr("GzhSytzggListCurr", "dataList", map);
        ArrayList<GzhSytzggListDomain> dataList = new ArrayList();
        dataList = (List)map.get("dataList");
        returnDomain = new GzhSytzggListReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        returnDomain.setDataList(dataList);
        return returnDomain;
    }
}
