<?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.simuwang.base.mapper.FundAliasMapper">
    <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.FundAliasDO">
        <id column="id" property="id"/>
        <result column="source_fund_name" property="sourceFundName"/>
        <result column="source_register_number" property="sourceRegisterNumber"/>
        <result column="target_fund_id" property="targetFundId"/>
        <result column="target_fund_name" property="targetFundName"/>
        <result column="target_register_number" property="targetRegisterNumber"/>
        <result column="isvalid" property="isvalid"/>
        <result column="creatorid" property="creatorId"/>
        <result column="createtime" property="createTime"/>
        <result column="updaterid" property="updaterId"/>
        <result column="updatetime" property="updateTime"/>
    </resultMap>


    <select id="queryFundByNameAndRegisterNumber" resultType="java.lang.String">
        select target_fund_id
        from PPW_EMAIL.fund_alias
        where isvalid = 1
          and source_fund_name = #{fundName}
          and source_register_number = #{registerNumber}
    </select>

    <select id="queryFundByName" resultType="java.lang.String">
        select target_fund_id
        from PPW_EMAIL.fund_alias
        where isvalid = 1
          and source_fund_name = #{fundName}
    </select>

    <select id="queryFundByRegisterNumber" resultType="java.lang.String">
        select target_fund_id
        from PPW_EMAIL.fund_alias
        where isvalid = 1
          and source_register_number = #{registerNumber}
    </select>

</mapper>