|
@@ -1,18 +1,65 @@
|
|
|
<?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">
|
|
|
- <select id="find" resultType="cn.cslg.report.entity.CompareRecords">
|
|
|
- select * from COMPARE_RECORDS where PATENT_NO=#{patentNo} and PERSON_ID=#{personId} and REPORT_ID=#{reportId}
|
|
|
- </select>
|
|
|
+ <select id="find" resultType="cn.cslg.report.entity.CompareRecords">
|
|
|
+ select *
|
|
|
+ from COMPARE_RECORDS
|
|
|
+ where PATENT_NO = #{patentNo}
|
|
|
+ and PERSON_ID = #{personId}
|
|
|
+ and REPORT_ID = #{reportId}
|
|
|
+ </select>
|
|
|
|
|
|
-<select id="getCompareRecords" resultType="cn.cslg.report.entity.CompareRecords">
|
|
|
- select * from COMPARE_RECORDS where REPORT_ID=#{reportId}
|
|
|
-</select>
|
|
|
+ <select id="getCompareRecords" resultType="cn.cslg.report.entity.CompareRecords">
|
|
|
+ select *
|
|
|
+ from COMPARE_RECORDS
|
|
|
+ where REPORT_ID = #{reportId}
|
|
|
+ </select>
|
|
|
<select id="findCompareRecords" resultType="cn.cslg.report.entity.CompareRecords">
|
|
|
- select * from COMPARE_RECORDS where PERSON_ID=#{personId}
|
|
|
+ select *
|
|
|
+ from COMPARE_RECORDS
|
|
|
+ where PERSON_ID = #{personId}
|
|
|
</select>
|
|
|
<update id="updateCompareRecords">
|
|
|
- update COMPARE_RECORDS set FEATURES_ID=#{featuresId} where ID=#{id}
|
|
|
+ update COMPARE_RECORDS
|
|
|
+ set FEATURES_ID=#{featuresId}
|
|
|
+ where ID = #{id}
|
|
|
</update>
|
|
|
|
|
|
+
|
|
|
+ <select id="getCompareNos" resultType="java.lang.String">
|
|
|
+ select r.PATENT_NO from ASSO_RECORDS_FEATURES f left join COMPARE_RECORDS r on f.RECORDS_ID = r.ID
|
|
|
+ <where>
|
|
|
+ f.FEATURE_ID in
|
|
|
+ <foreach item="item" collection="featuresIds" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ group by r.PATENT_NO
|
|
|
+ <if test="current!=null and size!=null">
|
|
|
+ limit ${(current -1)*size},${current*size}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="getCompareNosCount" resultType="java.lang.Integer">
|
|
|
+ select count(*) from (select r.PATENT_NO from ASSO_RECORDS_FEATURES f left join COMPARE_RECORDS r on f.RECORDS_ID = r.ID
|
|
|
+ <where>
|
|
|
+ f.FEATURE_ID in
|
|
|
+ <foreach item="item" collection="featuresIds" index="index" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ group by r.PATENT_NO
|
|
|
+ </where>
|
|
|
+ ) T
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCompareRecordsByNo" resultType="cn.cslg.report.common.model.vo.CompareRecordDTO">
|
|
|
+ select r.*,t.CONTENT as featureContent from ASSO_RECORDS_FEATURES f left join COMPARE_RECORDS r on f.RECORDS_ID = r.ID
|
|
|
+ left join FEATURES t on f.FEATURE_ID = t.ID
|
|
|
+ <where>
|
|
|
+<!-- f.FEATURE_ID in-->
|
|
|
+<!-- <foreach item="item" collection="featuresIds" index="index" open="(" separator="," close=")">-->
|
|
|
+<!-- #{item}-->
|
|
|
+<!-- </foreach>-->
|
|
|
+ and r.PATENT_NO= #{patentNo}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|