|
@@ -0,0 +1,301 @@
|
|
|
+<?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.zdqz.read.mapper.ReadDataMapper">
|
|
|
+
|
|
|
+ <resultMap type="ReadData" id="ReadDataResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="experimentId" column="experiment_id" />
|
|
|
+ <result property="assemblyAccession" column="assembly_accession" />
|
|
|
+ <result property="taxid" column="taxid" />
|
|
|
+ <result property="speciesTaxid" column="species_taxid" />
|
|
|
+ <result property="organismName" column="organism_name" />
|
|
|
+ <result property="organismNameStd" column="organism_name_std" />
|
|
|
+ <result property="dHits" column="D_Hits" />
|
|
|
+ <result property="rHits" column="R_Hits" />
|
|
|
+ <result property="finalHits" column="Final_Hits" />
|
|
|
+ <result property="nameCn" column="name_cn" />
|
|
|
+ <result property="defined" column="defined" />
|
|
|
+
|
|
|
+ <result property="bytFilterStatus" column="byt_filter_status" />
|
|
|
+ <result property="bytFilterTime" column="byt_filter_time" />
|
|
|
+ <result property="dljyFilterStatus" column="dljy_filter_status" />
|
|
|
+ <result property="dljyFilterTime" column="dljy_filter_time" />
|
|
|
+ <result property="nyjyFilterStatus" column="nyjy_filter_status" />
|
|
|
+ <result property="nyjyFilterTime" column="nyjy_filter_time" />
|
|
|
+ <result property="dtbnyjyFilterStatus" column="dtbnyjy_filter_status" />
|
|
|
+ <result property="dtbnyjyFilterTime" column="dtbnyjy_filter_time" />
|
|
|
+
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+
|
|
|
+ <association property="dataBase" javaType="DataBase" resultMap="DataBaseResult" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="DataBase" id="DataBaseResult">
|
|
|
+ <result property="assemblyAccession" column="b_assembly_accession" />
|
|
|
+ <result property="refseqCategory" column="b_refseq_category" />
|
|
|
+ <result property="taxid" column="b_taxid" />
|
|
|
+ <result property="speciesTaxid" column="b_species_taxid" />
|
|
|
+ <result property="organismName" column="b_organism_name" />
|
|
|
+ <result property="infraspecificName" column="b_infraspecific_name" />
|
|
|
+ <result property="isolate" column="b_isolate" />
|
|
|
+ <result property="assemblyLevel" column="b_assembly_level" />
|
|
|
+ <result property="genomeRep" column="b_genome_rep" />
|
|
|
+ <result property="seqRelDate" column="b_seq_rel_date" />
|
|
|
+ <result property="asmName" column="b_asm_name" />
|
|
|
+ <result property="gbrsPairedAsm" column="b_gbrs_paired_asm" />
|
|
|
+ <result property="pairedAsmComp" column="b_paired_asm_comp" />
|
|
|
+ <result property="ftpPath" column="b_ftp_path" />
|
|
|
+ <result property="excludedFromRefseq" column="b_excluded_from_refseq" />
|
|
|
+ <result property="assemblyType" column="b_assembly_type" />
|
|
|
+ <result property="group" column="b_group" />
|
|
|
+ <result property="genomeSize" column="b_genome_size" />
|
|
|
+ <result property="genomeSizeUngapped" column="b_genome_size_ungapped" />
|
|
|
+ <result property="gcPercent" column="b_gc_percent" />
|
|
|
+ <result property="repliconCount" column="b_replicon_count" />
|
|
|
+ <result property="scaffoldCount" column="b_scaffold_count" />
|
|
|
+ <result property="contigCount" column="b_contig_count" />
|
|
|
+ <result property="totalGeneCount" column="b_total_gene_count" />
|
|
|
+ <result property="proteinCodingGeneCount" column="b_protein_coding_gene_count" />
|
|
|
+ <result property="nonCodingGeneCount" column="b_non_coding_gene_count" />
|
|
|
+ <result property="nameCn" column="b_name_cn" />
|
|
|
+ <result property="defined" column="b_defined" />
|
|
|
+ <result property="seqSource" column="b_seq_source" />
|
|
|
+ <result property="express" column="b_express" />
|
|
|
+ <result property="filePath" column="b_file_path" />
|
|
|
+ <result property="dtpnyjy" column="b_dtpnyjy" />
|
|
|
+ <result property="dtpnyjyExpress" column="b_dtpnyjy_express" />
|
|
|
+ <result property="nyjy" column="b_nyjy" />
|
|
|
+ <result property="nyjyExpress" column="b_nyjy_express" />
|
|
|
+ <result property="dljy" column="b_dljy" />
|
|
|
+ <result property="dljyExpress" column="b_dljy_express" />
|
|
|
+ <result property="createBy" column="b_create_by" />
|
|
|
+ <result property="createTime" column="b_create_time" />
|
|
|
+ <result property="updateBy" column="b_update_by" />
|
|
|
+ <result property="updateTime" column="b_update_time" />
|
|
|
+ <result property="remark" column="b_remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertReadData" parameterType="ReadData" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into read_data
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="experimentId != null">experiment_id,</if>
|
|
|
+ <if test="assemblyAccession != null">assembly_accession,</if>
|
|
|
+ <if test="taxid != null">taxid,</if>
|
|
|
+ <if test="speciesTaxid != null">species_taxid,</if>
|
|
|
+ <if test="organismName != null">organism_name,</if>
|
|
|
+ <if test="organismNameStd != null">organism_name_std,</if>
|
|
|
+ <if test="dHits != null">D_Hits,</if>
|
|
|
+ <if test="rHits != null">R_Hits,</if>
|
|
|
+ <if test="finalHits != null">Final_Hits,</if>
|
|
|
+ <if test="nameCn != null">name_cn,</if>
|
|
|
+ <if test="defined != null">defined,</if>
|
|
|
+
|
|
|
+ <if test="bytFilterStatus != null">byt_filter_status,</if>
|
|
|
+ <if test="bytFilterTime != null">byt_filter_time,</if>
|
|
|
+ <if test="dljyFilterStatus != null">dljy_filter_status,</if>
|
|
|
+ <if test="dljyFilterTime != null">dljy_filter_time,</if>
|
|
|
+ <if test="nyjyFilterStatus != null">nyjy_filter_status,</if>
|
|
|
+ <if test="nyjyFilterTime != null">nyjy_filter_time,</if>
|
|
|
+ <if test="dtbnyjyFilterStatus != null">dtbnyjy_filter_status,</if>
|
|
|
+ <if test="dtbnyjyFilterTime != null">dtbnyjy_filter_time,</if>
|
|
|
+
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="experimentId != null">#{experimentId},</if>
|
|
|
+ <if test="assemblyAccession != null">#{assemblyAccession},</if>
|
|
|
+ <if test="taxid != null">#{taxid},</if>
|
|
|
+ <if test="speciesTaxid != null">#{speciesTaxid},</if>
|
|
|
+ <if test="organismName != null">#{organismName},</if>
|
|
|
+ <if test="organismNameStd != null">#{organismNameStd},</if>
|
|
|
+ <if test="dHits != null">#{dHits},</if>
|
|
|
+ <if test="rHits != null">#{rHits},</if>
|
|
|
+ <if test="finalHits != null">#{finalHits},</if>
|
|
|
+ <if test="nameCn != null">#{nameCn},</if>
|
|
|
+ <if test="defined != null">#{defined},</if>
|
|
|
+
|
|
|
+ <if test="bytFilterStatus != null">#{bytFilterStatus},</if>
|
|
|
+ <if test="bytFilterTime != null">#{bytFilterTime},</if>
|
|
|
+ <if test="dljyFilterStatus != null">#{dljyFilterStatus},</if>
|
|
|
+ <if test="dljyFilterTime != null">#{dljyFilterTime},</if>
|
|
|
+ <if test="nyjyFilterStatus != null">#{nyjyFilterStatus},</if>
|
|
|
+ <if test="nyjyFilterTime != null">#{nyjyFilterTime},</if>
|
|
|
+ <if test="dtbnyjyFilterStatus != null">#{dtbnyjyFilterStatus},</if>
|
|
|
+ <if test="dtbnyjyFilterTime != null">#{dtbnyjyFilterTime},</if>
|
|
|
+
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateReadData" parameterType="ReadData">
|
|
|
+ update read_data
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="experimentId != null">experiment_id = #{experimentId},</if>
|
|
|
+ <if test="assemblyAccession != null">assembly_accession = #{assemblyAccession},</if>
|
|
|
+ <if test="taxid != null">taxid = #{taxid},</if>
|
|
|
+ <if test="speciesTaxid != null">species_taxid = #{speciesTaxid},</if>
|
|
|
+ <if test="organismName != null">organism_name = #{organismName},</if>
|
|
|
+ <if test="organismNameStd != null">organism_name_std = #{organismNameStd},</if>
|
|
|
+ <if test="dHits != null">D_Hits = #{dHits},</if>
|
|
|
+ <if test="rHits != null">R_Hits = #{rHits},</if>
|
|
|
+ <if test="finalHits != null">Final_Hits = #{finalHits},</if>
|
|
|
+ <if test="nameCn != null">name_cn = #{nameCn},</if>
|
|
|
+ <if test="defined != null">defined = #{defined},</if>
|
|
|
+
|
|
|
+ <if test="bytFilterStatus != null">byt_filter_status = #{bytFilterStatus},</if>
|
|
|
+ <if test="bytFilterTime != null">byt_filter_time = #{bytFilterTime},</if>
|
|
|
+ <if test="dljyFilterStatus != null">dljy_filter_status = #{dljyFilterStatus},</if>
|
|
|
+ <if test="dljyFilterTime != null">dljy_filter_time = #{dljyFilterTime},</if>
|
|
|
+ <if test="nyjyFilterStatus != null">nyjy_filter_status = #{nyjyFilterStatus},</if>
|
|
|
+ <if test="nyjyFilterTime != null">nyjy_filter_time = #{nyjyFilterTime},</if>
|
|
|
+ <if test="dtbnyjyFilterStatus != null">dtbnyjy_filter_status = #{dtbnyjyFilterStatus},</if>
|
|
|
+ <if test="dtbnyjyFilterTime != null">dtbnyjy_filter_time = #{dtbnyjyFilterTime},</if>
|
|
|
+
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="setDeleteFlag" parameterType="Long">
|
|
|
+ update read_data set del_flag = 2 where experiment_id = #{experimentId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <sql id="selectReadData">
|
|
|
+ select a.*,
|
|
|
+ assembly_accession b_assembly_accession,
|
|
|
+ refseq_category b_refseq_category,
|
|
|
+ taxid b_taxid,
|
|
|
+ species_taxid b_species_taxid,
|
|
|
+ organism_name b_organism_name,
|
|
|
+ infraspecific_name b_infraspecific_name,
|
|
|
+ isolate b_isolate,
|
|
|
+ assembly_level b_assembly_level,
|
|
|
+ genome_rep b_genome_rep,
|
|
|
+ seq_rel_date b_seq_rel_date,
|
|
|
+ asm_name b_asm_name,
|
|
|
+ gbrs_paired_asm b_gbrs_paired_asm,
|
|
|
+ paired_asm_comp b_paired_asm_comp,
|
|
|
+ ftp_path b_ftp_path,
|
|
|
+ excluded_from_refseq b_excluded_from_refseq,
|
|
|
+ assembly_type b_assembly_type,
|
|
|
+ `group` b_group,
|
|
|
+ genome_size b_genome_size,
|
|
|
+ genome_size_ungapped b_genome_size_ungapped,
|
|
|
+ gc_percent b_gc_percent,
|
|
|
+ replicon_count b_replicon_count,
|
|
|
+ scaffold_count b_scaffold_count,
|
|
|
+ contig_count b_contig_count,
|
|
|
+ total_gene_count b_total_gene_count,
|
|
|
+ protein_coding_gene_count b_protein_coding_gene_count,
|
|
|
+ non_coding_gene_count b_non_coding_gene_count,
|
|
|
+ name_cn b_name_cn,
|
|
|
+ defined b_defined,
|
|
|
+ seq_source b_seq_source,
|
|
|
+ express b_express,
|
|
|
+ file_path b_file_path,
|
|
|
+ dtpnyjy b_dtpnyjy,
|
|
|
+ dtpnyjy_express b_dtpnyjy_express,
|
|
|
+ nyjy b_nyjy,
|
|
|
+ nyjy_express b_nyjy_express,
|
|
|
+ dljy b_dljy,
|
|
|
+ dljy_express b_dljy_express,
|
|
|
+ create_by b_create_by,
|
|
|
+ create_time b_create_time,
|
|
|
+ update_by b_update_by,
|
|
|
+ update_time b_update_time,
|
|
|
+ remark b_remark
|
|
|
+ from read_data a
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectBYTByExperiment" resultMap="ReadDataResult">
|
|
|
+ <include refid="selectReadData"/>
|
|
|
+ left join data_base b on a.assembly_accession = b.assembly_accession
|
|
|
+ where a.experiment_id = #{experimentId} and a.del_flag =1 and a.byt_filter_status = #{filterStatus}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDLJYByExperiment" resultMap="ReadDataResult">
|
|
|
+ <include refid="selectReadData"/>
|
|
|
+ ,data_base b
|
|
|
+ where a.assembly_accession = b.assembly_accession and a.experiment_id = #{experimentId} and a.del_flag =1 and a.dljy_filter_status = #{filterStatus} and (b.dljy != '' or b.dljy is not null)
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectNYJYByExperiment" resultMap="ReadDataResult">
|
|
|
+ <include refid="selectReadData"/>
|
|
|
+ ,data_base b
|
|
|
+ where a.assembly_accession = b.assembly_accession and a.experiment_id = #{experimentId} and a.del_flag =1 and a.nyjy_filter_status = #{filterStatus} and (b.nyjy != '' or b.nyjy is not null)
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDTBNYJYByExperiment" resultMap="ReadDataResult">
|
|
|
+ <include refid="selectReadData"/>
|
|
|
+ ,data_base b
|
|
|
+ where a.assembly_accession = b.assembly_accession and a.experiment_id = #{experimentId} and a.del_flag =1 and a.dtbnyjy_filter_status = #{filterStatus} and (b.dtpnyjy != '' or b.dtpnyjy is not null)
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="resetBYTFilter" parameterType="Long">
|
|
|
+ update read_data set byt_filter_status = 1,byt_filter_time = null where experiment_id = #{experimentId} and del_flag=1
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="setBYTFilter" parameterType="Long">
|
|
|
+ update read_data set byt_filter_status = 2,byt_filter_time = now() where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="resetDLJYFilter" parameterType="Long">
|
|
|
+ update read_data set dljy_filter_status = 1,dljy_filter_time = null where experiment_id = #{experimentId} and del_flag=1
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="setDLJYFilter" parameterType="Long">
|
|
|
+ update read_data set dljy_filter_status = 2,dljy_filter_time = now() where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="resetNYJYFilter" parameterType="Long">
|
|
|
+ update read_data set nyjy_filter_status = 1,nyjy_filter_time = null where experiment_id = #{experimentId} and del_flag=1
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="setNYJYFilter" parameterType="Long">
|
|
|
+ update read_data set nyjy_filter_status = 2,nyjy_filter_time = now() where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="resetDTBNYJYFilter" parameterType="Long">
|
|
|
+ update read_data set dtbnyjy_filter_status = 1,dtbnyjy_filter_time = null where experiment_id = #{experimentId} and del_flag=1
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="setDTBNYJYFilter" parameterType="Long">
|
|
|
+ update read_data set dtbnyjy_filter_status = 2,dtbnyjy_filter_time = now() where id in
|
|
|
+ <foreach collection="array" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|