|
@@ -0,0 +1,94 @@
|
|
|
+<?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="cn.cslg.report.mapper.CompareRecordsMapper">
|
|
|
+ <insert id="add">
|
|
|
+ insert into COMPARE_RECORDS (PATENT_NO,POSITION,CONTENT,FEATURES_ID,FEATURES,PERSON_ID,REPORT_ID) values(patentNo,position,content,featuresId,features,personId,reportId)
|
|
|
+ </insert>
|
|
|
+<delete id="deleCompareRecords">
|
|
|
+ delete from COMPARE_RECORDS where id=#{id}
|
|
|
+</delete>
|
|
|
+<update id="updateCompareRecords">
|
|
|
+ update COMPARE_RECORDS
|
|
|
+<set>
|
|
|
+ <if test="patentNo !='' and patentNo !=null">
|
|
|
+ PATENT_NO=#{PATENT_NO}
|
|
|
+ </if>
|
|
|
+ <if test="position !='' and position !=null">
|
|
|
+ POSITION=#{position}
|
|
|
+ </if>
|
|
|
+ <if test="content !='' and content !=null">
|
|
|
+ CONTENT=#{content}
|
|
|
+ </if>
|
|
|
+ <if test="featuresId !='' and featuresId !=null">
|
|
|
+ FEATURES_ID=#{featuresId}
|
|
|
+ </if>
|
|
|
+ <if test="features !='' and features !=null">
|
|
|
+ FEATURES=#{features}
|
|
|
+ </if>
|
|
|
+ <if test="personId !='' and personId !=null">
|
|
|
+ PERSON_ID=#{PATENT_NO}
|
|
|
+ </if>
|
|
|
+ <if test="reportId !='' and reportId !=null">
|
|
|
+ REPORT_ID=#{reportId}
|
|
|
+ </if>
|
|
|
+</set>
|
|
|
+ where id=#{id}
|
|
|
+</update>
|
|
|
+ <select id="total" resultType="int">
|
|
|
+ select count(*) from COMPARE_RECORDS
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="patentNo !='' and patentNo !=null">
|
|
|
+ PATENT_NO like concat('%', #{patentNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="position !='' and position !=null">
|
|
|
+ and POSITION like concat('%', #{position}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="content !='' and content !=null">
|
|
|
+ and CONTENT like concat('%', #{content}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="featuresId !='' and featuresId !=null">
|
|
|
+ and FEATURES_ID like concat('%', #{featuresId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="features !='' and features !=null">
|
|
|
+ and FEATURES like concat('%', #{featuresId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="personId !='' and personId !=null">
|
|
|
+ and PERSON_ID like concat('%', #{personId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="reportId !='' and reportId !=null">
|
|
|
+ and REPORT_ID like concat('%', #{reportId}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="find" resultType="cn.cslg.report.entity.CompareRecords">
|
|
|
+ <bind name="n" value="(pageNO-1)pageSize"/>
|
|
|
+ select * from COMPARE_RECORDS
|
|
|
+ <where>
|
|
|
+ <if test="patentNo !='' and patentNo !=null">
|
|
|
+ PATENT_NO like concat('%', #{patentNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="position !='' and position !=null">
|
|
|
+ and POSITION like concat('%', #{position}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="content !='' and content !=null">
|
|
|
+ and CONTENT like concat('%', #{content}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="featuresId !='' and featuresId !=null">
|
|
|
+ and FEATURES_ID like concat('%', #{featuresId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="features !='' and features !=null">
|
|
|
+ and FEATURES like concat('%', #{featuresId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="personId !='' and personId !=null">
|
|
|
+ and PERSON_ID like concat('%', #{personId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="reportId !='' and reportId !=null">
|
|
|
+ and REPORT_ID like concat('%', #{reportId}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{n},#{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|