FundInfoCustomMapper.xml 2.87 KB
<?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.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper">
    <select id="queryFundNavByCondition" resultType="string">

        select res.id from (select id from fund_info where nav_frequency &lt;= #{navFrequency} and delete_tag = 0 limit #{offset}, #{length}) res left join fund_status fs on
        res.id = fs.id where fs.fund_status in

        <foreach close=")" collection="fundStatus" item="listItem" open="(" separator=",">
            #{listItem}
        </foreach>

         and fs.delete_tag = 0

    </select>

    <select id="getFundInfoReport" resultType="java.util.HashMap">
        select t.id,count(t1.id) as count
         from fund_info t
         left join fund_file_record t1
         on t.id = t1.ref_id
         where t.id in(${ids}) and t1.type = 3 and t.delete_tag = 0 and t1.delete_tag = 0 group by t.id;
    </select>

    <select id="getFundInfoLastNet" parameterType="java.lang.String" resultType="com.tanpu.fund.entity.generator.FundNav">
        select price_date as priceDate, net_nav as nav from fund_count where fund_id in
        <foreach close=")" collection="list" item="fundId" open="(" separator=",">
            #{fundId}
        </foreach>
        AND delete_tag = 0
    </select>

    <select id="getFundInfoNewNet" parameterType="java.lang.String" resultType="com.tanpu.fund.entity.generator.FundNav">
        select
        res.id as id,
        res.fund_id as fundId,
        res.price_date as priceDate,
        res.nav as nav,
        res.cumulative_nav as cumulativeNav,
        res.cumulative_nav_withdrawal as cumulativeNavWithdrawal,
        res.ishigh_or_low as ishighOrLow,
        res.tohigh_nav_ratio as tohighNavRatio
        from
        (SELECT fund_id, max(price_date) as price_date FROM fund_nav WHERE fund_id in
        <foreach close=")" collection="list" item="fundId" open="(" separator=",">
            #{fundId}
        </foreach> GROUP by fund_id) t
        left join fund_nav res on t.fund_id = res.fund_id and t.price_date = res.price_date
    </select>

    <select id="getPrivateFundInfoNewNet" parameterType="java.lang.String" resultType="com.tanpu.fund.entity.generator.FundNav">
        select
        res.id as id,
        res.fund_id as fundId,
        res.price_date as priceDate,
        res.nav as nav,
        res.cumulative_nav as cumulativeNav,
        res.cumulative_nav as cumulativeNavWithdrawal
        from
        (SELECT fund_id, max(price_date) as price_date FROM ifa_imported_fund_nav WHERE fund_id in
        <foreach close=")" collection="list" item="fundId" open="(" separator=",">
            #{fundId}
        </foreach> GROUP by fund_id) t
        left join ifa_imported_fund_nav res on t.fund_id = res.fund_id and t.price_date = res.price_date
    </select>

</mapper>