1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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 <= #{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>