/*
 * 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.BswdBsdtListAppDomain;
import com.hst.taxService.domain.BswdBsdtListDomain;
import com.hst.taxService.domain.BswdBsdtListReturnDomain;
import com.hst.taxService.domain.BswdBsdtLsDhxxAppDomain;
import com.hst.taxService.domain.BswdBsdtLsDhxxDomain;
import com.hst.taxService.domain.BswdBsdtLsDhxxReturnDomain;
import com.hst.taxService.domain.BswdBsdtMessAppDomain;
import com.hst.taxService.domain.BswdBsdtMessDomain;
import com.hst.taxService.domain.BswdBsdtMessReturnDomain;
import com.hst.taxService.domain.BswdShhwdListAppDomain;
import com.hst.taxService.domain.BswdShhwdListDomain;
import com.hst.taxService.domain.BswdShhwdListReturnDomain;
import com.hst.taxService.domain.BswdShhwdMessAppDomain;
import com.hst.taxService.domain.BswdShhwdMessReturnDomain;
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 TaxWxBswdAppDaoImp
implements BaseDao {
    @Autowired
    private HstSqlMapClientTemplate sqlMapClientTemplate;

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryBswdGetBsdtList(BswdBsdtListAppDomain domain) throws Exception {
        BswdBsdtListReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("swjgDm", domain.getSwjgDm());
        map.put("code", null);
        map.put("mess", null);
        map.put("bswdGetBsdtList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryBswdGetBsdtList", "bswdGetBsdtList", map);
        List<BswdBsdtListDomain> dataList = new ArrayList();
        returnDomain = new BswdBsdtListReturnDomain();
        dataList = (List)map.get("bswdGetBsdtList");
        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;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryBswdGetBsdtMess(BswdBsdtMessAppDomain domain) throws Exception {
        BswdBsdtMessReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("bsdtDjxh", domain.getBsdtDjxh());
        map.put("code", null);
        map.put("mess", null);
        map.put("bswdBsdtMess", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryBswdGetBsdtMess", "bswdBsdtMess", map);
        returnDomain = new BswdBsdtMessReturnDomain();
        List<BswdBsdtMessDomain> dataList = new ArrayList();
        dataList = (List)map.get("bswdBsdtMess");
        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;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryBswdGetBsdtLsDhxx(BswdBsdtLsDhxxAppDomain domain) throws Exception {
        BswdBsdtLsDhxxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("bsdtDjxh", domain.getBsdtDjxh());
        if (StringUtils.isNotBlank((String)domain.getRq())) {
            map.put("rq", domain.getRq());
        } else {
            map.put("rq", "");
        }
        if (StringUtils.isNotBlank((String)domain.getDays())) {
            map.put("days", domain.getDays());
        } else {
            map.put("days", "");
        }
        if (StringUtils.isNotBlank((String)domain.getGzrbz())) {
            map.put("gzrbz", domain.getGzrbz());
        } else {
            map.put("gzrbz", "");
        }
        map.put("code", null);
        map.put("mess", null);
        map.put("bswdBsdtLsDhxx", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryBswdGetBsdtLsDhxx", "bswdBsdtLsDhxx", map);
        returnDomain = new BswdBsdtLsDhxxReturnDomain();
        List<BswdBsdtLsDhxxDomain> dataList = new ArrayList();
        dataList = (List)map.get("bswdBsdtLsDhxx");
        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;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryBswdGetShhwdList(BswdShhwdListAppDomain domain) throws Exception {
        BswdShhwdListReturnDomain returnDomain = null;
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("swjgDm", domain.getSwjgDm());
        if (StringUtils.isNotBlank((String)domain.getWgdlx())) {
            map.put("wgdlx", domain.getWgdlx());
        } else {
            map.put("wgdlx", "");
        }
        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("bswdShhwdList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryBswdGetShhwdList", "bswdShhwdList", map);
        returnDomain = new BswdShhwdListReturnDomain();
        List<BswdShhwdListDomain> dataList = new ArrayList();
        dataList = (List)map.get("bswdShhwdList");
        returnDomain.setCode("00");
        if (dataList == null || dataList.isEmpty()) {
            return returnDomain;
        }
        returnDomain.setDataList(dataList);
        return returnDomain;
    }

    @Transactional(propagation=Propagation.REQUIRED)
    public TaxCommonReturnDomain queryBswdGetShhwdMess(BswdShhwdMessAppDomain domain) throws Exception {
        BswdShhwdMessReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        if (StringUtils.isNotBlank((String)domain.getDwdm())) {
            map.put("dwDm", domain.getDwdm());
        } else {
            map.put("dwDm", "");
        }
        if (StringUtils.isNotBlank((String)domain.getWtdzxh())) {
            map.put("wtdzxh", domain.getWtdzxh());
        } else {
            map.put("wtdzxh", "");
        }
        map.put("code", null);
        map.put("mess", null);
        map.put("bswdShhwdMess", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("queryBswdGetShhwdMess", "bswdShhwdMess", map);
        returnDomain = new BswdShhwdMessReturnDomain();
        List dataList = new ArrayList();
        dataList = (List)map.get("bswdShhwdMess");
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        if (dataList == null || dataList.isEmpty()) {
            return returnDomain;
        }
        returnDomain = (BswdShhwdMessReturnDomain)dataList.get(0);
        return returnDomain;
    }
}
