|
@@ -0,0 +1,100 @@
|
|
|
+<?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.daq.FileManageMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.FileManageDO">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="file_id" property="fileId"/>
|
|
|
+ <result column="file_path" property="filePath"/>
|
|
|
+ <result column="file_name" property="fileName"/>
|
|
|
+ <result column="fund_id" property="fundId"/>
|
|
|
+ <result column="fund_name" property="fundName"/>
|
|
|
+ <result column="register_number" property="registerNumber"/>
|
|
|
+ <result column="company_id" property="companyId"/>
|
|
|
+ <result column="company_name" property="companyName"/>
|
|
|
+ <result column="file_date" property="fileDate"/>
|
|
|
+ <result column="file_type" property="fileType"/>
|
|
|
+ <result column="source_type" property="sourceType"/>
|
|
|
+ <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"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="saveFileManage" parameterType="com.simuwang.base.pojo.dos.FileManageDO">
|
|
|
+ insert into file_manage(source_type,file_id,file_path,file_name,fund_id,fund_name,register_number,file_date,file_type,isvalid,creatorid,updaterid,createtime,updatetime)
|
|
|
+ values (#{sourceType},#{fileId},#{filePath},#{fileName},#{fundId},#{fundName},#{registerNumber},#{fileDate},#{fileType},#{isvalid},#{creatorId},#{updaterId},#{createTime},#{updateTime})
|
|
|
+ </insert>
|
|
|
+ <update id="updateFileManage" parameterType="com.simuwang.base.pojo.dos.FileManageDO">
|
|
|
+ update file_manage set
|
|
|
+ file_path=#{filePath},file_name=#{fileName},fund_id=#{fundId},fund_name=#{fundName},register_number=#{registerNumber},file_type=#{fileType},updatetime=#{updateTime},source_type=#{sourceType}
|
|
|
+ where isvalid=1 and file_id=#{fileId}
|
|
|
+ </update>
|
|
|
+ <select id="getFileInfoByFileId" resultMap="BaseResultMap"
|
|
|
+ parameterType="java.lang.Integer">
|
|
|
+ select id,file_id,file_path,file_name,fund_id,fund_name,register_number,file_date,file_type,source_type,isvalid,creatorid,updaterid,createtime,updatetime
|
|
|
+ from file_manage where isvalid=1 and file_id=#{fileId}
|
|
|
+ </select>
|
|
|
+ <select id="searchFileManage" resultMap="BaseResultMap"
|
|
|
+ parameterType="com.simuwang.base.pojo.dto.query.FileManagePageQuery">
|
|
|
+ select f.id,f.file_id,f.file_path,f.file_name,f.fund_id,f.fund_name,f.register_number,f.file_date,f.file_type,f.source_type,
|
|
|
+ f.isvalid,f.creatorid,f.updaterid,f.createtime,f.updatetime,c.company_id,c.company_name
|
|
|
+ from file_manage f
|
|
|
+ left join pvn_fund_info fi on fi.fund_id = f.fund_id and fi.isvalid=1
|
|
|
+ left join pvn_company_info c on fi.trust_id=c.company_id and c.isvalid=1
|
|
|
+ where f.isvalid=1
|
|
|
+ <if test="fundId != null and fundId != ''">
|
|
|
+ and f.fund_id like concat('%',#{fundId},'%')
|
|
|
+ </if>
|
|
|
+ <if test="fundName != null and fundName != ''">
|
|
|
+ and (f.fund_name like concat('%',#{fundName},'%') or f.register_number like concat('%',#{fundName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="companyName != null and companyName != ''">
|
|
|
+ and (c.company_name like concat('%',#{companyName},'%') or c.register_number like concat('%',#{companyName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="fileType != null and fileType != ''">
|
|
|
+ and f.file_type=#{fileType}
|
|
|
+ </if>
|
|
|
+ <if test="fileName != null and fileName != ''">
|
|
|
+ and f.file_name=#{fileName}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and f.file_date <![CDATA[ >= ]]> #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ and f.file_date <![CDATA[ <= ]]> #{endDate}
|
|
|
+ </if>
|
|
|
+ order by f.file_date desc
|
|
|
+ limit #{offset},#{pageSize}
|
|
|
+ </select>
|
|
|
+ <select id="countFileManage" resultType="java.lang.Long"
|
|
|
+ parameterType="com.simuwang.base.pojo.dto.query.FileManagePageQuery">
|
|
|
+ select count(f.id)
|
|
|
+ from file_manage f
|
|
|
+ left join pvn_fund_info fi on fi.fund_id = f.fund_id and fi.isvalid=1
|
|
|
+ left join pvn_company_info c on fi.trust_id=c.company_id and c.isvalid=1
|
|
|
+ where f.isvalid=1
|
|
|
+ <if test="fundId != null and fundId != ''">
|
|
|
+ and f.fund_id like concat('%',#{fundId},'%')
|
|
|
+ </if>
|
|
|
+ <if test="fundName != null and fundName != ''">
|
|
|
+ and (f.fund_name like concat('%',#{fundName},'%') or f.register_number like concat('%',#{fundName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="companyName != null and companyName != ''">
|
|
|
+ and (c.company_name like concat('%',#{companyName},'%') or c.register_number like concat('%',#{companyName},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="fileType != null and fileType != ''">
|
|
|
+ and f.file_type=#{fileType}
|
|
|
+ </if>
|
|
|
+ <if test="fileName != null and fileName != ''">
|
|
|
+ and f.file_name=#{fileName}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ and f.file_date <![CDATA[ >= ]]> #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ and f.file_date <![CDATA[ <= ]]> #{endDate}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|