/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.apache.commons.beanutils.BeanUtils
 *  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.bo.WxYgzPxdj;
import com.hst.common.bo.WxYgzZxd;
import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.framework.common.HstSqlMapClientTemplate;
import com.hst.framework.constants.WebConstants;
import com.hst.framework.dao.BaseDao;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.domain.SjcxNsrxxAppDomain;
import com.hst.taxService.domain.SjcxNsrxxReturnDomain;
import com.hst.taxService.domain.SjcxSbqxAppDomain;
import com.hst.taxService.domain.SjcxSbqxDomain;
import com.hst.taxService.domain.SjcxSbqxReturnDomain;
import com.hst.taxService.domain.SjcxYgzZxdCxAppDomain;
import com.hst.taxService.domain.SjcxYgzZxdDomain;
import com.hst.taxService.domain.SjcxYgzZxdReturnDomain;
import com.hst.taxService.domain.WxSjcxYgzPxdjAppDomain;
import com.hst.taxService.domain.WxSjcxYgzPxdjReturnDomain;
import com.hst.taxService.domain.WxSjcxYgzZxdAppDomain;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
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 TaxWxSjcxAppDaoImp
implements BaseDao {
    @Autowired
    private HstSqlMapClientTemplate sqlMapClientTemplate;

    public TaxCommonReturnDomain queryNsrxx(SjcxNsrxxAppDomain domain) throws Exception {
        SjcxNsrxxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("nsrsbh", domain.getNsrsbh());
        map.put("code", null);
        map.put("mess", null);
        map.put("nsrxxList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryNsrxxList", "nsrxxList", map);
        List dataList = new ArrayList();
        dataList = (List)map.get("nsrxxList");
        returnDomain = dataList == null || dataList.isEmpty() ? new SjcxNsrxxReturnDomain() : (SjcxNsrxxReturnDomain)dataList.get(0);
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }

    public TaxCommonReturnDomain querySbqx(SjcxSbqxAppDomain domain) throws Exception {
        SjcxSbqxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("sbyf", domain.getSbyf());
        map.put("sbqxList", null);
        map.put("code", null);
        map.put("mess", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("querySbqxList", "sbqxList", map);
        List<SjcxSbqxDomain> dataList = new ArrayList();
        dataList = (List)map.get("sbqxList");
        returnDomain = new SjcxSbqxReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        if (dataList == null || dataList.isEmpty()) {
            return returnDomain;
        }
        returnDomain.setDataList(dataList);
        return returnDomain;
    }

    public TaxCommonReturnDomain doYgzPxdj(WxSjcxYgzPxdjAppDomain domain) throws Exception {
        WxSjcxYgzPxdjReturnDomain returnDomain = new WxSjcxYgzPxdjReturnDomain();
        WxYgzPxdj bo = new WxYgzPxdj();
        String databaseUsername = WebConstants.HST_PROP_MAP.get("hst.SCHEMA_TM");
        BeanUtils.copyProperties((Object)bo, (Object)domain);
        bo.setSfzhm(domain.getSfzh());
        bo.setDatabaseUsername(databaseUsername);
        bo.setYxbz("Y");
        this.sqlMapClientTemplate.insert("insertWxYgzPxdj", bo);
        returnDomain.setCode("00");
        return returnDomain;
    }

    @Transactional(readOnly=false, propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain saveYgzZxd(WxSjcxYgzZxdAppDomain domain) throws Exception {
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        WxYgzZxd bo = new WxYgzZxd();
        String databaseUsername = WebConstants.HST_PROP_MAP.get("hst.SCHEMA_TM");
        BeanUtils.copyProperties((Object)bo, (Object)domain);
        bo.setDatabaseUsername(databaseUsername);
        this.sqlMapClientTemplate.insert("insertWxYgzZxd", bo);
        returnDomain.setCode("00");
        return returnDomain;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryYgzZxd(SjcxYgzZxdCxAppDomain domain) throws Exception {
        SjcxYgzZxdReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("ssSwjgDm", domain.getSsSwjgDm());
        map.put("sjhm", domain.getSjhm());
        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", null);
        map.put("mess", null);
        map.put("ygzZxdList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryYgzZxdList", "ygzZxdList", map);
        List<SjcxYgzZxdDomain> dataList = new ArrayList();
        dataList = (List)map.get("ygzZxdList");
        returnDomain = new SjcxYgzZxdReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        if (dataList == null || dataList.isEmpty()) {
            return returnDomain;
        }
        returnDomain.setDataList(dataList);
        return returnDomain;
    }
}
