/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.orm.ibatis.SqlMapClientTemplate
 *  org.springframework.stereotype.Repository
 */
package com.hst.taxService.dao.imp;

import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.taxService.dao.DzswjCommonDao;
import com.hst.taxService.domain.zjzk.ZjzkYzpsCxslxxAppDoamin;
import com.hst.taxService.domain.zjzk.ZjzkYzpsCxslxxReturnDomain;
import com.hst.taxService.domain.zjzk.ZjzkYzpsMdwhAppDoamin;
import com.hst.taxService.domain.zjzk.ZjzkYzpsMdwhDomain;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class DzswjCommonDaoImp
implements DzswjCommonDao {
    @Autowired
    private SqlMapClientTemplate dzswjSqlMapClientTemplate;

    @Override
    public TaxCommonReturnDomain yzpsMdwh(ZjzkYzpsMdwhAppDoamin appDoamin) throws Exception {
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        returnDomain.setCode("00");
        for (ZjzkYzpsMdwhDomain dom : appDoamin.getDATALIST()) {
            if ("1".equals(dom.getCZBZ())) {
                this.dzswjSqlMapClientTemplate.insert("insertDzswjMfpsmd", (Object)dom);
                continue;
            }
            if (!"2".equals(dom.getCZBZ())) continue;
            this.dzswjSqlMapClientTemplate.delete("deleteDzswjMfpsmd", (Object)dom);
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain yzpsCxslxx(ZjzkYzpsCxslxxAppDoamin appDoamin) throws Exception {
        ZjzkYzpsCxslxxReturnDomain returnDomain = new ZjzkYzpsCxslxxReturnDomain();
        HashMap<String, String> parMap = new HashMap<String, String>();
        parMap.put("DJXH", appDoamin.getDJXH());
        parMap.put("RQ_Q", appDoamin.getRQ_Q());
        parMap.put("RQ_Z", appDoamin.getRQ_Z());
        List dataList = new ArrayList();
        if ("1".equals(appDoamin.getCXLB())) {
            dataList = this.dzswjSqlMapClientTemplate.queryForList("selectYzpsCxSlxxFpdk", parMap);
        } else if ("2".equals(appDoamin.getCXLB())) {
            dataList = this.dzswjSqlMapClientTemplate.queryForList("selectYzpsCxSlxxFplg", parMap);
        }
        returnDomain.setDataList(dataList);
        returnDomain.setCode("00");
        return returnDomain;
    }
}
