|
@@ -16,7 +16,7 @@
|
|
|
</resultMap>
|
|
|
<select id="searchNavAssetList" resultMap="BaseResultMap"
|
|
|
parameterType="com.simuwang.base.pojo.dto.query.FundNavAssetPageQuery">
|
|
|
- SELECT distinct
|
|
|
+ SELECT
|
|
|
info.fund_id,
|
|
|
info.fund_short_name,
|
|
|
info.register_number,
|
|
@@ -36,11 +36,21 @@
|
|
|
ON nav.fund_id = asset.fund_id
|
|
|
AND nav.price_date = asset.price_date
|
|
|
AND asset.isvalid = 1 and nav.channel_id = asset.channel_id
|
|
|
- left join channel_info c on c.id = nav.channel_id and c.isvalid=1
|
|
|
+ join channel_info c on c.id = nav.channel_id and c.isvalid=1
|
|
|
+ <if test="userId != null and userId !=''">
|
|
|
+ join user_channel_mapping ucm
|
|
|
+ on ucm.channel_id = c.id and ucm.isvalid=1
|
|
|
+ </if>
|
|
|
WHERE info.isvalid = 1
|
|
|
AND nav.isvalid = 1
|
|
|
+ <if test="userId != null and userId !=''">
|
|
|
+ and ucm.user_id =#{userId}
|
|
|
+ </if>
|
|
|
<if test="fundName != null and fundName !=''">
|
|
|
- and (info.fund_name like concat('%',#{fundName},'%') or info.fund_short_name like concat('%',#{fundName},'%') or info.register_number like concat('%',#{fundName},'%'))
|
|
|
+ and (info.fund_name like concat(#{fundName},'%') or info.fund_short_name like concat(#{fundName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="registerNumber != null and registerNumber !=''">
|
|
|
+ and (info.register_number like concat(#{registerNumber},'%'))
|
|
|
</if>
|
|
|
<if test="priceStartDate != null and priceStartDate !=''">
|
|
|
and (nav.price_date >= #{priceStartDate} or asset.price_date >= #{priceStartDate})
|
|
@@ -81,10 +91,21 @@
|
|
|
ON nav.fund_id = asset.fund_id
|
|
|
AND nav.price_date = asset.price_date
|
|
|
AND asset.isvalid = 1
|
|
|
+ join channel_info c on c.id = nav.channel_id and c.isvalid=1
|
|
|
+ <if test="userId != null and userId !=''">
|
|
|
+ join user_channel_mapping ucm
|
|
|
+ on ucm.channel_id = c.id and ucm.isvalid=1
|
|
|
+ </if>
|
|
|
WHERE info.isvalid = 1
|
|
|
AND nav.isvalid = 1
|
|
|
+ <if test="userId != null and userId !=''">
|
|
|
+ and ucm.user_id =#{userId}
|
|
|
+ </if>
|
|
|
<if test="fundName != null and fundName !=''">
|
|
|
- and (info.fund_name like concat('%',#{fundName},'%') or info.fund_short_name like concat('%',#{fundName},'%') or info.register_number like concat('%',#{fundName},'%'))
|
|
|
+ and (info.fund_name like concat(#{fundName},'%') or info.fund_short_name like concat(#{fundName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="registerNumber != null and registerNumber !=''">
|
|
|
+ and (info.register_number like concat(#{registerNumber},'%'))
|
|
|
</if>
|
|
|
<if test="priceStartDate != null and priceStartDate !=''">
|
|
|
and (nav.price_date >= #{priceStartDate} or asset.price_date >= #{priceStartDate})
|