Преглед на файлове

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

Michael преди 8 години
родител
ревизия
4e977edfa2

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

@@ -713,8 +713,8 @@
   	select 
   	select 
 	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, 
 	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, 
 	  d.name, d.keyword, d.info_sources as infoSources, 
 	  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.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.employer_id as employerId, d.audit_status as auditStatus,
 	  d.tech_broker_id as techBrokerId,d.boutique
 	  d.tech_broker_id as techBrokerId,d.boutique
@@ -728,7 +728,7 @@
 		,ifnull(mm.effective,0) as hot
 		,ifnull(mm.effective,0) as hot
 	 </if>
 	 </if>
 	from  demand d 
 	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
 	LEFT JOIN admin a on a.id = d.tech_broker_id
 	<if test="adminId != null">
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 		LEFT JOIN user u on d.employer_id = u.id
@@ -739,7 +739,10 @@
 	<if test="hot == null"> <!-- 无首页参数 -->
 	<if test="hot == null"> <!-- 无首页参数 -->
 		left join marketing_management mm on d.id = mm.product_id 
 		left join marketing_management mm on d.id = mm.product_id 
 	</if>
 	</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">
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
 	</if>
@@ -750,9 +753,9 @@
 		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 		or  d.tech_broker_id = #{adminId,jdbcType=VARCHAR}
 		)
 		)
 	</if>
 	</if>
-	<if test="province != null">
+	<!-- <if test="province != null">
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
-	</if>
+	</if> -->
 	<if test="serialNumber != null">
 	<if test="serialNumber != null">
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
 		and  d.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	</if>
@@ -765,9 +768,9 @@
 	<if test="keyword != null">
 	<if test="keyword != null">
 		and  d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
 		and  d.keyword like CONCAT('%',#{keyword,jdbcType=VARCHAR},'%')
 	</if>
 	</if>
-	<if test="unitName != null">
+	<!-- <if test="unitName != null">
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-	</if>
+	</if> -->
 	<if test="employerName != null">
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
 		and  (d.employer_id is null or d.employer_id='')
 		and  (d.employer_id is null or d.employer_id='')
@@ -821,7 +824,7 @@
   	select 
   	select 
 	count(1)
 	count(1)
 	from  demand d 
 	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
 	LEFT JOIN admin a on a.id = d.tech_broker_id
 	<if test="adminId != null">
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 		LEFT JOIN user u on d.employer_id = u.id
@@ -832,7 +835,10 @@
 	<if test="hot == null"> <!-- 无首页参数 -->
 	<if test="hot == null"> <!-- 无首页参数 -->
 		left join marketing_management mm on d.id = mm.product_id 
 		left join marketing_management mm on d.id = mm.product_id 
 	</if>
 	</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">
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
 	</if>
 	</if>
@@ -849,18 +855,18 @@
 	<if test="auditStatus != null">
 	<if test="auditStatus != null">
 		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
 		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
 	</if>
-	<if test="province != null">
+	<!-- <if test="province != null">
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
 		and  oi.licence_province = #{province,jdbcType=INTEGER}
-	</if>
+	</if> -->
 	<if test="name != null">
 	<if test="name != null">
 		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 	</if>
 	</if>
 	<if test="keyword != null">
 	<if test="keyword != null">
 		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 		and  d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 	</if>
 	</if>
-	<if test="unitName != null">
+	<!-- <if test="unitName != null">
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
 		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-	</if>
+	</if> -->
 	<if test="employerName != null">
 	<if test="employerName != null">
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
 		and  d.employer_name like CONCAT('%',#{employerName,jdbcType=VARCHAR},'%')
 		and  (d.employer_id is null or d.employer_id='')
 		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 organization_identity oi on oi.uid = d.employer_id
   	left join user u on u.id = d.employer_id
   	left join user u on u.id = d.employer_id
   	left join marketing_management mm on d.id = mm.product_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>
   </select>
   
   
   <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
   <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)
 	@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,
 			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
 			String unitName, Integer status, Integer releaseStatus, String releaseDateStartDate,
 			String unitName, Integer status, Integer releaseStatus, String releaseDateStartDate,
 			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, String pageNo, String pageSize,Integer boutique,Integer hot) {
 			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)) {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(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,
 				infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, unitName, status,
 				releaseStatus, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, pNo, pSize,boutique,hot,TokenManager.getAdminId()));
 				releaseStatus, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, pNo, pSize,boutique,hot,TokenManager.getAdminId()));
 		return res;
 		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,
 			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);
 			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 name, String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
 			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);
 			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")
 	@SuppressWarnings("unchecked")
 	@Override
 	@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 province, Integer serialNumber, String name, String keyword, Integer infoSources,
 			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
 			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
 			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer pNo,
 			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)) {
 		if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
 			params.put("techBroker", TokenManager.getAdminId());
 			params.put("techBroker", TokenManager.getAdminId());
 		}*/
 		}*/
+		if (null != dataCategory) {
+			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());
 			params.put("adminId", TokenManager.getAdminId());