123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.simuwang.base.mapper.EmailFundAssetMapper">
- <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailFundAssetDO">
- <id column="id" property="id"/>
- <result column="file_id" property="fileId"/>
- <result column="fund_id" property="fundId"/>
- <result column="fund_name" property="fundName"/>
- <result column="register_number" property="registerNumber"/>
- <result column="price_date" property="priceDate"/>
- <result column="asset_net" property="assetNet"/>
- <result column="asset_share" property="assetShare"/>
- <result column="is_stored" property="isStored"/>
- <result column="exception_status" property="exceptionStatus"/>
- <result column="isvalid" property="isvalid"/>
- <result column="creatorid" property="creatorId"/>
- <result column="createtime" property="createTime"/>
- <result column="updaterid" property="updaterId"/>
- <result column="updatetime" property="updateTime"/>
- <result column="email_title" property="emailTitle"/>
- <result column="email_id" property="emailId"/>
- <result column="target_fund_name" property="targetFundName"/>
- <result column="target_fund_id" property="targetFundId"/>
- </resultMap>
- <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundAssetDO">
- insert into PPW_EMAIL.email_fund_asset(file_id, fund_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,
- isvalid, creatorid, createtime, updaterid, updatetime)
- values
- <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
- (#{itemDo.fileId},#{itemDo.fundId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},#{itemDo.assetNet},#{itemDo.assetShare},#{itemDo.isStored},#{itemDo.exceptionStatus},
- #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
- </foreach>
- </insert>
- <update id="batchUpdate">
- <foreach collection="itemDoList" item="itemDo" index="index" open="" close="" separator=";">
- update PPW_EMAIL.email_fund_asset
- <set>
- fund_id = #{itemDo.fundId},
- exception_status = #{itemDo.exceptionStatus},
- updatetime=#{itemDo.updateTime},
- is_stored=#{itemDo.isStored}
- </set>
- where isvalid = 1
- and id = #{itemDo.id}
- </foreach>
- </update>
- <select id="searchAssetDetail" resultMap="BaseResultMap"
- parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
- select asset.id,
- asset.fund_id,
- asset.fund_name,
- info.fund_id as target_fund_id,
- info.fund_name as target_fund_name,
- asset.register_number,
- asset.price_date,
- asset.asset_net,
- asset.asset_share,
- asset.is_stored,
- asset.exception_status,
- asset.updatetime,
- parse.email_title,
- parse.id as email_id
- from PPW_EMAIL.email_fund_asset asset
- join PPW_EMAIL.email_file_info file
- on asset.file_id = file.id
- join PPW_EMAIL.email_parse_info parse
- on file.email_id = parse.id
- left join PPW_EMAIL.pvn_fund_info info
- on asset.fund_id=info.fund_id and info.isvalid=1
- where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
- <if test="fundName != null and fundName !=''">
- and (asset.fund_name like concat('%',#{fundName},'%') or asset.register_number like concat('%',#{fundName},'%') )
- </if>
- <if test="priceStartDate != null and priceStartDate !=''">
- and asset.price_date >= #{priceStartDate}
- </if>
- <if test="priceEndDate != null and priceEndDate !=''">
- and asset.price_date <![CDATA[ <= ]]> #{priceEndDate}
- </if>
- <if test="updateStartDate != null and updateStartDate !=''">
- and asset.updatetime <![CDATA[ >= ]]> #{updateStartDate}
- </if>
- <if test="updateEndDate != null and updateEndDate !=''">
- and asset.updatetime <![CDATA[ <= ]]> #{updateEndDate}
- </if>
- <if test="isStore != null">
- and asset.is_stored = #{isStore}
- </if>
- <if test="emailTitle != null and emailTitle != ''">
- and parse.email_title like concat('%',#{emailTitle},'%')
- </if>
- <if test="emailId != null and emailId !=''">
- and parse.id =#{emailId}
- </if>
- <if test="exceptionStatusList != null">
- and asset.exception_status in
- <foreach collection="exceptionStatusList" index="index" item="exceptionStatus" separator="," open="(" close=")">
- #{exceptionStatus}
- </foreach>
- </if>
- <choose>
- <when test="sort != null and sort=='priceDate' and order != null and order =='asc'">
- order by asset.price_date asc
- </when>
- <otherwise>
- order by asset.price_date desc
- </otherwise>
- </choose>
- limit #{offset},#{pageSize}
- </select>
- <select id="countAssetDetail" resultType="java.lang.Long"
- parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
- select count(asset.id) from
- PPW_EMAIL.email_fund_asset asset
- join PPW_EMAIL.email_file_info file
- on asset.file_id = file.id
- join PPW_EMAIL.email_parse_info parse
- on file.email_id = parse.id
- left join PPW_EMAIL.pvn_fund_info info
- on asset.fund_id=info.fund_id and info.isvalid=1
- where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
- <if test="fundName != null and fundName !=''">
- and (asset.fund_name like concat('%',#{fundName},'%') or asset.register_number like concat('%',#{fundName},'%') )
- </if>
- <if test="priceStartDate != null and priceStartDate !=''">
- and asset.price_date >= #{priceStartDate}
- </if>
- <if test="priceEndDate != null and priceEndDate !=''">
- and asset.price_date <![CDATA[ <= ]]> #{priceEndDate}
- </if>
- <if test="updateStartDate != null and updateStartDate !=''">
- and asset.updatetime <![CDATA[ >= ]]> #{updateStartDate}
- </if>
- <if test="updateEndDate != null and updateEndDate !=''">
- and asset.updatetime <![CDATA[ <= ]]> #{updateEndDate}
- </if>
- <if test="isStore != null">
- and asset.is_stored = #{isStore}
- </if>
- <if test="emailTitle != null and emailTitle != ''">
- and parse.email_title like concat('%',#{emailTitle},'%')
- </if>
- <if test="emailId != null and emailId !=''">
- and parse.id =#{emailId}
- </if>
- <if test="exceptionStatusList != null">
- and asset.exception_status in
- <foreach collection="exceptionStatusList" index="index" item="exceptionStatus" separator="," open="(" close=")">
- #{exceptionStatus}
- </foreach>
- </if>
- </select>
- <select id="countNoStoreAsset" resultType="java.lang.Integer" parameterType="java.lang.String">
- select count(id)
- from PPW_EMAIL.email_fund_asset
- where isvalid =1 and exception_status=3
- <if test="fundName != null and fundName !=''">
- and fund_name=#{fundName}
- </if>
- <if test="registerNumber != null and registerNumber !=''">
- and register_number=#{registerNumber}
- </if>
- <if test="fundName == null">
- and fund_name is null
- </if>
- <if test="registerNumber == null">
- and register_number is null
- </if>
- </select>
- <select id="selectNotMappingAsset" resultMap="BaseResultMap"
- parameterType="java.lang.String">
- select distinct id,fund_id,file_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,
- updatetime
- from PPW_EMAIL.email_fund_asset
- where isvalid =1 and exception_status=3
- <if test="fundName != null and fundName !=''">
- and fund_name=#{fundName}
- </if>
- <if test="registerNumber != null and registerNumber !=''">
- and register_number=#{registerNumber}
- </if>
- </select>
- <resultMap id="BaseDetailMap" type="com.simuwang.base.pojo.dos.EmailParseDetailDO">
- <result column="fund_id" property="fundId"/>
- <result column="fund_name" property="fundName"/>
- <result column="register_number" property="registerNumber"/>
- <result column="price_date" property="priceDate"/>
- <result column="nav" property="nav"/>
- <result column="cumulative_nav_withdrawal" property="cumulativeNavWithdrawal"/>
- <result column="asset_net" property="assetNet"/>
- <result column="asset_share" property="assetShare"/>
- <result column="nav_is_stored" property="navIsStored"/>
- <result column="nav_exception_status" property="navExceptionStatus"/>
- <result column="asset_is_stored" property="assetIsStored"/>
- <result column="asset_exception_status" property="assetExceptionStatus"/>
- <result column="updatetime" property="updateTime"/>
- </resultMap>
- <select id="selectFundAssetByFielId" resultMap="BaseDetailMap">
- SELECT DISTINCT
- asset.fund_id,
- asset.fund_name,
- asset.register_number,
- asset.price_date,
- null as nav,
- null as cumulative_nav_withdrawal,
- asset.asset_net as asset_net,
- asset.asset_share as asset_share,
- null AS nav_is_stored,
- null AS nav_exception_status,
- asset.is_stored as asset_is_stored,
- asset.exception_status as asset_exception_status,
- asset.updatetime
- FROM
- PPW_EMAIL.EMAIL_FILE_INFO efi
- JOIN PPW_EMAIL.email_fund_asset asset
- ON efi.id = asset.file_id
- AND asset.isvalid = 1
- WHERE efi.isvalid = 1
- AND efi.id = #{fileId} and asset.price_date=#{priceDate}
- </select>
- <select id="selectAssetByFundId" resultMap="BaseResultMap">
- select id,file_id, fund_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,
- isvalid, creatorid, createtime, updaterid, updatetime
- from PPW_EMAIL.email_fund_asset where isvalid=1 and fund_id=#{fundId}
- </select>
- <select id="countEmailAssetTotal" resultType="java.lang.Long">
- select count(1) from PPW_EMAIL.email_fund_asset where isvalid=1
- </select>
- <delete id="deleteByFileId">
- update PPW_EMAIL.email_fund_asset
- set isvalid = 0,
- updatetime= now()
- where isvalid = 1
- and file_id = #{fileId}
- </delete>
- </mapper>
|