|
@@ -15,7 +15,7 @@
|
|
|
<result column="updatetime" property="updateTime"/>
|
|
|
</resultMap>
|
|
|
<update id="saveFundAlias" parameterType="com.simuwang.base.pojo.dos.FundAliasDO">
|
|
|
- update PPW_EMAIL.fund_alias set target_fund_id=#{targetFundId},target_fund_name=#{targetFundName},target_register_number=#{targetRegisterNumber},updatetime=#{updateTime}
|
|
|
+ update PPW_EMAIL.fund_alias set target_fund_id=#{targetFundId},updatetime=#{updateTime}
|
|
|
where isvalid =1 and id=#{id}
|
|
|
</update>
|
|
|
<update id="batchDelete">
|
|
@@ -26,68 +26,107 @@
|
|
|
</update>
|
|
|
|
|
|
<select id="queryFundByNameAndRegisterNumber" resultMap="BaseResultMap">
|
|
|
- select target_fund_id, target_fund_name, target_register_number
|
|
|
- from PPW_EMAIL.fund_alias
|
|
|
- where isvalid = 1
|
|
|
- and source_fund_name = #{fundName}
|
|
|
- and source_register_number = #{registerNumber}
|
|
|
+ select alias.target_fund_id,
|
|
|
+ info.fund_name as target_fund_name,
|
|
|
+ info.register_number as target_register_number
|
|
|
+ from PPW_EMAIL.fund_alias alias
|
|
|
+ left join PPW_EMAIL.pvn_fund_info info
|
|
|
+ on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
+ where alias.isvalid = 1
|
|
|
+ and alias.source_fund_name = #{fundName}
|
|
|
+ and alias.source_register_number = #{registerNumber}
|
|
|
</select>
|
|
|
|
|
|
<select id="queryFundByName" resultMap="BaseResultMap">
|
|
|
- select target_fund_id, target_fund_name, target_register_number
|
|
|
- from PPW_EMAIL.fund_alias
|
|
|
- where isvalid = 1
|
|
|
- and source_fund_name = #{fundName}
|
|
|
+ select alias.target_fund_id,
|
|
|
+ info.fund_name as target_fund_name,
|
|
|
+ info.register_number as target_register_number
|
|
|
+ from PPW_EMAIL.fund_alias alias
|
|
|
+ left join PPW_EMAIL.pvn_fund_info info
|
|
|
+ on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
+ where alias.isvalid = 1
|
|
|
+ and alias.source_fund_name = #{fundName}
|
|
|
</select>
|
|
|
|
|
|
<select id="queryFundByRegisterNumber" resultMap="BaseResultMap">
|
|
|
- select target_fund_id, target_fund_name, target_register_number
|
|
|
- from PPW_EMAIL.fund_alias
|
|
|
- where isvalid = 1
|
|
|
- and source_register_number = #{registerNumber}
|
|
|
+ select alias.target_fund_id,
|
|
|
+ info.fund_name as target_fund_name,
|
|
|
+ info.register_number as target_register_number
|
|
|
+ from PPW_EMAIL.fund_alias alias
|
|
|
+ left join PPW_EMAIL.pvn_fund_info info
|
|
|
+ on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
+ where alias.isvalid = 1
|
|
|
+ and alias.source_register_number = #{registerNumber}
|
|
|
</select>
|
|
|
|
|
|
<select id="searchFundAlias" resultMap="BaseResultMap"
|
|
|
parameterType="com.simuwang.base.pojo.dto.query.FundAliasPageQuery">
|
|
|
- select id,source_fund_name,source_register_number,target_fund_id,target_fund_name,target_register_number,isvalid,
|
|
|
- creatorid,createtime,updatetime,updaterid
|
|
|
- from PPW_EMAIL.fund_alias where isvalid=1
|
|
|
+ select alias.id,
|
|
|
+ alias.source_fund_name,
|
|
|
+ alias.source_register_number,
|
|
|
+ alias.target_fund_id,
|
|
|
+ info.fund_name as target_fund_name,
|
|
|
+ info.register_number as target_register_number,
|
|
|
+ alias.isvalid,
|
|
|
+ alias.creatorid,
|
|
|
+ alias.createtime,
|
|
|
+ alias.updatetime,
|
|
|
+ alias.updaterid
|
|
|
+ from PPW_EMAIL.fund_alias alias
|
|
|
+ left join PPW_EMAIL.pvn_fund_info info
|
|
|
+ on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
+ where alias.isvalid=1
|
|
|
<if test="fundName != null and fundName !=''">
|
|
|
- and (source_fund_name like concat('%',#{fundName},'%') or source_register_number like concat('%',#{fundName},'%') )
|
|
|
+ and (alias.source_fund_name like concat('%',#{fundName},'%') or alias.source_register_number like concat('%',#{fundName},'%') )
|
|
|
</if>
|
|
|
<if test="fundAliasName != null and fundAliasName !=''">
|
|
|
- and (target_fund_name like concat('%',#{fundAliasName},'%') or target_register_number like concat('%',#{fundAliasName},'%') )
|
|
|
+ and (info.fund_name like concat('%',#{fundAliasName},'%') or info.fund_short_name like concat('%',#{fundAliasName},'%') or info.register_number like concat('%',#{fundAliasName},'%') )
|
|
|
</if>
|
|
|
<if test="isMapping != null and isMapping == 0">
|
|
|
- and target_fund_id is null
|
|
|
+ and alias.target_fund_id is null
|
|
|
</if>
|
|
|
<if test="isMapping != null and isMapping == 1">
|
|
|
- and target_fund_id is not null
|
|
|
+ and alias.target_fund_id is not null
|
|
|
</if>
|
|
|
- order by updatetime desc
|
|
|
+ order by alias.updatetime desc
|
|
|
limit #{offset},#{pageSize}
|
|
|
</select>
|
|
|
<select id="countFundAlias" resultType="java.lang.Long"
|
|
|
parameterType="com.simuwang.base.pojo.dto.query.FundAliasPageQuery">
|
|
|
- select count(1) from PPW_EMAIL.fund_alias where isvalid=1
|
|
|
+ select count(1) from PPW_EMAIL.fund_alias alias
|
|
|
+ left join PPW_EMAIL.pvn_fund_info info
|
|
|
+ on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
+ where alias.isvalid=1
|
|
|
<if test="fundName != null and fundName !=''">
|
|
|
- and (source_fund_name like concat('%',#{fundName},'%') or source_register_number like concat('%',#{fundName},'%') )
|
|
|
+ and (alias.source_fund_name like concat('%',#{fundName},'%') or alias.source_register_number like concat('%',#{fundName},'%') )
|
|
|
</if>
|
|
|
<if test="fundAliasName != null and fundAliasName !=''">
|
|
|
- and (target_fund_name like concat('%',#{fundAliasName},'%') or target_register_number like concat('%',#{fundAliasName},'%') )
|
|
|
+ and (info.fund_name like concat('%',#{fundAliasName},'%') or info.fund_short_name like concat('%',#{fundAliasName},'%') or info.register_number like concat('%',#{fundAliasName},'%') )
|
|
|
</if>
|
|
|
<if test="isMapping != null and isMapping == 0">
|
|
|
- and target_fund_id is null
|
|
|
+ and alias.target_fund_id is null
|
|
|
</if>
|
|
|
<if test="isMapping != null and isMapping == 1">
|
|
|
- and target_fund_id is not null
|
|
|
+ and alias.target_fund_id is not null
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="searchFundAliasById" resultType="com.simuwang.base.pojo.dos.FundAliasDO"
|
|
|
parameterType="java.lang.Integer">
|
|
|
- select id,source_fund_name,source_register_number,target_fund_id,target_fund_name,target_register_number,isvalid,
|
|
|
- creatorid,createtime,updatetime,updaterid
|
|
|
- from PPW_EMAIL.fund_alias where isvalid=1 and id=#{id}
|
|
|
+ select alias.id,
|
|
|
+ alias.source_fund_name,
|
|
|
+ alias.source_register_number,
|
|
|
+ alias.target_fund_id,
|
|
|
+ info.fund_name as target_fund_name,
|
|
|
+ info.register_number as target_register_number,
|
|
|
+ alias.isvalid,
|
|
|
+ alias.creatorid,
|
|
|
+ alias.createtime,
|
|
|
+ alias.updatetime,
|
|
|
+ alias.updaterid
|
|
|
+ from PPW_EMAIL.fund_alias alias
|
|
|
+ left join PPW_EMAIL.pvn_fund_info info
|
|
|
+ on alias.target_fund_id = info.fund_id and info.isvalid=1
|
|
|
+ where alias.isvalid=1 and alias.id=#{id}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert">
|