diff --git a/src/main/resources/mybatis/customize/FundInfoCustomMapper.xml b/src/main/resources/mybatis/customize/FundInfoCustomMapper.xml index b83fd84db294e9d91fb5db6d275a3afe0f40c356..48b94bf1be290d4e2c53fc20cb9ddad6a59a28e1 100644 --- a/src/main/resources/mybatis/customize/FundInfoCustomMapper.xml +++ b/src/main/resources/mybatis/customize/FundInfoCustomMapper.xml @@ -41,12 +41,11 @@ res.ishigh_or_low as ishighOrLow, res.tohigh_nav_ratio as tohighNavRatio from - (SELECT * FROM fund_nav WHERE fund_id in + (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> - order BY price_date desc) res - GROUP BY res.fund_id + </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">