albertshaw 8 年之前
父节点
当前提交
902c4dd5e6

+ 4 - 4
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -682,7 +682,7 @@
   	where a.deleted_sign = 0 and a.owner_type = 0
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
-  		and  a.owner_id is null
+  		and  (a.owner_id is null or a.owner_id = '')
   	</if>
   	<if test="username != null">
   		and  ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
@@ -733,7 +733,7 @@
   	where deleted_sign = 0 and owner_type = 0
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
-  		and  a.owner_id is null
+  		and  (a.owner_id is null or a.owner_id = '')
   	</if>
   	<if test="username != null">
   		and  ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
@@ -787,7 +787,7 @@
   	where a.deleted_sign = 0 and a.owner_type = 1
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
-  		and  a.owner_id is null
+  		and  (a.owner_id is null or a.owner_id = '')
   	</if>
   	<if test="unitName != null">
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
@@ -841,7 +841,7 @@
   	where a.deleted_sign = 0 and a.owner_type = 1
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
-  		and  a.owner_id is null
+  		and  (a.owner_id is null or a.owner_id = '')
   	</if>
   	<if test="unitName != null">
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')

+ 5 - 5
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -511,7 +511,7 @@
 	</if>
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
-		and  d.employer_id is null
+		and  (d.employer_id is null or d.employer_id='')
 	</if>
 	<if test="infoSources != null">
 		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
@@ -579,7 +579,7 @@
 	</if>
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
-		and  d.employer_id is null
+		and  (d.employer_id is null or d.employer_id='')
 	</if>
 	<if test="infoSources != null">
 		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
@@ -646,14 +646,14 @@
 		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="keyword != null">
-		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+		and  d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="unitName != null">
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
-		and  d.employer_id is null
+		and  (d.employer_id is null or d.employer_id='')
 	</if>
 	<if test="infoSources != null">
 		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
@@ -725,7 +725,7 @@
 	</if>
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
-		and  d.employer_id is null
+		and  (d.employer_id is null or d.employer_id='')
 	</if>
 	<if test="infoSources != null">
 		and  d.info_sources = #{infoSources,jdbcType=INTEGER}

+ 17 - 12
src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml

@@ -409,18 +409,23 @@
   </select>
 	
   <select id="selectCognizanceResearchCostBoByUidAndYear"  resultType="com.goafanti.cognizance.bo.CognizanceResearchCostBo">
-		select m.uid, sum(m.cost1) as researchCost, sum(m.territory) as territory from(
-			select uid, (internal_labor_cost + internal_direct_cost + internal_depreciation_cost + internal_amortization_cost 
-			+ internal_design_cost + internal_equipment_cost + internal_other_cost +external_total_cost) as cost1, 
-			external_abroad_cost as territory
-			 from org_activity_cost 
-    where  (start_date >= (select  str_to_date(CONCAT(#{0}-3,'-01-01'), '%Y-%m-%d %H'))
-      and start_date <![CDATA[ < ]]> (select  str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H'))) 
-			or (end_date <![CDATA[ < ]]> (select  str_to_date(CONCAT(#{0},'-01-01'), '%Y-%m-%d %H'))   and 
-      end_date >= (select  str_to_date(CONCAT(#{0}-3,'-01-01'), '%Y-%m-%d %H')))
-      and deleted_sign = 0
-		) m where m.uid = #{1} GROUP BY m.uid
-
+  	SELECT 
+	    m.uid,
+	    SUM(m.cost1) AS researchCost,
+	    SUM(m.territory) AS territory
+	FROM
+	    (SELECT 
+	        uid,
+	            (internal_labor_cost + internal_direct_cost + internal_depreciation_cost + internal_amortization_cost + internal_design_cost + internal_equipment_cost + internal_other_cost + external_total_cost) AS cost1,
+	            external_abroad_cost AS territory
+	    FROM
+	        org_activity_cost
+	    WHERE
+	        year <![CDATA[ >= ]]> #{0}-3 and year <![CDATA[ < ]]> #{0}
+	            AND deleted_sign = 0) m
+	WHERE
+	    m.uid =  #{1}
+	GROUP BY m.uid
   </select>
 	
   <select id="selectCognizanceManageCostBoByUidAndYear"  resultType="com.goafanti.cognizance.bo.CognizanceManageCostBo">