|
|
@@ -433,34 +433,91 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCognizanceCatagoryBoByUidAndYear" resultType="com.goafanti.cognizance.bo.CognizanceCatagoryBo">
|
|
|
- select u.id as uid, a.firstCatagory, b.secondCatagory, c.firmTotal, c.techTotal, d.totalRevenue FROM
|
|
|
- (select id from user where id = #{1}) u
|
|
|
+ select
|
|
|
+ u.id as uid,
|
|
|
+ a.firstCatagory, b.secondCatagory,
|
|
|
+ c.firmTotal,
|
|
|
+ c.techTotal,
|
|
|
+ d.totalRevenue FROM
|
|
|
+ (
|
|
|
+ select id from user where id = #{1}
|
|
|
+ ) u
|
|
|
LEFT JOIN
|
|
|
- (select uid, count(1) as firstCatagory from org_intellectual_property
|
|
|
- where uid = #{1} and evaluation_category= 0 and deleted_sign = 0 GROUP BY uid
|
|
|
+ (
|
|
|
+ select
|
|
|
+ uid,
|
|
|
+ count(1) as firstCatagory
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1}
|
|
|
+ and evaluation_category= 0
|
|
|
+ and deleted_sign = 0
|
|
|
+ and authorization_date >=
|
|
|
+ (
|
|
|
+ select
|
|
|
+ str_to_date(CONCAT(#{0}-2,'-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
|
|
|
+ GROUP BY uid
|
|
|
) a on a.uid = u.id
|
|
|
LEFT JOIN
|
|
|
(
|
|
|
- select uid, count(1) as secondCatagory from org_intellectual_property
|
|
|
- where uid = #{1} and evaluation_category = 1 and deleted_sign = 0 GROUP BY uid
|
|
|
+ select
|
|
|
+ uid,
|
|
|
+ count(1) as secondCatagory
|
|
|
+ from org_intellectual_property
|
|
|
+ where uid = #{1}
|
|
|
+ and evaluation_category = 1
|
|
|
+ and deleted_sign = 0
|
|
|
+ and authorization_date >=
|
|
|
+ (
|
|
|
+ select
|
|
|
+ str_to_date(CONCAT(#{0}-2,'-01-01'), '%Y-%m-%d %H')
|
|
|
+ )
|
|
|
+ and authorization_date <![CDATA[ < ]]>
|
|
|
+ (
|
|
|
+ select
|
|
|
+ str_to_date(CONCAT(#{0}+1,'-01-01'), '%Y-%m-%d %H')
|
|
|
+ )
|
|
|
+ GROUP BY uid
|
|
|
) b on b.uid = u.id
|
|
|
LEFT JOIN
|
|
|
(
|
|
|
- select uid, firm_total as firmTotal, tech_total as techTotal from org_human_resource where uid = #{1} and year =
|
|
|
- #{0}-1 and deleted_sign = 0
|
|
|
+ select
|
|
|
+ uid,
|
|
|
+ firm_total as firmTotal,
|
|
|
+ tech_total as techTotal
|
|
|
+ from org_human_resource
|
|
|
+ where
|
|
|
+ uid = #{1}
|
|
|
+ and year = #{0}-1
|
|
|
+ and deleted_sign = 0
|
|
|
) c on c.uid = u.id
|
|
|
LEFT JOIN
|
|
|
(
|
|
|
- SELECT uid,(operating_income + non_operating_income - non_taxable_income) as totalRevenue
|
|
|
- from org_ratepay where uid = #{1}
|
|
|
- and year = #{0}-1 and deleted_sign = 0
|
|
|
+ SELECT
|
|
|
+ uid,
|
|
|
+ (operating_income + non_operating_income - non_taxable_income) as totalRevenue
|
|
|
+ from org_ratepay
|
|
|
+ where
|
|
|
+ uid = #{1}
|
|
|
+ and year = #{0}-1
|
|
|
+ and deleted_sign = 0
|
|
|
) d on d.uid = u.id
|
|
|
</select>
|
|
|
|
|
|
<select id="selectLastYearRevenueByUidAndYear" resultType="java.math.BigDecimal">
|
|
|
- SELECT sum(last_year_revenue) as lastYearRevenue
|
|
|
- from org_tech_product where uid = #{1}
|
|
|
- and year = #{0} and deleted_sign = 0
|
|
|
+ SELECT
|
|
|
+ sum(last_year_revenue) as lastYearRevenue
|
|
|
+ from org_tech_product
|
|
|
+ where
|
|
|
+ uid = #{1}
|
|
|
+ and year = #{0}
|
|
|
+ and deleted_sign = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCognizanceByUidAndYear" resultMap="BaseResultMap" >
|
|
|
@@ -479,8 +536,15 @@
|
|
|
</update>
|
|
|
|
|
|
<select id="findCultivationListByPage" parameterType="java.lang.String" resultType="com.goafanti.cognizance.bo.CultivationListBo">
|
|
|
- select u.id as uid, i.licence_province as province, i.unit_name as unitName, i.cog_contacts as cogContacts,
|
|
|
- i.certificate_number as certificateNumber, i.issuing_date as issuingDate, a.name as consultant, i.tech_principal,
|
|
|
+ select
|
|
|
+ u.id as uid,
|
|
|
+ i.licence_province as province,
|
|
|
+ i.unit_name as unitName,
|
|
|
+ i.cog_contacts as cogContacts,
|
|
|
+ i.certificate_number as certificateNumber,
|
|
|
+ i.issuing_date as issuingDate,
|
|
|
+ a.name as consultant,
|
|
|
+ i.tech_principal,
|
|
|
CONCAT(i.first_contacts,' ', i.first_mobile) as firstContacts,
|
|
|
CONCAT(i.second_contacts,' ', i.second_mobile) as secondContacts,
|
|
|
CONCAT(i.third_contacts,' ', i.third_mobile) as thirdContacts
|