Browse Source

需求查询修复

Michael 8 years ago
parent
commit
743f4bac80

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

@@ -855,7 +855,7 @@
   	select 
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
   		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
-  		<!-- oi.unit_name as username,  -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
+  		a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
   		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
   	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		,1 as hot
@@ -868,10 +868,6 @@
 	</if>
   	from achievement a
   	LEFT JOIN admin ad on ad.id = a.tech_broker_id
-	<!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
-	<if test="adminId != null">
-		LEFT JOIN user u on a.owner_id = u.id
-	</if>
   	<if test="hot != null and hot == 1"> <!-- 在首页 -->
 		inner join marketing_management mm on a.id = mm.product_id
 	</if>
@@ -882,15 +878,9 @@
   	<if test="ownerType != null">
 		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
 	</if>
-  	<!-- <if test="techBrokerId != null">
-		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
-	</if> -->
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%') 	
   	</if>
-  	<!-- <if test="unitName != null">
-  		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-  	</if> -->
   	<if test="ownerId != null">
 		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
 	</if>
@@ -948,10 +938,6 @@
   		count(1)
   	from achievement a
   	LEFT JOIN admin ad on ad.id = a.tech_broker_id
-	<!-- LEFT JOIN organization_identity oi on a.owner_id = oi.uid -->
-	<if test="adminId != null">
-		LEFT JOIN user u on a.owner_id = u.id
-	</if>
   	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		inner join marketing_management mm on a.id = mm.product_id
 	</if>
@@ -962,15 +948,9 @@
   	<if test="ownerType != null">
 		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
 	</if>
-  	<!-- <if test="techBrokerId != null">
-		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
-	</if> -->
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
   	</if>
-  	<!-- <if test="unitName != null">
-  		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-  	</if> -->
   	<if test="ownerId != null">
 		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
 	</if>
@@ -1007,7 +987,6 @@
 	<if test="releaseStatus != null">
 	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
 	</if>
-	
 	<if test="hot != null and hot == 0"><!-- 不在首页 -->
 		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
 	</if>

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

@@ -728,11 +728,7 @@
 		,ifnull(mm.effective,0) as hot
 	 </if>
 	from  demand d 
-	<!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
 	LEFT JOIN admin a on a.id = d.tech_broker_id
-	<if test="adminId != null">
-		LEFT JOIN user u on d.employer_id = u.id
-	</if>
 	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		inner join marketing_management mm on d.id = mm.product_id
 	</if>
@@ -743,19 +739,6 @@
 	<if test="dataCategory != null">
 		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
 	</if>
-	<if test="adminId != null">
-		and (u.mid = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
-		)
-	</if>
-	<!-- <if test="province != null">
-		and  oi.licence_province = #{province,jdbcType=INTEGER}
-	</if> -->
 	<if test="serialNumber != null">
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
@@ -768,9 +751,6 @@
 	<if test="keyword != null">
 		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 or d.employer_id='')
@@ -826,9 +806,6 @@
 	from  demand d 
 	<!-- LEFT JOIN organization_identity oi on d.employer_id = oi.uid -->
 	LEFT JOIN admin a on a.id = d.tech_broker_id
-	<if test="adminId != null">
-		LEFT JOIN user u on d.employer_id = u.id
-	</if>
 	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		inner join marketing_management mm on d.id = mm.product_id
 	</if>
@@ -839,34 +816,18 @@
 	<if test="dataCategory != null">
 		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
 	</if>
-	<if test="adminId != null">
-		and (u.mid = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  d.principal_id = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
-		)
-	</if>
 	<if test="serialNumber != null">
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	<if test="auditStatus != null">
 		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
-	<!-- <if test="province != null">
-		and  oi.licence_province = #{province,jdbcType=INTEGER}
-	</if> -->
 	<if test="name != null">
 		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
 	<if test="keyword != null">
 		and  d.keyword like "%"#{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 or d.employer_id='')

+ 2 - 2
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -197,9 +197,9 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			params.put("dataCategory", dataCategory);
 		}
 
-		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+		/*if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 			params.put("adminId", TokenManager.getAdminId());
-		}
+		}*/
 
 		if (StringUtils.isNotBlank(employerName)) {
 			params.put("employerName", employerName);