|
|
@@ -0,0 +1,199 @@
|
|
|
+<?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.goafanti.common.dao.UserArchivesMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.goafanti.common.model.UserArchives" id="UserArchivesMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="uid" column="uid" jdbcType="INTEGER"/>
|
|
|
+ <result property="patentCount" column="patent_count" jdbcType="INTEGER"/>
|
|
|
+ <result property="inventionPatentCount" column="invention_patent_count" jdbcType="INTEGER"/>
|
|
|
+ <result property="utilityModelCount" column="utility_model_count" jdbcType="INTEGER"/>
|
|
|
+ <result property="appearancePatentCount" column="appearance_patent_count" jdbcType="INTEGER"/>
|
|
|
+ <result property="softwareWorksCount" column="software_works_count" jdbcType="INTEGER"/>
|
|
|
+ <result property="other" column="other" jdbcType="INTEGER"/>
|
|
|
+ <result property="financialData" column="financial_data" jdbcType="VARCHAR"/>
|
|
|
+ <result property="earlyCommunication" column="early_communication" jdbcType="VARCHAR"/>
|
|
|
+ <result property="interviewIdeas" column="interview_ideas" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="UserArchivesMap">
|
|
|
+ select
|
|
|
+id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time
|
|
|
+ from user_archives
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findUserArchivesList" resultMap="UserArchivesMap">
|
|
|
+ select
|
|
|
+id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time
|
|
|
+ from user_archives
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="patentCount != null">
|
|
|
+ and patent_count = #{patentCount}
|
|
|
+ </if>
|
|
|
+ <if test="inventionPatentCount != null">
|
|
|
+ and invention_patent_count = #{inventionPatentCount}
|
|
|
+ </if>
|
|
|
+ <if test="utilityModelCount != null">
|
|
|
+ and utility_model_count = #{utilityModelCount}
|
|
|
+ </if>
|
|
|
+ <if test="appearancePatentCount != null">
|
|
|
+ and appearance_patent_count = #{appearancePatentCount}
|
|
|
+ </if>
|
|
|
+ <if test="softwareWorksCount != null">
|
|
|
+ and software_works_count = #{softwareWorksCount}
|
|
|
+ </if>
|
|
|
+ <if test="other != null">
|
|
|
+ and other = #{other}
|
|
|
+ </if>
|
|
|
+ <if test="financialData != null and financialData != ''">
|
|
|
+ and financial_data = #{financialData}
|
|
|
+ </if>
|
|
|
+ <if test="earlyCommunication != null and earlyCommunication != ''">
|
|
|
+ and early_communication = #{earlyCommunication}
|
|
|
+ </if>
|
|
|
+ <if test="interviewIdeas != null and interviewIdeas != ''">
|
|
|
+ and interview_ideas = #{interviewIdeas}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findUserArchivesCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from user_archives
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="patentCount != null">
|
|
|
+ and patent_count = #{patentCount}
|
|
|
+ </if>
|
|
|
+ <if test="inventionPatentCount != null">
|
|
|
+ and invention_patent_count = #{inventionPatentCount}
|
|
|
+ </if>
|
|
|
+ <if test="utilityModelCount != null">
|
|
|
+ and utility_model_count = #{utilityModelCount}
|
|
|
+ </if>
|
|
|
+ <if test="appearancePatentCount != null">
|
|
|
+ and appearance_patent_count = #{appearancePatentCount}
|
|
|
+ </if>
|
|
|
+ <if test="softwareWorksCount != null">
|
|
|
+ and software_works_count = #{softwareWorksCount}
|
|
|
+ </if>
|
|
|
+ <if test="other != null">
|
|
|
+ and other = #{other}
|
|
|
+ </if>
|
|
|
+ <if test="financialData != null and financialData != ''">
|
|
|
+ and financial_data = #{financialData}
|
|
|
+ </if>
|
|
|
+ <if test="earlyCommunication != null and earlyCommunication != ''">
|
|
|
+ and early_communication = #{earlyCommunication}
|
|
|
+ </if>
|
|
|
+ <if test="interviewIdeas != null and interviewIdeas != ''">
|
|
|
+ and interview_ideas = #{interviewIdeas}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time)
|
|
|
+ values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount}, #{softwareWorksCount}, #{other}, #{financialData}, #{earlyCommunication}, #{interviewIdeas}, #{createTime})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.other}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.other}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+uid = values(uid),
|
|
|
+patent_count = values(patent_count),
|
|
|
+invention_patent_count = values(invention_patent_count),
|
|
|
+utility_model_count = values(utility_model_count),
|
|
|
+appearance_patent_count = values(appearance_patent_count),
|
|
|
+software_works_count = values(software_works_count),
|
|
|
+other = values(other),
|
|
|
+financial_data = values(financial_data),
|
|
|
+early_communication = values(early_communication),
|
|
|
+interview_ideas = values(interview_ideas),
|
|
|
+create_time = values(create_time)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update user_archives
|
|
|
+ <set>
|
|
|
+ <if test="uid != null">
|
|
|
+ uid = #{uid},
|
|
|
+ </if>
|
|
|
+ <if test="patentCount != null">
|
|
|
+ patent_count = #{patentCount},
|
|
|
+ </if>
|
|
|
+ <if test="inventionPatentCount != null">
|
|
|
+ invention_patent_count = #{inventionPatentCount},
|
|
|
+ </if>
|
|
|
+ <if test="utilityModelCount != null">
|
|
|
+ utility_model_count = #{utilityModelCount},
|
|
|
+ </if>
|
|
|
+ <if test="appearancePatentCount != null">
|
|
|
+ appearance_patent_count = #{appearancePatentCount},
|
|
|
+ </if>
|
|
|
+ <if test="softwareWorksCount != null">
|
|
|
+ software_works_count = #{softwareWorksCount},
|
|
|
+ </if>
|
|
|
+ <if test="other != null">
|
|
|
+ other = #{other},
|
|
|
+ </if>
|
|
|
+ <if test="financialData != null and financialData != ''">
|
|
|
+ financial_data = #{financialData},
|
|
|
+ </if>
|
|
|
+ <if test="earlyCommunication != null and earlyCommunication != ''">
|
|
|
+ early_communication = #{earlyCommunication},
|
|
|
+ </if>
|
|
|
+ <if test="interviewIdeas != null and interviewIdeas != ''">
|
|
|
+ interview_ideas = #{interviewIdeas},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from user_archives where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|