Browse Source

科技需求组织、个人合并列表查询修正

Michael 8 years ago
parent
commit
4e977edfa2

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

@@ -713,8 +713,8 @@
   	select 
 	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, 
 	  d.name, d.keyword, d.info_sources as infoSources, 
-	  oi.unit_name as username, d.demand_type as demandType, d.validity_period as validityPeriod, 
-	  d.employer_name as employerName, oi.licence_province as province, d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
+	  <!-- oi.unit_name as username, --> d.demand_type as demandType, d.validity_period as validityPeriod, 
+	  d.employer_name as employerName, <!-- oi.licence_province as province, --> d.status, d.urgent_days as urgentDays,d.urgent_money as urgentMoney,
 	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,d.create_time as createTime,
 	  d.employer_id as employerId, d.audit_status as auditStatus,
 	  d.tech_broker_id as techBrokerId,d.boutique
@@ -728,7 +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 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
@@ -739,7 +739,10 @@
 	<if test="hot == null"> <!-- 无首页参数 -->
 		left join marketing_management mm on d.id = mm.product_id 
 	</if>
-	where d.deleted_sign = 0 and d.data_category = 1 
+	where d.deleted_sign = 0 
+	<if test="dataCategory != null">
+		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
+	</if>
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
@@ -750,9 +753,9 @@
 		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 		)
 	</if>
-	<if test="province != null">
+	<!-- <if test="province != null">
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
-	</if>
+	</if> -->
 	<if test="serialNumber != null">
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
@@ -765,9 +768,9 @@
 	<if test="keyword != null">
 		and  d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
 	</if>
-	<if test="unitName != null">
+	<!-- <if test="unitName != null">
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-	</if>
+	</if> -->
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
 		and  (d.employer_id is null or d.employer_id='')
@@ -821,7 +824,7 @@
   	select 
 	count(1)
 	from  demand d 
-	LEFT JOIN organization_identity oi on d.employer_id = oi.uid
+	<!-- 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
@@ -832,7 +835,10 @@
 	<if test="hot == null"> <!-- 无首页参数 -->
 		left join marketing_management mm on d.id = mm.product_id 
 	</if>
-	where d.deleted_sign = 0 and d.data_category = 1
+	where d.deleted_sign = 0 
+	<if test="dataCategory != null">
+		and d.data_category = #{dataCategory,jdbcType=VARCHAR}
+	</if>
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
@@ -849,18 +855,18 @@
 	<if test="auditStatus != null">
 		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
-	<if test="province != null">
+	<!-- <if test="province != null">
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
-	</if>
+	</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">
+	<!-- <if test="unitName != null">
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-	</if>
+	</if> -->
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
 		and  (d.employer_id is null or d.employer_id='')
@@ -950,7 +956,7 @@
   	left join organization_identity oi on oi.uid = d.employer_id
   	left join user u on u.id = d.employer_id
   	left join marketing_management mm on d.id = mm.product_id
-  	where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
+  	where <!-- d.data_category = 1 and --> d.id = #{id,jdbcType=VARCHAR}
   </select>
   
   <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">

+ 2 - 2
src/main/java/com/goafanti/demand/controller/AdminDemandApiController.java

@@ -217,7 +217,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	 * 组织用户--需求列表
 	 */
 	@RequestMapping(value = "/orgList", method = RequestMethod.GET)
-	public Result orgList(String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
+	public Result orgList(Integer dataCategory,String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
 			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
 			String unitName, Integer status, Integer releaseStatus, String releaseDateStartDate,
 			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, String pageNo, String pageSize,Integer boutique,Integer hot) {
@@ -231,7 +231,7 @@ public class AdminDemandApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(demandService.selectOrgDemandManageList(employerName, auditStatus, province, serialNumber, name, keyword,
+		res.setData(demandService.selectOrgDemandManageList(dataCategory,employerName, auditStatus, province, serialNumber, name, keyword,
 				infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, unitName, status,
 				releaseStatus, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, pNo, pSize,boutique,hot,TokenManager.getAdminId()));
 		return res;

+ 1 - 1
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -26,7 +26,7 @@ public interface DemandService {
 			String validityPeriodStartDate, String validityPeriodEndDate, String username, Integer status,
 			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer pNo, Integer pSize,Integer boutique,Integer hot);
 
-	Pagination<DemandManageListBo> selectOrgDemandManageList(String employerName, Integer auditStatus, Integer province, Integer serialNumber,
+	Pagination<DemandManageListBo> selectOrgDemandManageList(Integer dataCategory,String employerName, Integer auditStatus, Integer province, Integer serialNumber,
 			String name, String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
 			String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer pNo, Integer pSize,Integer boutique,Integer hot,String techBrokerId);

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

@@ -165,7 +165,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<DemandManageListBo> selectOrgDemandManageList(String employerName, Integer auditStatus,
+	public Pagination<DemandManageListBo> selectOrgDemandManageList(Integer dataCategory,String employerName, Integer auditStatus,
 			Integer province, Integer serialNumber, String name, String keyword, Integer infoSources,
 			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
 			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer pNo,
@@ -193,6 +193,9 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
 			params.put("techBroker", TokenManager.getAdminId());
 		}*/
+		if (null != dataCategory) {
+			params.put("dataCategory", dataCategory);
+		}
 
 		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 			params.put("adminId", TokenManager.getAdminId());