|
@@ -52,17 +52,19 @@
|
|
|
c.credit_code as creditCode,
|
|
|
f.inception_date as inceptionDate,
|
|
|
n.last_price_date as lastPriceDate,
|
|
|
- fn.first_price_date as firstPriceDate,
|
|
|
+ n.first_price_date as firstPriceDate,
|
|
|
+ asset.last_asset_price_date as lastAssetPriceDate,
|
|
|
+ asset.first_asset_price_date as firstAssetPriceDate,
|
|
|
r.nav_frequency as navFrequency,
|
|
|
r.asset_Frequency as assetFrequency,
|
|
|
r.valuation_Frequency as valuationFrequency,
|
|
|
r.frequency_remark as frequencyRemark
|
|
|
from pvn_fund_info f
|
|
|
left join pvn_company_info c on f.trust_id = c.company_id and c.isvalid =1
|
|
|
- left join (select nv.fund_id,max(nv.price_date) as last_price_date from nav nv where nv.isvalid =1 group by nv.fund_id) n
|
|
|
- on f.fund_id = n .fund_id
|
|
|
- left join (select fnv.fund_id,min(fnv.price_date) as first_price_date from nav fnv where fnv.isvalid =1 group by fnv.fund_id) fn
|
|
|
- on f.fund_id = fn .fund_id
|
|
|
+ left join (select nv.fund_id,max(nv.price_date) as last_price_date,min(nv.price_date) as first_price_date from nav nv where nv.isvalid =1 group by nv.fund_id) n
|
|
|
+ on f.fund_id = n.fund_id
|
|
|
+ left join (select a.fund_id,max(a.price_date) as last_asset_price_date,min(a.price_date) as first_asset_price_date from asset a where a.isvalid =1 group by a.fund_id) asset
|
|
|
+ on f.fund_id = asset.fund_id
|
|
|
left join fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
|
|
|
where f.isvalid =1
|
|
|
<if test="fundId != null and fundId !=''">
|
|
@@ -74,15 +76,24 @@
|
|
|
<if test="companyShortName != null and companyShortName !=''">
|
|
|
and (c.company_name like concat('%',#{companyShortName},'%') or c.company_short_name like concat('%',#{companyShortName},'%') or c.register_number like concat('%',#{companyShortName},'%'))
|
|
|
</if>
|
|
|
- <if test="navFrequency != null and navFrequency !=''">
|
|
|
+ <if test="navFrequency != null and navFrequency !='' and navFrequency != 0">
|
|
|
and r.nav_frequency = #{navFrequency}
|
|
|
</if>
|
|
|
- <if test="assetFrequency != null and assetFrequency !=''">
|
|
|
+ <if test="navFrequency == 0">
|
|
|
+ and r.nav_frequency is null
|
|
|
+ </if>
|
|
|
+ <if test="assetFrequency != null and assetFrequency !='' and assetFrequency != 0">
|
|
|
and r.asset_Frequency = #{assetFrequency}
|
|
|
</if>
|
|
|
- <if test="valuationFrequency != null and valuationFrequency !=''">
|
|
|
+ <if test="assetFrequency == 0">
|
|
|
+ and r.asset_Frequency is null
|
|
|
+ </if>
|
|
|
+ <if test="valuationFrequency != null and valuationFrequency !='' and valuationFrequency != 0">
|
|
|
and r.valuation_Frequency = #{valuationFrequency}
|
|
|
</if>
|
|
|
+ <if test="valuationFrequency == 0">
|
|
|
+ and r.valuation_Frequency is null
|
|
|
+ </if>
|
|
|
<if test="startDate != null and startDate !=''">
|
|
|
and f.inception_date <![CDATA[ >= ]]> #{startDate}
|
|
|
</if>
|
|
@@ -153,10 +164,10 @@
|
|
|
select count(f.fund_id)
|
|
|
from pvn_fund_info f
|
|
|
left join pvn_company_info c on f.trust_id = c.company_id and c.isvalid =1
|
|
|
- left join (select nv.fund_id,max(nv.price_date) as last_price_date from nav nv where nv.isvalid =1 group by nv.fund_id) n
|
|
|
- on f.fund_id = n .fund_id
|
|
|
- left join (select fnv.fund_id,min(fnv.price_date) as first_price_date from nav fnv where fnv.isvalid =1 group by fnv.fund_id) fn
|
|
|
- on f.fund_id = fn .fund_id
|
|
|
+ left join (select nv.fund_id,max(nv.price_date) as last_price_date,min(nv.price_date) as first_price_date from nav nv where nv.isvalid =1 group by nv.fund_id) n
|
|
|
+ on f.fund_id = n.fund_id
|
|
|
+ left join (select a.fund_id,max(a.price_date) as last_asset_price_date,min(a.price_date) as first_asset_price_date from asset a where a.isvalid =1 group by a.fund_id) asset
|
|
|
+ on f.fund_id = asset.fund_id
|
|
|
left join fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
|
|
|
where f.isvalid =1
|
|
|
<if test="fundId != null and fundId !=''">
|
|
@@ -168,15 +179,24 @@
|
|
|
<if test="companyShortName != null and companyShortName !=''">
|
|
|
and (c.company_name like concat('%',#{companyShortName},'%') or c.company_short_name like concat('%',#{companyShortName},'%') or c.register_number like concat('%',#{companyShortName},'%'))
|
|
|
</if>
|
|
|
- <if test="navFrequency != null and navFrequency !=''">
|
|
|
+ <if test="navFrequency != null and navFrequency !='' and navFrequency != 0">
|
|
|
and r.nav_frequency = #{navFrequency}
|
|
|
</if>
|
|
|
- <if test="assetFrequency != null and assetFrequency !=''">
|
|
|
+ <if test="navFrequency == 0">
|
|
|
+ and r.nav_frequency is null
|
|
|
+ </if>
|
|
|
+ <if test="assetFrequency != null and assetFrequency !='' and assetFrequency != 0">
|
|
|
and r.asset_Frequency = #{assetFrequency}
|
|
|
</if>
|
|
|
- <if test="valuationFrequency != null and valuationFrequency !=''">
|
|
|
+ <if test="assetFrequency == 0">
|
|
|
+ and r.asset_Frequency is null
|
|
|
+ </if>
|
|
|
+ <if test="valuationFrequency != null and valuationFrequency !='' and valuationFrequency != 0">
|
|
|
and r.valuation_Frequency = #{valuationFrequency}
|
|
|
</if>
|
|
|
+ <if test="valuationFrequency == 0">
|
|
|
+ and r.valuation_Frequency is null
|
|
|
+ </if>
|
|
|
<if test="startDate != null and startDate !=''">
|
|
|
and f.inception_date <![CDATA[ >= ]]> #{startDate}
|
|
|
</if>
|