|
@@ -92,7 +92,7 @@
|
|
|
info.fund_name as target_fund_name,
|
|
|
info.register_number as target_register_number,
|
|
|
c.company_name as company_name,
|
|
|
- a.last_price_date as last_price_date,
|
|
|
+ fnmi.last_price_date as last_price_date,
|
|
|
alias.isvalid,
|
|
|
alias.creatorid,
|
|
|
alias.createtime,
|
|
@@ -105,11 +105,8 @@
|
|
|
on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
left join PPW_EMAIL.pvn_company_info c
|
|
|
on c.company_id = info.trust_id and c.isvalid=1
|
|
|
- left join (select c.fund_name,c.register_number,max(c.price_date) as last_price_date from PPW_EMAIL.email_fund_nav c where c.isvalid=1
|
|
|
- group by c.fund_name,c.register_number) a
|
|
|
- on a.fund_name = alias.source_fund_name and a.register_number=alias.source_register_number
|
|
|
- left join fund_not_mapping_info fnmi
|
|
|
- on fnmi.fund_name = alias.source_fund_name and fnmi.register_number=alias.source_register_number and fnmi.isvalid=1
|
|
|
+ join fund_not_mapping_info fnmi
|
|
|
+ on fnmi.fund_alias_id=alias.id and fnmi.isvalid=1
|
|
|
where alias.isvalid=1
|
|
|
<if test="fundName != null and fundName !=''">
|
|
|
and (alias.source_fund_name like concat('%',#{fundName},'%') or alias.source_register_number like concat('%',#{fundName},'%') )
|
|
@@ -127,13 +124,18 @@
|
|
|
<when test="sort != null and sort=='priceDate' and order != null and order =='asc'">
|
|
|
order by
|
|
|
CASE
|
|
|
- WHEN a.last_price_date IS NULL THEN 1
|
|
|
+ WHEN fnmi.last_price_date IS NULL THEN 1
|
|
|
ELSE 0
|
|
|
END,
|
|
|
- a.last_price_date asc
|
|
|
+ fnmi.last_price_date asc
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- order by a.last_price_date desc
|
|
|
+ order by
|
|
|
+ CASE
|
|
|
+ WHEN fnmi.last_price_date IS NULL THEN 1
|
|
|
+ ELSE 0
|
|
|
+ END,
|
|
|
+ fnmi.last_price_date desc
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
limit #{offset},#{pageSize}
|
|
@@ -178,7 +180,7 @@
|
|
|
where alias.isvalid=1 and alias.id=#{id}
|
|
|
</select>
|
|
|
<select id="getNotMappingFundList" resultType="com.simuwang.base.pojo.dos.FundRegisterDO">
|
|
|
- select source_fund_name as "fundName",source_register_number as "registerNumber" from PPW_EMAIL.fund_alias where isvalid=1 group by source_fund_name,source_register_number
|
|
|
+ select id, source_fund_name as "fundName",source_register_number as "registerNumber" from PPW_EMAIL.fund_alias where isvalid=1
|
|
|
</select>
|
|
|
|
|
|
<insert id="batchInsert">
|