|
|
@@ -209,100 +209,100 @@
|
|
|
|
|
|
<select id="selectAnnualReportPropertyRightBoByYearAndUid" resultType="com.goafanti.cognizance.bo.AnnualReportPropertyRightBo">
|
|
|
select u.id as uid, a.utilityPatent, b.exteriorPatent, c.softwareWorks, d.defensePatent, e.newPlantCariety, f.nationalCrop,
|
|
|
-g.nationalDrug, h.chineseMedicine, i.circuitDesign, j.inventionPatent from
|
|
|
-(
|
|
|
-select id from user where id = #{1}
|
|
|
-) u LEFT JOIN
|
|
|
-
|
|
|
-(
|
|
|
- select uid, count(1) as utilityPatent
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 2 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) a on a.uid = u.id
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
-select uid, count(1) as exteriorPatent
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 3 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) b on u.id = b.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
- select uid, count(1) as softwareWorks
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 4 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) c on u.id = c.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
-select uid, count(1) as defensePatent
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 5 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) d on u.id = d.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
- select uid, count(1) as newPlantCariety
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 6 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) e on u.id = e.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
-select uid, count(1) as nationalCrop
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 7 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) f on u.id = f.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
- select uid, count(1) as nationalDrug
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 8 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) g on u.id = g.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
-select uid, count(1) as chineseMedicine
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 9 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) h on u.id = h.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
- select uid, count(1) as circuitDesign
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 10 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) i on u.id = i.uid
|
|
|
-LEFT JOIN
|
|
|
-(
|
|
|
-select uid, count(1) as inventionPatent
|
|
|
- from org_intellectual_property
|
|
|
- where uid = #{1} and catagory = 11 and authorization_date
|
|
|
- >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
- and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
- and deleted_sign = 0
|
|
|
-) j on u.id = j.uid
|
|
|
+ g.nationalDrug, h.chineseMedicine, i.circuitDesign, j.inventionPatent from
|
|
|
+ (
|
|
|
+ select id from user where id = #{1}
|
|
|
+ ) u LEFT JOIN
|
|
|
+
|
|
|
+ (
|
|
|
+ select uid, count(1) as utilityPatent
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 2 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) a on a.uid = u.id
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as exteriorPatent
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 3 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) b on u.id = b.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as softwareWorks
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 4 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) c on u.id = c.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as defensePatent
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 5 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) d on u.id = d.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as newPlantCariety
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 6 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) e on u.id = e.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as nationalCrop
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 7 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) f on u.id = f.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as nationalDrug
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 8 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) g on u.id = g.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as chineseMedicine
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 9 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) h on u.id = h.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as circuitDesign
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 10 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) i on u.id = i.uid
|
|
|
+ LEFT JOIN
|
|
|
+ (
|
|
|
+ select uid, count(1) as inventionPatent
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1} and catagory = 11 and authorization_date
|
|
|
+ >= (select str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H') )
|
|
|
+ and authorization_date <![CDATA[ < ]]> (select str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H'))
|
|
|
+ and deleted_sign = 0
|
|
|
+ ) j on u.id = j.uid
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAnnualReportTerritoryByYearAndUid" resultType="java.math.BigDecimal">
|