瀏覽代碼

清理代碼

wanghui 7 年之前
父節點
當前提交
4a8f11598b

+ 4 - 4
GeneratorConfig.xml

@@ -7,9 +7,9 @@
  	<property name="javaFileEncoding" value="UTF-8"/>
     <jdbcConnection connectionURL="jdbc:mysql://192.168.1.213:3306/aft" 
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="dev" />
-    <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao-server" />
-    <!-- <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" /> -->
-   <!--  <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" /> -->
-    <table schema="aft" tableName="achievement"/> 
+   <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao-server" />
+   <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" />
+   <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" />
+    <table schema="aft" tableName="user_interest"/> 
   </context>
 </generatorConfiguration>

+ 0 - 1
src/main/java/com/goafanti/common/dao/DemandFollowDetailMapper.java

@@ -74,5 +74,4 @@ public interface DemandFollowDetailMapper {
 	 */
 	int updateByPrimaryKey(DemandFollowDetail record);
 
-	List<DemandFollowDetail> selectDemandFollowDetail(String id);
 }

+ 1 - 11
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -9,7 +9,6 @@ import com.goafanti.demand.bo.DemandDetailBo;
 import com.goafanti.demand.bo.DemandListBo;
 import com.goafanti.demand.bo.DemandRecommended;
 import com.goafanti.portal.bo.DemandPortalDetailBo;
-import com.goafanti.portal.bo.DemandPortalSimilarListBo;
 import com.goafanti.portal.bo.DemandSearchDetailBo;
 
 public interface DemandMapper {
@@ -31,23 +30,14 @@ public interface DemandMapper {
 
 	DemandDetailBo selectOrgDemandDetail(String id);
 
-	int updateReleaseDate(String id);
-
 	void insertBatch(List<Demand> demandList);
 
-	DemandSearchDetailBo selectDemandSearchDetail(String uid, String id);
-
-	Integer findDemandNumByUid(String uid);
+	DemandSearchDetailBo selectDemandDetail(String uid, String id);
 
 	DemandPortalDetailBo findOrgPortalDemandDetail(@Param("id")String id, @Param("uid")String uid);
 
 	DemandPortalDetailBo findUserPortalDemandDetail(@Param("id")String id, @Param("uid")String uid);
 
-	List<DemandPortalSimilarListBo> findByIndustryCategoryA(@Param("industryCategoryA") Integer industryCategoryA,
-			@Param("id") String id);
-
-	int updateEmployerId(String id);
-
 	int countInterest(String demandId);
 	
 	DemandDetailBo selectDemandDetail(String id);

+ 61 - 9
src/main/java/com/goafanti/common/dao/UserInterestMapper.java

@@ -3,19 +3,74 @@ package com.goafanti.common.dao;
 import org.apache.ibatis.annotations.Param;
 
 import com.goafanti.common.model.UserInterest;
+import com.goafanti.common.model.UserInterestExample;
+import java.util.List;
 
 public interface UserInterestMapper {
-    int deleteByPrimaryKey(String id);
+    /**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	long countByExample(UserInterestExample example);
 
-    int insert(UserInterest record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int deleteByExample(UserInterestExample example);
 
-    int insertSelective(UserInterest record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
 
-    UserInterest selectByPrimaryKey(String id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int insert(UserInterest record);
 
-    int updateByPrimaryKeySelective(UserInterest record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int insertSelective(UserInterest record);
 
-    int updateByPrimaryKey(UserInterest record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	List<UserInterest> selectByExample(UserInterestExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	UserInterest selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") UserInterest record, @Param("example") UserInterestExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int updateByExample(@Param("record") UserInterest record, @Param("example") UserInterestExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	int updateByPrimaryKeySelective(UserInterest record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_interest
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
 
 	UserInterest findByFromUidAndToUid(@Param("fromUid")String fromUid, @Param("toUid")String toUid);
 
@@ -27,7 +82,4 @@ public interface UserInterestMapper {
 
 	int countInterest(String uid);
 
-	
-
-	
 }

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

@@ -643,11 +643,6 @@
 	</foreach>
   </update>
   
-  <update id="updateReleaseDate" parameterType="java.lang.String">
-  	update demand set release_date = null
-  	where id = #{id,jdbcType=VARCHAR}
-  </update>
-  
   <insert id="insertBatch" parameterType="com.goafanti.common.model.Demand">
     insert into demand 
     	(id, deleted_sign, audit_status, 
@@ -668,7 +663,7 @@
     </foreach>
   </insert>
   
-  <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo"> 
+  <select id="selectDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo"> 
   	select 
   		d.id, 
   		d.employer_name as employerName,
@@ -704,52 +699,6 @@
   	where d.id = #{1}
   </select>
   
-  <select id="findDemandNumByUid" parameterType="java.lang.String" resultType="java.lang.Integer">
-  	select 
-  		count(1)
-  	from demand
-  	where 
-  		deleted_sign = 0
-  	and release_status = 1
-  	and audit_status = 3
-  	and employer_id = #{uid,jdbcType=VARCHAR}
-  </select>
-  
-  <select id="findPartnerDemandListByPage" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandPartnerListBo">
-  	SELECT
-		id,
-		serial_number AS serialNumber,
-		data_category AS dataCategory,
-		NAME,
-		keyword,
-		release_date AS releaseDate,
-		demand_type AS demandType,
-		validity_period AS validityPeriod,
-		problem_des as problemDes,
-		industry_category_a as industryCategoryA,
-		industry_category_b as industryCategoryB,
-		budget_cost as budgetCost
-	FROM
-		demand
-	WHERE
-		audit_status = 3
-	AND release_status = 1
-	AND deleted_sign = 0
-	AND employer_id = #{employerId,jdbcType=VARCHAR}
-  </select>
-  
-  <select id="findPartnerDemandCount" parameterType="java.lang.String" resultType="java.lang.Integer">
-  	SELECT
-		count(1)
-	FROM
-		demand
-	WHERE
-		audit_status = 3
-	AND release_status = 1
-	AND deleted_sign = 0
-	AND employer_id = #{employerId,jdbcType=VARCHAR}
-  </select>
-  
   <select id="findUserPortalDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandPortalDetailBo">
   	SELECT
 		d.id,
@@ -813,38 +762,7 @@
 	WHERE
 		d.id = #{id,jdbcType=VARCHAR}
   </select>
-  
-  <select id="findByIndustryCategoryA"  resultType="com.goafanti.portal.bo.DemandPortalSimilarListBo">
-  	 select 
-	    d.id,
-	    d.name,
-	    fg.name as industryCategoryAS,
-	    fgg.name as industryCategoryBS,
-	    d.problem_des as problemDes,
-	    d.budget_cost as budgetCost,
-	    u.lvl as level
-    from 
-    	demand d
-    left join user u on u.id = d.employer_id
-    LEFT JOIN field_glossory fg on fg.id = d.industry_category_a
-	LEFT JOIN field_glossory fgg on fgg.id = d.industry_category_b
-    where 
-    	d.audit_status = 3
-    and d.release_status = 1
-    and d.deleted_sign = 0
-    and	d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
-    and d.id <![CDATA[ <> ]]> #{id,jdbcType=VARCHAR}
-    order by d.serial_number desc
-    limit 5
-  </select>
-  
-  <update id="updateEmployerId" parameterType="java.lang.String" >
-  	update demand set employer_id = null 
-  	where id = #{id,jdbcType=VARCHAR}
-  </update>
-   
-  <!-- 查询需求列表 -->
-	<select id="selectDemandListByPage" resultType="com.goafanti.demand.bo.DemandListBo">
+<select id="selectDemandListByPage" resultType="com.goafanti.demand.bo.DemandListBo">
 		select
 			a.id,
 			a.serial_number as serialNumber,
@@ -945,13 +863,12 @@
   </select>
   
   <select id="findAppMyDemandCount" parameterType="String" resultType="java.lang.Integer">
-  		select count(1)
+  	select count(1)
 	from  demand d 
 	where d.deleted_sign = 0 
 	<if test="employerId != null">
-	and d.employer_id = #{employerId, jdbcType=VARCHAR}
+		and d.employer_id = #{employerId, jdbcType=VARCHAR}
 	</if>
-	
   </select>
   
   <select id="selectDemandDetail" resultType="com.goafanti.demand.bo.DemandDetailBo" parameterType="java.lang.String" >
@@ -1105,27 +1022,7 @@
 		6
   </select>
   
-  <select id="selectDemandFollow" resultType="com.goafanti.common.model.Demand">
-  select d.id,d.employer_name as employerName,d.name,d.employer_contacts_mobile as employerContactsMobile,
-    d.employer_contacts_mailbox as employerContactsMailbox,d.create_time as createTime,a.name as techBrokerId
-    from demand d
-    left join admin a on a.id=d.tech_broker_id
-    where d.id=#{id,jdbcType=VARCHAR}
-  
-  </select>
-  <select id="selectRecentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
- select d.name,employer_name as employerName,d.id ,data_category as dataCategory,release_date as releaseDate,demand_type as demandType,budget_cost as budgetCost 
- ,fg.name as industryCategory1,fgg.name as industryCategory2
- from demand d 
-     left join aft.field_glossory  fg  on fg.id=d.industry_category_a
-    left join aft.field_glossory fgg  on fgg.id=d.industry_category_b
-  left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
-left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
- where audit_status=2 and info_sources=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id  and instr(dp.publish_page,#{2})>0
- order by  release_date  desc limit #{0}
-  </select>
-  
-    <select id="selectCompanyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
+   <select id="selectCompanyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
  select d.name,picture_url as pictureUrl,d.id ,data_category as dataCategory
  from demand d  
    left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
@@ -1204,7 +1101,9 @@ left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchI
 left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
 where d.boutique=1 and  dp.demand_id=d.id and dp.publish_platform=branchInfo.id and instr(dp.publish_page,#{2})>0
 order by release_date desc limit #{0}
-  </select>  <select id="listMyDemand" resultType="com.goafanti.portal.bo.DemandSearchListBo">
+  </select> 
+  
+  <select id="listMyDemand" resultType="com.goafanti.portal.bo.DemandSearchListBo">
 	select
 		id,
 		serial_number as serialNumber,

+ 392 - 169
src/main/java/com/goafanti/common/mapper/UserInterestMapper.xml

@@ -1,170 +1,393 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.goafanti.common.dao.UserInterestMapper" >
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserInterest" >
-    <id column="id" property="id" jdbcType="VARCHAR" />
-    <result column="from_uid" property="fromUid" jdbcType="VARCHAR" />
-    <result column="to_uid" property="toUid" jdbcType="VARCHAR" />
-    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-  </resultMap>
-  <sql id="Base_Column_List" >
-    id, from_uid, to_uid, create_time
-  </sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
-    select 
-    <include refid="Base_Column_List" />
-    from user_interest
-    where id = #{id,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
-    delete from user_interest
-    where id = #{id,jdbcType=VARCHAR}
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.UserInterest" >
-    insert into user_interest (id, from_uid, to_uid, 
-      create_time)
-    values (#{id,jdbcType=VARCHAR}, #{fromUid,jdbcType=VARCHAR}, #{toUid,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserInterest" >
-    insert into user_interest
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        id,
-      </if>
-      <if test="fromUid != null" >
-        from_uid,
-      </if>
-      <if test="toUid != null" >
-        to_uid,
-      </if>
-      <if test="createTime != null" >
-        create_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        #{id,jdbcType=VARCHAR},
-      </if>
-      <if test="fromUid != null" >
-        #{fromUid,jdbcType=VARCHAR},
-      </if>
-      <if test="toUid != null" >
-        #{toUid,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null" >
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserInterest" >
-    update user_interest
-    <set >
-      <if test="fromUid != null" >
-        from_uid = #{fromUid,jdbcType=VARCHAR},
-      </if>
-      <if test="toUid != null" >
-        to_uid = #{toUid,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null" >
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserInterest" >
-    update user_interest
-    set from_uid = #{fromUid,jdbcType=VARCHAR},
-      to_uid = #{toUid,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  
-  <select id="findByFromUidAndToUid" resultMap="BaseResultMap">
-   	select 
-    <include refid="Base_Column_List" />
-    from user_interest
-    where from_uid = #{fromUid,jdbcType=VARCHAR}
-    and to_uid =  #{toUid,jdbcType=VARCHAR}
-  </select>
-  
-  <select id="findInterestUserListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.InterestUserListBo">
-	SELECT
-			uii.username,
-			oi.unit_name AS unitName,
-			u.number,
-			u.type,
-			u.id AS uid,
-			ui.id AS interestId,
-			ui.create_time AS createTime,
-			uii.province AS userProvince,
-			oi.licence_province AS orgProvince,
-			u.head_portrait_url AS personPortraitUrl,
-			oinfo.logo_url AS logoUrl,
-			adc.achievement_count AS achievementNum,
-			adc.demand_count AS demandNum
-	FROM
-		user_interest ui
-	LEFT JOIN user_identity uii ON uii.uid = ui.to_uid
-	LEFT JOIN organization_identity oi ON oi.uid = ui.to_uid
-	LEFT JOIN `user` u ON u.id = ui.to_uid
-	<!-- LEFT JOIN user_info uinfo ON uinfo.uid = ui.to_uid -->
-	LEFT JOIN organization_info oinfo ON oinfo.uid = ui.to_uid
-	LEFT JOIN achievement_demand_count adc ON adc.uid = ui.to_uid
-	WHERE
-		ui.from_uid = #{fromUid,jdbcType=VARCHAR}
-		<if test="userType != null" >
-        and u.type = #{userType}
-      	</if>
-	ORDER BY
-		ui.create_time DESC
-	<if test="page_sql!=null">
-			${page_sql}
-	</if>
-  </select>
-  
-  <select id="findInterestUserCount" resultType="java.lang.Integer" parameterType="java.lang.String">
-  	SELECT
-	  count(1)
-    FROM
-	 user_interest ui
-	 LEFT JOIN `user` u ON u.id = ui.to_uid
-    WHERE
-	 ui.from_uid = #{fromUid,jdbcType=VARCHAR}
-	 <if test="userType != null" >
-       and u.type = #{userType}
-   	 </if>
-  </select>
-  
-  <select id="countByToUid" parameterType="java.lang.String" resultType="java.lang.Integer">
-  	select 
-  		count(1) 
-  	from user_interest 
-  	where to_uid = #{toUid,jdbcType=VARCHAR} 
-  </select>
-  
-  <delete id="deleteInterest" parameterType="java.lang.String" >
-    delete from user_interest
-    where from_uid = #{uid,jdbcType=VARCHAR}
-    and to_uid=#{objectId,jdbcType=VARCHAR}
-    </delete>
-    <select id="checkUidAndDid" resultType="Integer">
-  		select count(0) from user_interest where 1=1
-  	    <if test="id != null">
-  	       and from_uid = #{id,jdbcType=VARCHAR}
-  	    </if>
-  		<if test="uid != null">
-  	       and to_uid = #{uid,jdbcType=VARCHAR}
-  	    </if>
-  </select>
-  
-   
-   <select id="countInterest" resultType="java.lang.Integer">
-  	select count(0) from user_interest
-	where 
-  	to_uid = #{uid,jdbcType=VARCHAR}
-  </select>
-   
-   
-    
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.UserInterestMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserInterest">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="from_uid" jdbcType="VARCHAR" property="fromUid" />
+    <result column="to_uid" jdbcType="VARCHAR" property="toUid" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    id, from_uid, to_uid, create_time
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.UserInterestExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from user_interest
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from user_interest
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    delete from user_interest
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserInterestExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    delete from user_interest
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.UserInterest">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    insert into user_interest (id, from_uid, to_uid, 
+      create_time)
+    values (#{id,jdbcType=VARCHAR}, #{fromUid,jdbcType=VARCHAR}, #{toUid,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserInterest">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    insert into user_interest
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="fromUid != null">
+        from_uid,
+      </if>
+      <if test="toUid != null">
+        to_uid,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="fromUid != null">
+        #{fromUid,jdbcType=VARCHAR},
+      </if>
+      <if test="toUid != null">
+        #{toUid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.UserInterestExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    select count(*) from user_interest
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    update user_interest
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.fromUid != null">
+        from_uid = #{record.fromUid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.toUid != null">
+        to_uid = #{record.toUid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    update user_interest
+    set id = #{record.id,jdbcType=VARCHAR},
+      from_uid = #{record.fromUid,jdbcType=VARCHAR},
+      to_uid = #{record.toUid,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserInterest">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    update user_interest
+    <set>
+      <if test="fromUid != null">
+        from_uid = #{fromUid,jdbcType=VARCHAR},
+      </if>
+      <if test="toUid != null">
+        to_uid = #{toUid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserInterest">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Jun 15 09:33:14 CST 2018.
+    -->
+    update user_interest
+    set from_uid = #{fromUid,jdbcType=VARCHAR},
+      to_uid = #{toUid,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  <select id="findByFromUidAndToUid" resultMap="BaseResultMap">
+   	select 
+    <include refid="Base_Column_List" />
+    from user_interest
+    where from_uid = #{fromUid,jdbcType=VARCHAR}
+    and to_uid =  #{toUid,jdbcType=VARCHAR}
+  </select>
+  
+  <select id="findInterestUserListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.InterestUserListBo">
+	SELECT
+			uii.username,
+			oi.unit_name AS unitName,
+			u.number,
+			u.type,
+			u.id AS uid,
+			ui.id AS interestId,
+			ui.create_time AS createTime,
+			uii.province AS userProvince,
+			oi.licence_province AS orgProvince,
+			u.head_portrait_url AS personPortraitUrl,
+			oinfo.logo_url AS logoUrl,
+			adc.achievement_count AS achievementNum,
+			adc.demand_count AS demandNum
+	FROM
+		user_interest ui
+	LEFT JOIN user_identity uii ON uii.uid = ui.to_uid
+	LEFT JOIN organization_identity oi ON oi.uid = ui.to_uid
+	LEFT JOIN `user` u ON u.id = ui.to_uid
+	<!-- LEFT JOIN user_info uinfo ON uinfo.uid = ui.to_uid -->
+	LEFT JOIN organization_info oinfo ON oinfo.uid = ui.to_uid
+	LEFT JOIN achievement_demand_count adc ON adc.uid = ui.to_uid
+	WHERE
+		ui.from_uid = #{fromUid,jdbcType=VARCHAR}
+		<if test="userType != null">
+        and u.type = #{userType}
+      	</if>
+	ORDER BY
+		ui.create_time DESC
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="findInterestUserCount" parameterType="java.lang.String" resultType="java.lang.Integer">
+  	SELECT
+	  count(1)
+    FROM
+	 user_interest ui
+	 LEFT JOIN `user` u ON u.id = ui.to_uid
+    WHERE
+	 ui.from_uid = #{fromUid,jdbcType=VARCHAR}
+	 <if test="userType != null">
+       and u.type = #{userType}
+   	 </if>
+  </select>
+  
+  <select id="countByToUid" parameterType="java.lang.String" resultType="java.lang.Integer">
+  	select 
+  		count(1) 
+  	from user_interest 
+  	where to_uid = #{toUid,jdbcType=VARCHAR} 
+  </select>
+  
+  <delete id="deleteInterest" parameterType="java.lang.String">
+    delete from user_interest
+    where from_uid = #{uid,jdbcType=VARCHAR}
+    and to_uid=#{objectId,jdbcType=VARCHAR}
+    </delete>
+    <select id="checkUidAndDid" resultType="Integer">
+  		select count(0) from user_interest where 1=1
+  	    <if test="id != null">
+  	       and from_uid = #{id,jdbcType=VARCHAR}
+  	    </if>
+  		<if test="uid != null">
+  	       and to_uid = #{uid,jdbcType=VARCHAR}
+  	    </if>
+  </select>
+  
+   <select id="countInterest" resultType="java.lang.Integer">
+  	select count(0) from user_interest
+	where 
+  	to_uid = #{uid,jdbcType=VARCHAR}
+  </select>
+  
+    <select id="findAppUserInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
+  	select y.uid as id,y.username as name ,t.create_time as createTime
+	from user_interest t
+	left join  user_identity y on t.to_uid=y.uid
+	where expert=1  
+	and from_uid=#{uid,jdbcType=VARCHAR}
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findAppUserInterestCount" parameterType="String" resultType="java.lang.Integer">
+  	select count(1)
+	from user_interest t
+	left join  user_identity y on t.to_uid=y.uid
+	where expert=1  
+	and  from_uid=#{uid,jdbcType=VARCHAR}
+	</select>
+	
+	<select id="findAppCounselorInterestByPage" parameterType="String" resultType="com.goafanti.demand.bo.ObjectInterestListBo">
+  	select y.uid as id,y.username as name ,t.create_time as createTime
+	from user_interest t
+	left join  user_identity y on t.to_uid=y.uid
+	where expert=2  
+	and from_uid=#{uid,jdbcType=VARCHAR}
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findAppCounselorInterestCount" parameterType="String" resultType="java.lang.Integer">
+  	select count(1)
+	from user_interest t
+	left join  user_identity y on t.to_uid=y.uid
+	where  expert=2  
+	and from_uid=#{uid,jdbcType=VARCHAR}
+	</select>
 </mapper>

+ 84 - 37
src/main/java/com/goafanti/common/model/UserInterest.java

@@ -3,52 +3,99 @@ package com.goafanti.common.model;
 import java.util.Date;
 
 public class UserInterest {
-    private String id;
-
     /**
-    * 关注发起用户ID
-    */
-    private String fromUid;
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_interest.id
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	private String id;
 
-    /**
-    * 被关注用户ID
-    */
-    private String toUid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_interest.from_uid
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	private String fromUid;
 
-    /**
-    * 关注时间
-    */
-    private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_interest.to_uid
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	private String toUid;
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_interest.create_time
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	private Date createTime;
 
-    public String getId() {
-        return id;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_interest.id
+	 * @return  the value of user_interest.id
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public String getId() {
+		return id;
+	}
 
-    public void setId(String id) {
-        this.id = id;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_interest.id
+	 * @param id  the value for user_interest.id
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
 
-    public String getFromUid() {
-        return fromUid;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_interest.from_uid
+	 * @return  the value of user_interest.from_uid
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public String getFromUid() {
+		return fromUid;
+	}
 
-    public void setFromUid(String fromUid) {
-        this.fromUid = fromUid;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_interest.from_uid
+	 * @param fromUid  the value for user_interest.from_uid
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public void setFromUid(String fromUid) {
+		this.fromUid = fromUid;
+	}
 
-    public String getToUid() {
-        return toUid;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_interest.to_uid
+	 * @return  the value of user_interest.to_uid
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public String getToUid() {
+		return toUid;
+	}
 
-    public void setToUid(String toUid) {
-        this.toUid = toUid;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_interest.to_uid
+	 * @param toUid  the value for user_interest.to_uid
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public void setToUid(String toUid) {
+		this.toUid = toUid;
+	}
 
-    public Date getCreateTime() {
-        return createTime;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_interest.create_time
+	 * @return  the value of user_interest.create_time
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
 
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_interest.create_time
+	 * @param createTime  the value for user_interest.create_time
+	 * @mbg.generated  Fri Jun 15 09:33:14 CST 2018
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
 }

+ 573 - 0
src/main/java/com/goafanti/common/model/UserInterestExample.java

@@ -0,0 +1,573 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class UserInterestExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public UserInterestExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(String value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(String value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(String value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(String value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(String value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(String value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLike(String value) {
+            addCriterion("id like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotLike(String value) {
+            addCriterion("id not like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<String> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<String> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(String value1, String value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(String value1, String value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidIsNull() {
+            addCriterion("from_uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidIsNotNull() {
+            addCriterion("from_uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidEqualTo(String value) {
+            addCriterion("from_uid =", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidNotEqualTo(String value) {
+            addCriterion("from_uid <>", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidGreaterThan(String value) {
+            addCriterion("from_uid >", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidGreaterThanOrEqualTo(String value) {
+            addCriterion("from_uid >=", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidLessThan(String value) {
+            addCriterion("from_uid <", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidLessThanOrEqualTo(String value) {
+            addCriterion("from_uid <=", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidLike(String value) {
+            addCriterion("from_uid like", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidNotLike(String value) {
+            addCriterion("from_uid not like", value, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidIn(List<String> values) {
+            addCriterion("from_uid in", values, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidNotIn(List<String> values) {
+            addCriterion("from_uid not in", values, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidBetween(String value1, String value2) {
+            addCriterion("from_uid between", value1, value2, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andFromUidNotBetween(String value1, String value2) {
+            addCriterion("from_uid not between", value1, value2, "fromUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidIsNull() {
+            addCriterion("to_uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidIsNotNull() {
+            addCriterion("to_uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidEqualTo(String value) {
+            addCriterion("to_uid =", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidNotEqualTo(String value) {
+            addCriterion("to_uid <>", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidGreaterThan(String value) {
+            addCriterion("to_uid >", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidGreaterThanOrEqualTo(String value) {
+            addCriterion("to_uid >=", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidLessThan(String value) {
+            addCriterion("to_uid <", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidLessThanOrEqualTo(String value) {
+            addCriterion("to_uid <=", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidLike(String value) {
+            addCriterion("to_uid like", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidNotLike(String value) {
+            addCriterion("to_uid not like", value, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidIn(List<String> values) {
+            addCriterion("to_uid in", values, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidNotIn(List<String> values) {
+            addCriterion("to_uid not in", values, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidBetween(String value1, String value2) {
+            addCriterion("to_uid between", value1, value2, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andToUidNotBetween(String value1, String value2) {
+            addCriterion("to_uid not between", value1, value2, "toUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table user_interest
+     *
+     * @mbg.generated do_not_delete_during_merge Fri Jun 15 09:33:14 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table user_interest
+     *
+     * @mbg.generated Fri Jun 15 09:33:14 CST 2018
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

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

@@ -18,7 +18,6 @@ import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.Demand;
 import com.goafanti.common.model.DemandPublish;
 import com.goafanti.common.utils.StringUtils;
-import com.goafanti.demand.service.DemandFollowService;
 import com.goafanti.demand.service.DemandOrderService;
 import com.goafanti.demand.service.DemandPublishPageService;
 import com.goafanti.demand.service.DemandPublishService;
@@ -38,11 +37,6 @@ public class AdminDemandApiController extends CertifyApiController {
 	private DemandOrderService	demandOrderService;
 	@Resource
 	DemandPublishService	demandPublishService;
-	@Resource
-	DemandFollowService		demandFollowService;
-	/**
-	 * 科技需求匹配科技成果
-	 */
 	@RequestMapping(value = "/matchAchievement", method = RequestMethod.POST)
 	public Result matchAchievement(String id) {
 		Result res = new Result();

+ 0 - 25
src/main/java/com/goafanti/demand/service/DemandFollowService.java

@@ -1,25 +0,0 @@
-package com.goafanti.demand.service;
-
-import com.goafanti.common.model.DemandFollow;
-import com.goafanti.common.model.DemandFollowDetail;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.demand.bo.DemandFollowDetailListBo;
-import com.goafanti.demand.bo.DemandFollowListBo;
-
-
-
-public interface DemandFollowService {
-
-	
-	int insertDemandFollow(DemandFollow d);
-
-	int insertDemandFollowDetail(DemandFollowDetail d,String createTimeFormattedDate);
-
-	Pagination<DemandFollowListBo> selectDemandFollow(String id,Integer pNo,Integer pSize);
-
-	int deleteDemandFollow(String id);
-
-	int updateDemandFollow(DemandFollow d);
-	
-	Pagination<DemandFollowDetailListBo> selectDemandFollowDetail(String id,Integer pNo, Integer pSize);
-}

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

@@ -35,7 +35,7 @@ public interface DemandService {
 
 	void insertImport(List<DemandImportBo> data);
 
-	DemandSearchDetailBo selectDemandSearchDetail(String uid, String id);
+	DemandSearchDetailBo selectDemandDetail(String uid, String id);
 
 	int updateMatchAchievement(Demand d);
 

+ 0 - 109
src/main/java/com/goafanti/demand/service/impl/DemandFollowServiceImpl.java

@@ -1,109 +0,0 @@
-package com.goafanti.demand.service.impl;
-
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.DemandFollowDetailMapper;
-import com.goafanti.common.dao.DemandFollowMapper;
-import com.goafanti.common.enums.DemandFollowResult;
-import com.goafanti.common.model.DemandFollow;
-import com.goafanti.common.model.DemandFollowDetail;
-import com.goafanti.common.utils.DateUtils;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.demand.bo.DemandFollowDetailListBo;
-import com.goafanti.demand.bo.DemandFollowListBo;
-import com.goafanti.demand.service.DemandFollowService;
-
-@Service
-public class DemandFollowServiceImpl extends BaseMybatisDao<DemandFollowMapper> implements DemandFollowService {
-
-	@Autowired
-	private DemandFollowMapper	demandFollowMapper;
-	
-	@Autowired
-	private DemandFollowDetailMapper	demandFollowDetailMapper;
-
-	private static final Logger				logger	= LoggerFactory.getLogger(DemandFollowServiceImpl.class);
-
-	@Override
-	public int insertDemandFollow(DemandFollow d) {
-		d.setId(UUID.randomUUID().toString());
-		d.setResult(DemandFollowResult.FOLLOW.getCode());
-		demandFollowMapper.insert(d);
-		return 1;
-	}
-
-	@Override
-	public int insertDemandFollowDetail(DemandFollowDetail d,String createTimeFormattedDate) {
-		d.setId(UUID.randomUUID().toString());
-		try {
-			d.setCreateTime(DateUtils.parseDate(createTimeFormattedDate,AFTConstants.YYYYMMDD));
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}
-		demandFollowDetailMapper.insert(d);
-		DemandFollow df=demandFollowMapper.selectByPrimaryKey(d.getDemandFollowId());
-		df.setLastFollowTime(d.getCreateTime());
-		df.setResult(d.getResult());
-		demandFollowMapper.updateByPrimaryKey(df);
-		return 1;
-		}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<DemandFollowListBo> selectDemandFollow(String id, Integer pNo, Integer pSize) {
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0) {
-			pSize = 10;
-		}
-		Map<String, Object> params=new HashMap<String, Object>();
-		params.put("id", id);
-		Pagination<DemandFollowListBo> p=(Pagination<DemandFollowListBo>) findPage("findDemandFollowListByPage", "findDemandFollowCount", params, pNo, pSize);
-		List<DemandFollowListBo> list =(List<DemandFollowListBo>) p.getList();
-		for (DemandFollowListBo d : list) {
-			d.setDemandFollowDetail(demandFollowDetailMapper.selectDemandFollowDetail(d.getId()));
-			
-		}
-		return p;
-	}
-
-	@Override
-	public int deleteDemandFollow(String id) {
-		return demandFollowMapper.deleteByPrimaryKey(id);
-	}
-
-	@Override
-	public int updateDemandFollow(DemandFollow d) {
-		
-		return demandFollowMapper.updateByPrimaryKeySelective(d);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<DemandFollowDetailListBo> selectDemandFollowDetail(String id,Integer pNo, Integer pSize) {
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0) {
-			pSize = 10;
-		}
-		Map<String, Object> params=new HashMap<String, Object>();
-		params.put("id", id);
-		return (Pagination<DemandFollowDetailListBo>) findPage("findDemandFollowDetailListByPage", "findDemandFollowDetailCount", params, pNo, pSize);
-			
-		}
-	}
-
-	

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

@@ -311,8 +311,8 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	}
 
 	@Override
-	public DemandSearchDetailBo selectDemandSearchDetail(String uid, String id) {
-		return demandMapper.selectDemandSearchDetail(uid, id);
+	public DemandSearchDetailBo selectDemandDetail(String uid, String id) {
+		return demandMapper.selectDemandDetail(uid, id);
 	}
 
 	private Map<String, Object> disposeParams(Integer auditStatus, Integer province, Integer serialNumber, String name,
@@ -609,12 +609,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<ObjectInterestListBo> selectinterest(Integer type,Integer pNo, Integer pSize) {
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-		if (pSize == null || pSize < 0) {
-			pSize = 10;
-		}
+
 		Map<String, Object> params=new HashMap<>();
 		params.put("type", type);
 		if (StringUtils.isNotBlank(TokenManager.getUserId())) {

+ 1 - 1
src/main/java/com/goafanti/portal/controller/PortalInterestApiController.java

@@ -185,7 +185,7 @@ public class PortalInterestApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
 			return res;
 		}
-		res.setData(demandService.selectDemandSearchDetail(TokenManager.getUserId(), id));
+		res.setData(demandService.selectDemandDetail(TokenManager.getUserId(), id));
 		return res;
 	}