<?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="com.muchinfo.mtp3interface.mapper.IEnumdicitemMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.muchinfo.mtp3pojos.entity.Enumdicitem">
        <id column="AUTOID" property="autoid" />
        <result column="ENUMDICID" property="enumdicid" />
        <result column="ENUMDICCODE" property="enumdiccode" />
        <result column="ENUMDICNAME" property="enumdicname" />
        <result column="ENUMITEMNAME" property="enumitemname" />
        <result column="ENUMITEMSTATUS" property="enumitemstatus" />
        <result column="BANKMAPPEDVALUE" property="bankmappedvalue" />
        <result column="REMARK" property="remark" />
        <result column="ENUMITEMVALUE" property="enumitemvalue" />
        <result column="PARAM1" property="param1" />
        <result column="PARAM2" property="param2" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        AUTOID, ENUMDICID, ENUMDICCODE, ENUMDICNAME, ENUMITEMNAME, ENUMITEMSTATUS, BANKMAPPEDVALUE, REMARK, ENUMITEMVALUE, PARAM1, PARAM2
    </sql>

    <select id="selectCurrencyName" resultType="string" parameterType="java.lang.Long">
        select
        e.enumdicname
        from ENUMDICITEM e
        <where>
            e.enumdiccode = 'currency'
            and e.enumitemname = #{emvalue}
        </where>
    </select>
    <select id="selectInternational" resultType="com.muchinfo.mtp3pojos.entity.Enumdicitem"
            parameterType="java.lang.String">
        select e.*,ex.ENUMDICNAMEEN enumdicnameen,
               ex.ENUMDICNAMEZH_TW enumdicnamezhtw,ex.ENUMDICNAMETH enumdicnameth,
               ex.ENUMDICNAMEVI enumdicnamevi
        from ENUMDICITEM e left join enumdicitemex ex on e.ENUMDICCODE = ex.ENUMDICCODE and e.enumitemname = ex.enumitemname
        where e.ENUMDICCODE = #{typeCode}
    </select>
    <select id="querybiztypeList" resultType="com.muchinfo.mtp3pojos.entity.Enumdicitem"
            parameterType="java.lang.String">
        select t.enumitemname,t.enumdicname from ENUMDICITEM t
        where t.enumdiccode =
              'extendbiztype'
          and t.enumitemname not in
              (select
                   distinct b.extendbiztype from BANK_CUSBANKEXTENDCONFIG b where
                   b.cusbankid = #{cusbankid,jdbcType=VARCHAR})
    </select>

</mapper>
