| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <?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="VARCHAR"/>
- <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="otherCount" column="other_count" 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>
-
- <sql id="UserArchivesAllSql">
- id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time
- </sql>
- <!--查询单个-->
- <select id="queryById" resultMap="UserArchivesMap">
- select
- <include refid="UserArchivesAllSql"/>
- from user_archives
- where id = #{id}
- </select>
- <!--查询指定行数据-->
- <select id="findUserArchivesList" resultMap="UserArchivesMap">
- select
- <include refid="UserArchivesAllSql"/>
- from user_archives
- <where>
- <if test="id != null">
- and id = #{id}
- </if>
- <if test="uid != null and uid != ''">
- 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="otherCount != null">
- and other_count = #{otherCount}
- </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 != ''">
- 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="otherCount != null">
- and other_count = #{otherCount}
- </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_count, financial_data, early_communication, interview_ideas)
- values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount}, #{softwareWorksCount}, #{otherCount}, #{financialData}, #{earlyCommunication}, #{interviewIdeas})
- </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_count, 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.otherCount}, #{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_count, 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.otherCount}, #{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_count = values(other_count),
- 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 and uid != ''">
- 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="otherCount != null">
- other_count = #{otherCount},
- </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>
- <select id="queryByUid" resultMap="UserArchivesMap">
- select
- <include refid="UserArchivesAllSql"/>
- from user_archives
- where uid = #{id}
- </select>
- </mapper>
|