Przeglądaj źródła

Accept Merge Request #279 更新生产 : (test -> prod)

Merge Request: 更新生产
Created By: @浅川
Accepted By: @浅川
URL: https://coding.net/t/aft/p/AFT/git/merge/279
浅川 8 lat temu
rodzic
commit
8769ee295c

+ 3 - 0
src/main/java/com/goafanti/achievement/bo/AchievementUserOwnerDetailBo.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import com.goafanti.common.utils.StringUtils;
+
 public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 	
 	private Integer province;
@@ -105,6 +107,7 @@ public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 	}
 
 	public String getCountInterest() {
+		if (StringUtils.isBlank(CountInterest)) CountInterest = "0";
 		return String.valueOf(Integer.valueOf(CountInterest)+20);
 	}
 

+ 57 - 5
src/main/java/com/goafanti/achievement/controller/AdminAchievementApiController.java

@@ -26,6 +26,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AchievementFields;
 import com.goafanti.common.enums.AchievementImportFields;
@@ -57,6 +58,8 @@ public class AdminAchievementApiController extends CertifyApiController {
     private AchievementOrderService	achievementOrderService;
     @Resource
     private MarketingManagementService marketingManagementService;
+    @Resource
+    private AdminMapper adminMapper;
     /**
      * 个人成果列表
      */
@@ -80,7 +83,7 @@ public class AdminAchievementApiController extends CertifyApiController {
         return res;
     }
     /**
-     * 组织用户成果列表
+     * 组织用户成果列表(个人组织合并)
      */
     @RequestMapping(value = "/orgList", method = RequestMethod.GET)
     private Result orgList(Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
@@ -142,16 +145,20 @@ public class AdminAchievementApiController extends CertifyApiController {
         return res;
     }
     /**
-     * 组织用户成果详情详情
+     * 组织用户成果详情详情(个人组织合并)
      */
     @RequestMapping(value = "/orgDetail", method = RequestMethod.GET)
-    private Result orgDetail(String id) {
+    private Result orgDetail(String id,int ownerType) {
         Result res = new Result();
         if (StringUtils.isBlank(id)) {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
             return res;
         }
-        res.setData(achievementService.selectOrgOwnerDetail(id));
+        if(ownerType==0){
+        	res.setData(achievementService.selectUserOwnerDetail(id));
+        }else if(ownerType==1){
+        	res.setData(achievementService.selectOrgOwnerDetail(id));
+        }       
         return res;
     }
     /**
@@ -511,7 +518,7 @@ public class AdminAchievementApiController extends CertifyApiController {
             return res;
         }
         if (null == ia.getOwnerType()) {
-            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人类型", "所有人类型"));
+            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人类型", "成果类别"));
             return res;
         }
         if (null == ia.getCooperationMode()) {
@@ -629,4 +636,49 @@ public class AdminAchievementApiController extends CertifyApiController {
         res.setData(data);
         return res;
     }
+    /**
+     * 我的成果列表
+     */
+    @RequestMapping(value = "/myList", method = RequestMethod.GET)
+    private Result myList(Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
+            String keyword, Integer category, Integer status, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate,
+            Integer releaseStatus,String internationalFlag, String pageNo, String pageSize,Integer boutique,Integer hot) {
+        Result res = new Result();
+        Integer pNo = 1;
+        Integer pSize = 10;
+        if (StringUtils.isNumeric(pageSize)) {
+            pSize = Integer.parseInt(pageSize);
+        }
+        if (StringUtils.isNumeric(pageNo)) {
+            pNo = Integer.parseInt(pageNo);
+        }
+        String techBrokerId=TokenManager.getAdminId();
+        Object o = achievementService.listMyAchievement(techBrokerId,ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name,
+                keyword, category, status, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus,internationalFlag, pNo, pSize,boutique,hot);
+        res.setData(o);     
+        return res;
+    }
+    
+    /**
+     * 科技成果管理列表
+     */
+    @RequestMapping(value = "/manageList", method = RequestMethod.GET)
+    private Result manageList(Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
+            String keyword, Integer category, Integer status, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate,
+            Integer releaseStatus,String internationalFlag, String pageNo, String pageSize,Integer boutique,Integer hot) {
+        Result res = new Result();
+        Integer pNo = 1;
+        Integer pSize = 10;
+        if (StringUtils.isNumeric(pageSize)) {
+            pSize = Integer.parseInt(pageSize);
+        }
+        if (StringUtils.isNumeric(pageNo)) {
+            pNo = Integer.parseInt(pageNo);
+        }
+        String techBrokerId=TokenManager.getAdminId();
+        Object o = achievementService.listManageAchievement(techBrokerId,ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name,
+                keyword, category, status, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus,internationalFlag, pNo, pSize,boutique,hot);
+        res.setData(o);     
+        return res;
+    }
 }

+ 7 - 1
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -93,7 +93,13 @@ public interface AchievementService {
 	Pagination<AchievementPartnerListBo> listAppMyAchievement(Integer pNo, Integer pSize);
 
 	AchievementUserOwnerDetailBo selectAppUserOwnerDetail(String id);
-
 	
+	Pagination<AchievementListBo> listMyAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber,
+			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
+			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus,String internationalFlag, Integer pNo, Integer pSize,Integer boutique,Integer hot);
+
+	Pagination<AchievementListBo> listManageAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber,
+			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
+			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus,String internationalFlag, Integer pNo, Integer pSize,Integer boutique,Integer hot);
 	
 }

+ 50 - 0
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -758,5 +758,55 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		return (Pagination<AchievementPartnerListBo>) findPage("findMyAchievementListByPage", "findMyAchievementCount",
 				params,pNo, pSize);
 	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementListBo> listMyAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId,
+			Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
+			String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, String internationalFlag,Integer pNo, Integer pSize,
+			Integer boutique, Integer hot) {
+		Map<String, Object> params = disposeParams(ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
+				boutique,internationalFlag, hot);
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+		
+		return (Pagination<AchievementListBo>) findPage("findMyyAchievementListByPage",
+				"findMyyAchievementCount",params,pNo, pSize);
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementListBo> listManageAchievement(String techBrokerId,Integer ownerType,String unitName, String ownerName, String ownerId,
+			Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
+			String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, String internationalFlag,Integer pNo, Integer pSize,
+			Integer boutique, Integer hot) {
+		Map<String, Object> params = disposeParams(ownerType,unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
+				boutique,internationalFlag, hot);
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+		
+		return (Pagination<AchievementListBo>) findPage("findManageAchievementListByPage",
+				"findManageAchievementCount",params,pNo, pSize);
+	}
 
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -89,5 +89,7 @@ public interface AdminMapper {
 	String selectUserNoById(String superiorId);
 	
 	int updateByUserNo(Admin record);
+	
+	List<String>selectIdBySuperiorId(String superiorId);
 
 }

+ 332 - 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>
@@ -1804,5 +1783,336 @@
   	</if>
   	</select>
   	
+  	<select id="findMyyAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
+  	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.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
+	</if>
+	<if test="hot != null and hot == 0"><!-- 无首页参数 -->
+		,0 as hot
+	</if>
+	<if test="hot==null"><!-- 在首页 -->
+		,ifnull(mm.effective,0) as hot
+	</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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
+  	where a.deleted_sign = 0 
+  	<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>
+  	<if test="serialNumber != null">
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  a.category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="releaseStatus != null">
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+	
+	<if test="boutique != null">
+		and a.boutique = #{boutique,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>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+	order by serial_number desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="findMyyAchievementCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
+  	where a.deleted_sign = 0 
+  	<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>
+  	<if test="serialNumber != null">
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  a.category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<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>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and  mm.effective = 1
+	</if>
+  </select>
+  	
+  	<select id="findManageAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
+  	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.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
+	</if>
+	<if test="hot != null and hot == 0"><!-- 无首页参数 -->
+		,0 as hot
+	</if>
+	<if test="hot==null"><!-- 在首页 -->
+		,ifnull(mm.effective,0) as hot
+	</if>
+  	from achievement a
+  	LEFT JOIN admin ad on ad.id = a.tech_broker_id
+  	LEFT JOIN department_management dm on dm.id = ad.department_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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
+  	where a.deleted_sign = 0 
+  	<if test="ownerType != null">
+		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
+	</if>
+  	<if test="techBrokerId != null">
+		and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where 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>
+  	<if test="serialNumber != null">
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  a.category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="releaseStatus != null">
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
+	</if>
+	
+	<if test="boutique != null">
+		and a.boutique = #{boutique,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>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+	order by serial_number desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="findManageAchievementCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from achievement a
+  	LEFT JOIN admin ad on ad.id = a.tech_broker_id
+  	LEFT JOIN department_management dm on dm.id = ad.department_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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
+  	where a.deleted_sign = 0 
+  	<if test="ownerType != null">
+		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
+	</if>
+  	<if test="techBrokerId != null">
+		and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where 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>
+  	<if test="serialNumber != null">
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
+	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<if test="keyword != null">
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+	</if>
+	<if test="category != null">
+		and  a.category = #{category,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	a.create_time <![CDATA[ >= ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and a.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<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>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and  mm.effective = 1
+	</if>
+  </select>
   	
 </mapper>

+ 7 - 1
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -565,5 +565,11 @@
 	set user_no = #{userNo,jdbcType=VARCHAR}
 	where
 	id=#{id,jdbcType=VARCHAR}  
-  </update>
+  </update>
+  <select id="selectIdBySuperiorId" parameterType="java.lang.String" resultType="java.lang.String">
+	select id
+	from admin
+	where
+	superior_id=#{superiorId,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 420 - 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='')
@@ -1704,4 +1665,424 @@
 	left join business_project  b on t.project_id=b.id
 	where  t.uid=#{uid,jdbcType=VARCHAR}
 	</select>
+	
+  <select id="findMyDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
+  	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,
+	  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
+	 <if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	 </if>
+	 <if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	 </if>
+	 <if test="hot==null"><!-- 无首页参数 -->
+		,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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+	</if>
+	<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>
+	<if test="auditStatus != null">
+		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<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='')
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  	order by d.serial_number desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id ="findMyDemandCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+	count(1)
+	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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+	</if>
+	<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='')
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=VARCHAR}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  </select>
+  
+  <select id="findManageDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
+  	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,
+	  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
+	 <if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	 </if>
+	 <if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	 </if>
+	 <if test="hot==null"><!-- 无首页参数 -->
+		,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
+	LEFT JOIN department_management dm on dm.id = a.department_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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
+	</if>
+	<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>
+	<if test="auditStatus != null">
+		and  d.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and  d.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>
+	<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='')
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  	order by d.serial_number desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id ="findManagegDemandCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+	count(1)
+	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
+	LEFT JOIN department_management dm on dm.id = a.department_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>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
+	where d.deleted_sign = 0 
+	<if test="techBrokerId != null">
+		and (d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or a.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
+	</if>
+	<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='')
+	</if>
+	<if test="infoSources != null">
+		and  d.info_sources = #{infoSources,jdbcType=INTEGER}
+	</if>
+	<if test="demandType != null">
+		and  d.demand_type = #{demandType,jdbcType=INTEGER}
+	</if>
+	<if test="status != null">
+		and  d.status = #{status,jdbcType=VARCHAR}
+	</if>
+	<if test="releaseStatus != null">
+		and  d.release_status = #{releaseStatus,jdbcType=VARCHAR}
+	</if>
+	<if test="vStart != null">
+	   and d.validity_period <![CDATA[ >= ]]> #{vStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="vEnd != null">
+	   and d.validity_period <![CDATA[ < ]]> #{vEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rStart != null">
+       and	d.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cStart != null">
+       and	d.create_time <![CDATA[ > ]]> #{cStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="cEnd != null">
+	   and d.create_time <![CDATA[ < ]]> #{cEnd,jdbcType=TIMESTAMP}
+	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
+  </select>
 </mapper>

+ 70 - 131
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -25,62 +25,46 @@
 			dg3.name as area,
 			c.name as industry,
 			d.name as adminName
-		from
-		(select
-			id,
-			aid,
-			type,
-			status,
-			create_time,
-			business_audit,
-			current_member_status,
-			identify_name,
-			lvl,
-			is_member,
-			society_tag,
-			share_type
-		from user
-		where type = 0  and status != 1
+		from user a inner join user_identity b on a.id = b.uid
+		left join district_glossory dg1 on b.province = dg1.id
+		left join district_glossory dg2 on b.city = dg2.id
+		left join district_glossory dg3 on b.area = dg3.id
+		left join industry_category c on b.industry = c.id
+		left join admin d on a.aid = d.id 		
+		where a.type = 0  and a.status != 1
 		<if test="aid != null and aid !=''">
-			and aid = #{aid,jdbcType=VARCHAR}
+			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
-			and identify_name like concat('%',#{name},'%')
+			and a.identify_name like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
-			and share_type = #{shareType,jdbcType=VARCHAR}
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
 		<if test="status != null">
-			and status = #{status,jdbcType=INTEGER}
+			and a.status = #{status,jdbcType=INTEGER}
 		</if>
 		<if test="businessAudit != null">
-			and business_audit = #{businessAudit,jdbcType=INTEGER}
+			and a.business_audit = #{businessAudit,jdbcType=INTEGER}
 		</if>
 		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+			and a.is_member = #{isMember,jdbcType=INTEGER}
 		</if>
 		<if test="lvl != null">
-			and lvl = #{lvl,jdbcType=INTEGER}
+			and a.lvl = #{lvl,jdbcType=INTEGER}
 		</if> 
 		<if test="currentMemberStatus != null">
-			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
 		<if test="societyTag != null and societyTag != ''">
-			and society_tag = #{societyTag,jdbcType=VARCHAR}
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
 		</if>
-		)as a inner join user_identity b on a.id = b.uid
-		left join district_glossory dg1 on b.province = dg1.id
-		left join district_glossory dg2 on b.city = dg2.id
-		left join district_glossory dg3 on b.area = dg3.id
-		left join industry_category c on b.industry = c.id
-		left join admin d on a.aid = d.id 
-		where 1=1
 		<if test="province != null">
 			and b.province = #{province,jdbcType=INTEGER}
 		</if>
@@ -111,48 +95,42 @@
    		 </if>
 	</select>
 	<select id="selectPersonalCustomerCount" resultType="java.lang.Integer">
-		select
-		count(0)
-		from
-		(select
-		id
-		from user
-		where type = 0  and status != 1
+		select count(0)
+			from user a inner join user_identity b on a.id = b.uid
+		where a.type = 0  and a.status != 1
 		<if test="aid != null and aid !=''">
-			and aid = #{aid,jdbcType=VARCHAR}
+			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
-			and identify_name like concat('%',#{name},'%')
+			and a.identify_name like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
-			and share_type = #{shareType,jdbcType=VARCHAR}
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
 		<if test="status != null">
-			and status = #{status,jdbcType=INTEGER}
+			and a.status = #{status,jdbcType=INTEGER}
 		</if>
 		<if test="businessAudit != null">
-			and business_audit = #{businessAudit,jdbcType=INTEGER}
+			and a.business_audit = #{businessAudit,jdbcType=INTEGER}
 		</if>
 		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+			and a.is_member = #{isMember,jdbcType=INTEGER}
 		</if>
 		<if test="lvl != null">
-			and lvl = #{lvl,jdbcType=INTEGER}
+			and a.lvl = #{lvl,jdbcType=INTEGER}
 		</if> 
 		<if test="currentMemberStatus != null">
-			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
 		<if test="societyTag != null and societyTag != ''">
-			and society_tag = #{societyTag,jdbcType=VARCHAR}
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
 		</if>
-		)as a inner join user_identity b on a.id = b.uid
-		where 1=1
 		<if test="province != null">
 			and b.province = #{province,jdbcType=INTEGER}
 		</if>
@@ -201,62 +179,47 @@
 			dg2.name as city, 
 			dg3.name as area,
 			c.name as industry,
-			d.name as adminName
-		from
-		(select
-			id,
-			aid,
-			type,
-			status,
-			create_time,
-			business_audit,
-			current_member_status,
-			identify_name,lvl,
-			is_member,
-			society_tag,
-			share_type
-		from user
-		where type = 1 and status != 1
+			d.name as adminName		
+		from user a inner join organization_identity b on a.id = b.uid
+		left join district_glossory dg1 on b.location_province = dg1.id
+		left join district_glossory dg2 on b.location_city = dg2.id
+		left join district_glossory dg3 on b.location_area = dg3.id
+		left join industry_category c on b.industry = c.id
+		left join admin d on a.aid = d.id 	
+		where a.type = 1 and a.status != 1
 		<if test="aid != null and aid !=''">
-			and aid = #{aid,jdbcType=VARCHAR}
+			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
-			and identify_name like concat('%',#{name},'%')
+			and a.identify_name like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
-			and share_type = #{shareType,jdbcType=VARCHAR}
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
 		<if test="status != null">
-			and status = #{status,jdbcType=INTEGER}
+			and a.status = #{status,jdbcType=INTEGER}
 		</if>
 		<if test="businessAudit != null">
-      		and business_audit = #{businessAudit,jdbcType=INTEGER}
+      		and a.business_audit = #{businessAudit,jdbcType=INTEGER}
    		</if>
 		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+			and a.is_member = #{isMember,jdbcType=INTEGER}
 		</if>
 		<if test="currentMemberStatus != null">
-			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
 		<if test="lvl != null">
-			and lvl = #{lvl,jdbcType=INTEGER}
+			and a.lvl = #{lvl,jdbcType=INTEGER}
 		</if> 
 		<if test="societyTag != null and societyTag != ''">
-			and society_tag = #{societyTag,jdbcType=VARCHAR}
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
 		</if>
-		)as a inner join organization_identity b on a.id = b.uid
-		left join district_glossory dg1 on b.location_province = dg1.id
-		left join district_glossory dg2 on b.location_city = dg2.id
-		left join district_glossory dg3 on b.location_area = dg3.id
-		left join industry_category c on b.industry = c.id
-		left join admin d on a.aid = d.id 
-		where 1=1
 		<if test="province != null">
 			and b.location_province = #{province,jdbcType=INTEGER}
 		</if>
@@ -287,45 +250,40 @@
    		 </if>
 	</select>
 	<select id="selectOrganizationCustomerCount" resultType="java.lang.Integer">
-		select
-		count(0)
-		from
-		(select
-		id
-		from user
-		where type = 1 and status != 1
+		select 
+			count(0)	
+		from user a inner join organization_identity b on a.id = b.uid
+		where a.type = 1 and a.status != 1
 		<if test="aid != null and aid !=''">
-			and aid = #{aid,jdbcType=VARCHAR}
+			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
-			and identify_name like concat('%',#{name},'%')
+			and a.identify_name like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
-			and share_type = #{shareType,jdbcType=VARCHAR}
+			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
 		<if test="status != null">
-			and status = #{status,jdbcType=INTEGER}
+			and a.status = #{status,jdbcType=INTEGER}
 		</if>
 		<if test="businessAudit != null">
-      		and business_audit = #{businessAudit,jdbcType=INTEGER}
+      		and a.business_audit = #{businessAudit,jdbcType=INTEGER}
    		</if>
 		<if test="currentMemberStatus != null">
-			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
+			and a.current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
 		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+			and a.is_member = #{isMember,jdbcType=INTEGER}
 		</if>
 		<if test="societyTag != null and societyTag != ''">
-			and society_tag = #{societyTag,jdbcType=VARCHAR}
+			and a.society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
-			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
 		</if>
 		<if test="endDate != null and endDate != ''">
-			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
+			and a.create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
 		</if>
-		)as a inner join organization_identity b on a.id = b.uid
-		where 1=1
 		<if test="province != null">
 			and b.location_province = #{province,jdbcType=INTEGER}
 		</if>
@@ -395,18 +353,9 @@
 			b.investment,
 			b.audit_status as auditStatus
 		from 
-		(select 
-			id,
-			identify_name,
-			society_tag,
-			company_logo_url,
-			introduction,
-			business_audit
-		from 
-			user
+			user a inner join organization_identity b on a.id = b.uid
 		where 
-			id = #{uid,jdbcType=VARCHAR}
-		)as a inner join organization_identity b on a.id = b.uid
+			a.id = #{uid,jdbcType=VARCHAR}
 	</select>
 	
 	<select id="findPersonalCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerPersonalDetailBo">
@@ -449,20 +398,10 @@
 			b.consultant,
 			b.consultation_price as consultationPrice
 		from
-			(
-				select
-					id,
-					identify_name,
-					society_tag,
-					head_portrait_url,
-					introduction,
-					business_audit
-				from
-					user
-				where
-					id = #{uid,jdbcType=VARCHAR}
-			) as a inner join user_identity b on
+			user a inner join user_identity b on
 			a.id = b.uid	
+		where
+			a.id = #{uid,jdbcType=VARCHAR}
 	</select>
 	
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">

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

@@ -214,7 +214,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 组织用户--需求列表
+	 * 组织用户--需求列表(个人组织合并)
 	 */
 	@RequestMapping(value = "/orgList", method = RequestMethod.GET)
 	public Result orgList(Integer dataCategory,String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
@@ -307,18 +307,23 @@ public class AdminDemandApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 组织用户详情
+	 * 组织用户详情(个人组织合并)
 	 */
 	@RequestMapping(value = "/orgDemandDetail", method = RequestMethod.GET)
-	public Result orgDemandDetail(String id) {
+	public Result orgDemandDetail(String id,int dataCategory) {
 		Result res = new Result();
 
 		if (StringUtils.isBlank(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
 			return res;
 		}
-
-		res.setData(demandService.selectOrgDemandDetail(id));
+		if(dataCategory==0){
+			res.setData(demandService.selectUserDemandDetail(id));
+			return res;
+		}else if(dataCategory==1){
+			res.setData(demandService.selectOrgDemandDetail(id));
+			return res;
+		}
 		return res;
 	}
 
@@ -551,13 +556,16 @@ public class AdminDemandApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (!DemandDataCategory.USERDEMAND.getCode().equals(demand.getDataCategory())
+		/*if (!DemandDataCategory.USERDEMAND.getCode().equals(demand.getDataCategory())
 				&& !DemandDataCategory.ORGDEMAND.getCode().equals(demand.getDataCategory())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "数据类型"));
 			return res;
+		}*/
+		if (null == demand.getDataCategory()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求类型", "需求类别"));
+			return res;
 		}
 
-
 		if (StringUtils.isBlank(demand.getKeyword())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;
@@ -652,5 +660,53 @@ public class AdminDemandApiController extends CertifyApiController {
 		res.setData(data);
 		return res;
 	}
+	
+	/**
+	 * 我的需求列表
+	 */
+	@RequestMapping(value = "/myList", method = RequestMethod.GET)
+	public Result myList(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) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(demandService.selectMyDemandManageList(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;
+	}
+	
+	/**
+	 * 我的需求列表
+	 */
+	@RequestMapping(value = "/manageList", method = RequestMethod.GET)
+	public Result manageList(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) {
+		Result res = new Result();
+		Integer pNo = 1;
+		Integer pSize = 10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		res.setData(demandService.selectManageDemandManageList(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;
+	}
 
 }

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

@@ -94,5 +94,13 @@ public interface DemandService {
 
 	Pagination<DemandSearchListBo> listMyDemand(Integer pNo, Integer pSize);
 
+	Pagination<DemandManageListBo> selectMyDemandManageList(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);
 	
+	Pagination<DemandManageListBo> selectManageDemandManageList(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);
 }

+ 82 - 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);
@@ -945,7 +945,87 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		return (Pagination<DemandSearchListBo>) findPage("findAppMyDemandListByPage", "findAppMyDemandCount", params, pNo, pSize);
 	}
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandManageListBo> selectMyDemandManageList(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) {
+		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
+				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, boutique, hot);
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		if (null != dataCategory) {
+			params.put("dataCategory", dataCategory);
+		}
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("adminId", TokenManager.getAdminId());
+		}
+
+		if (StringUtils.isNotBlank(employerName)) {
+			params.put("employerName", employerName);
+		}
+
+		if (StringUtils.isNotBlank(username)) {
+			params.put("unitName", username);
+		}
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+
+		return (Pagination<DemandManageListBo>) findPage("findMyDemandListByPage", "findMyDemandCount",
+				params, pNo, pSize);
+	}
 	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandManageListBo> selectManageDemandManageList(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) {
+		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
+				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
+				releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, boutique, hot);
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		if (null != dataCategory) {
+			params.put("dataCategory", dataCategory);
+		}
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("adminId", TokenManager.getAdminId());
+		}
+
+		if (StringUtils.isNotBlank(employerName)) {
+			params.put("employerName", employerName);
+		}
+
+		if (StringUtils.isNotBlank(username)) {
+			params.put("unitName", username);
+		}
+		if (null != techBrokerId) {
+			params.put("techBrokerId", techBrokerId);
+		}
+
+		return (Pagination<DemandManageListBo>) findPage("findManageDemandListByPage", "findManagegDemandCount",
+				params, pNo, pSize);
+	}
 		
 	
 }

Plik diff jest za duży
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/aboutUs.html