<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.gov.customs.wxjy.base.dao.BaseCodeDao">
    <resultMap id="CountryResultMap" type="cn.gov.customs.wxjy.base.pojo.Country">
        <id column="COUNTRY_CODE" jdbcType="VARCHAR" property="countryCode"/>
        <result column="ISO_E" jdbcType="VARCHAR" property="isoE"/>
        <result column="COUN_C_NAME" jdbcType="VARCHAR" property="counCName"/>
        <result column="COUN_E_NAME" jdbcType="VARCHAR" property="counEName"/>
        <result column="ABBR_C" jdbcType="VARCHAR" property="abbrC"/>
        <result column="EXAM_MARK" jdbcType="VARCHAR" property="examMark"/>
        <result column="HIGH_LOW" jdbcType="VARCHAR" property="highLow"/>
    </resultMap>

    <resultMap id="CustomsResultMap" type="cn.gov.customs.wxjy.base.pojo.Customs">
        <id column="CUSTOMS_CODE" jdbcType="VARCHAR" property="customsCode"/>
        <result column="CUSTOMS_NAME" jdbcType="VARCHAR" property="customsName"/>
        <result column="ABBR_CUST" jdbcType="VARCHAR" property="abbrCust"/>
    </resultMap>

    <resultMap id="TradeResultMap" type="cn.gov.customs.wxjy.base.pojo.Trade">
        <id column="TRADE_MODE" jdbcType="VARCHAR" property="tradeMode"/>
        <result column="ABBR_TRADE" jdbcType="VARCHAR" property="abbrTrade"/>
        <result column="FULL_TRADE" jdbcType="VARCHAR" property="fullTrade"/>
    </resultMap>

    <resultMap id="TransfResultMap" type="cn.gov.customs.wxjy.base.pojo.Transf">
        <id column="TRAF_CODE" jdbcType="VARCHAR" property="trafCode"/>
        <result column="TRAF_SPEC" jdbcType="VARCHAR" property="trafSpec"/>
    </resultMap>

    <resultMap id="UnitResultMap" type="cn.gov.customs.wxjy.base.pojo.Unit">
        <id column="UNIT_CODE" jdbcType="VARCHAR" property="unitCode"/>
        <result column="UNIT_NAME" jdbcType="VARCHAR" property="unitName"/>
        <result column="CONV_CODE" jdbcType="VARCHAR" property="convCode"/>
        <result column="CONV_RATIO" jdbcType="NUMERIC" property="convRatio"/>
    </resultMap>

    <select id="getCountryList" resultMap="CountryResultMap">
        SELECT * FROM WXJY_APP_COUNTRY
    </select>

    <select id="getCountryByIso"  resultType="cn.gov.customs.wxjy.base.pojo.Country">
        SELECT * FROM WXJY_APP_COUNTRY where ISO_E = #{isoE}
    </select>

    <select id="getCountryByCode"  resultType="cn.gov.customs.wxjy.base.pojo.Country">
        SELECT * FROM WXJY_APP_COUNTRY where COUNTRY_CODE = #{countryCode}
    </select>

    <select id="getCustomsList" resultMap="CustomsResultMap">
        SELECT * FROM WXJY_APP_CUSTOMS
    </select>

    <select id="getCustomsByCode"  resultType="cn.gov.customs.wxjy.base.pojo.Customs">
        SELECT * FROM WXJY_APP_CUSTOMS where CUSTOMS_CODE = #{customsCode}
    </select>

    <select id="getTradeList" resultMap="TradeResultMap">
        SELECT * FROM WXJY_APP_TRADE
    </select>

    <select id="getTradeByCode"  resultType="cn.gov.customs.wxjy.base.pojo.Trade">
        SELECT * FROM WXJY_APP_TRADE where TRADE_MODE = #{tradeMode}
    </select>

    <select id="getTransfList" resultMap="TransfResultMap">
        SELECT * FROM WXJY_APP_TRANSF
    </select>

    <select id="getTransByCode"  resultType="cn.gov.customs.wxjy.base.pojo.Transf">
        SELECT * FROM WXJY_APP_TRANSF where TRAF_CODE = #{trafCode}
    </select>

    <select id="getUnitList" resultMap="UnitResultMap">
        SELECT * FROM WXJY_APP_UNIT
    </select>

    <select id="getUnitByCode"  resultType="cn.gov.customs.wxjy.base.pojo.Unit">
        SELECT * FROM WXJY_APP_UNIT where UNIT_CODE = #{unitCode}
    </select>
</mapper>