1
0

FundAliasMapper.xml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.simuwang.base.mapper.FundAliasMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.FundAliasDO">
  5. <id column="id" property="id"/>
  6. <result column="source_fund_name" property="sourceFundName"/>
  7. <result column="source_register_number" property="sourceRegisterNumber"/>
  8. <result column="target_fund_id" property="targetFundId"/>
  9. <result column="target_fund_name" property="targetFundName"/>
  10. <result column="target_register_number" property="targetRegisterNumber"/>
  11. <result column="isvalid" property="isvalid"/>
  12. <result column="creatorid" property="creatorId"/>
  13. <result column="createtime" property="createTime"/>
  14. <result column="updaterid" property="updaterId"/>
  15. <result column="updatetime" property="updateTime"/>
  16. </resultMap>
  17. <update id="saveFundAlias" parameterType="com.simuwang.base.pojo.dos.FundAliasDO">
  18. update PPW_EMAIL.fund_alias set target_fund_id=#{targetFundId},target_fund_name=#{targetFundName},target_register_number=#{targetRegisterNumber},updatetime=#{updateTime}
  19. where isvalid =1 and id=#{id}
  20. </update>
  21. <update id="batchDelete">
  22. update PPW_EMAIL.fund_alias set isvalid=0,updatetime=sysdate() where isvalid =1 and id in
  23. <foreach collection="idList" index="index" item="id" separator="," open="(" close=")">
  24. #{id}
  25. </foreach>
  26. </update>
  27. <select id="queryFundByNameAndRegisterNumber" resultMap="BaseResultMap">
  28. select target_fund_id, target_fund_name, target_register_number
  29. from PPW_EMAIL.fund_alias
  30. where isvalid = 1
  31. and source_fund_name = #{fundName}
  32. and source_register_number = #{registerNumber}
  33. </select>
  34. <select id="queryFundByName" resultMap="BaseResultMap">
  35. select target_fund_id, target_fund_name, target_register_number
  36. from PPW_EMAIL.fund_alias
  37. where isvalid = 1
  38. and source_fund_name = #{fundName} and source_register_number is null
  39. </select>
  40. <select id="queryFundByRegisterNumber" resultMap="BaseResultMap">
  41. select target_fund_id, target_fund_name, target_register_number
  42. from PPW_EMAIL.fund_alias
  43. where isvalid = 1
  44. and source_register_number = #{registerNumber} and source_fund_name is null
  45. </select>
  46. <select id="searchFundAlias" resultMap="BaseResultMap"
  47. parameterType="com.simuwang.base.pojo.dto.query.FundAliasPageQuery">
  48. select id,source_fund_name,source_register_number,target_fund_id,target_fund_name,target_register_number,isvalid,
  49. creatorid,createtime,updatetime,updaterid
  50. from PPW_EMAIL.fund_alias where isvalid=1
  51. <if test="fundName != null and fundName !=''">
  52. and (source_fund_name like concat('%',#{fundName},'%') or source_register_number like concat('%',#{fundName},'%') )
  53. </if>
  54. <if test="fundAliasName != null and fundAliasName !=''">
  55. and (target_fund_name like concat('%',#{fundAliasName},'%') or target_register_number like concat('%',#{fundAliasName},'%') )
  56. </if>
  57. limit #{offset},#{pageSize}
  58. </select>
  59. <select id="countFundAlias" resultType="java.lang.Long"
  60. parameterType="com.simuwang.base.pojo.dto.query.FundAliasPageQuery">
  61. select count(1) from PPW_EMAIL.fund_alias where isvalid=1
  62. <if test="fundName != null and fundName !=''">
  63. and (source_fund_name like concat('%',#{fundName},'%') or source_register_number like concat('%',#{fundName},'%') )
  64. </if>
  65. <if test="fundAliasName != null and fundAliasName !=''">
  66. and (target_fund_name like concat('%',#{fundAliasName},'%') or target_register_number like concat('%',#{fundAliasName},'%') )
  67. </if>
  68. </select>
  69. <select id="searchFundAliasById" resultType="com.simuwang.base.pojo.dos.FundAliasDO"
  70. parameterType="java.lang.Integer">
  71. select id,source_fund_name,source_register_number,target_fund_id,target_fund_name,target_register_number,isvalid,
  72. creatorid,createtime,updatetime,updaterid
  73. from PPW_EMAIL.fund_alias where isvalid=1 and id=#{id}
  74. </select>
  75. <insert id="insert">
  76. insert into PPW_EMAIL.fund_alias(source_fund_name, source_register_number)
  77. values (#{fundName}, #{registerNumber})
  78. </insert>
  79. </mapper>