瀏覽代碼

合并代码 ,修改行业sql

liliang4869 7 年之前
父節點
當前提交
9f8716dfb1

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

@@ -1097,9 +1097,9 @@ order by
 	d.technical_picture_url as technicalPictureUrl
 from
 	achievement d
-left join aft.industry_category fg on
+left join industry_category fg on
 	fg.id = d.field_a
-left join aft.industry_category fgg on
+left join industry_category fgg on
 	fgg.id = d.field_b
 left join branch_information branchInfo on
 	instr( #{1},branchInfo.domain_name )>0
@@ -1132,9 +1132,9 @@ left join branch_information branchInfo
 on INSTR(#{1},branchInfo.domain_name)>0
 left join achievement_publish ap
  on ap.achievement_id=a.id
- left join aft.industry_category fg on
+ left join industry_category fg on
 	fg.id = a.field_a
-left join aft.industry_category fgg on
+left join industry_category fgg on
 	fgg.id = a.field_b
 left join 
 (select  
@@ -1190,9 +1190,9 @@ from
 	achievement a
 left join branch_information bi on instr(#{1},bi.domain_name)>0
 left join achievement_publish ap on ap.achievement_id=a.id
-left join aft.industry_category fg on
+left join industry_category fg on
 	fg.id = a.field_a
-left join aft.industry_category fgg on
+left join industry_category fgg on
 	fgg.id = a.field_b
 where audit_status=2
 and bi.id =ap.publish_platform

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

@@ -1001,8 +1001,8 @@
  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,problem_des as problemDes,d.picture_url as pictureUrl
  from demand d 
-     left join aft.industry_category  fg  on fg.id=d.industry_category_a
-    left join aft.industry_category fgg  on fgg.id=d.industry_category_b
+     left join industry_category  fg  on fg.id=d.industry_category_a
+    left join industry_category fgg  on fgg.id=d.industry_category_b
   left join branch_information branchInfo on INSTR(#{1},branchInfo.domain_name)>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
@@ -1036,8 +1036,8 @@ left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchI
  fg.name as industryCategory1,fgg.name as industryCategory2,d.picture_url as pictureUrl,
  data_category as dataCategory,validity_period as validityPeriod
   from demand d 
-      left join aft.industry_category  fg  on fg.id=d.industry_category_a
-    left join aft.industry_category fgg  on fgg.id=d.industry_category_b
+      left join industry_category  fg  on fg.id=d.industry_category_a
+    left join industry_category fgg  on fgg.id=d.industry_category_b
       left join branch_information branchInfo on INSTR(#{1},branchInfo.domain_name)>0
 left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
    where d.is_hot=1 and d.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
@@ -1054,8 +1054,8 @@ left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchI
   
    <select id="getProLearnStudyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
     select d.name as name,picture_url as pictureUrl ,problem_des as problemDes,employer_name as employerName,d.id,fg.name as industryCategory1,data_category as dataCategory,fgg.name as industryCategory2 from demand d  
-    left join aft.industry_category  fg  on fg.id=d.industry_category_a
-    left join aft.industry_category fgg  on fgg.id=d.industry_category_b
+    left join industry_category  fg  on fg.id=d.industry_category_a
+    left join industry_category fgg  on fgg.id=d.industry_category_b
            left join branch_information branchInfo on INSTR(#{1},branchInfo.domain_name)>0
 left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
  where d.demand_type=2 and d.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

+ 0 - 124
src/main/java/com/goafanti/common/mapper/DemandOrderLogMapper.xml

@@ -1,124 +0,0 @@
-<?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.DemandOrderLogMapper" >
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandOrderLog" >
-    <id column="id" property="id" jdbcType="VARCHAR" />
-    <result column="demand_order_id" property="demandOrderId" jdbcType="VARCHAR" />
-    <result column="record_time" property="recordTime" jdbcType="TIMESTAMP" />
-    <result column="status" property="status" jdbcType="INTEGER" />
-    <result column="operator" property="operator" jdbcType="VARCHAR" />
-    <result column="comment" property="comment" jdbcType="VARCHAR" />
-  </resultMap>
-  <sql id="Base_Column_List" >
-    id, demand_order_id, record_time, status, operator, comment
-  </sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
-    select 
-    <include refid="Base_Column_List" />
-    from demand_order_log
-    where id = #{id,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
-    delete from demand_order_log
-    where id = #{id,jdbcType=VARCHAR}
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.DemandOrderLog" >
-    insert into demand_order_log (id, demand_order_id, record_time, 
-      status, operator, comment
-      )
-    values (#{id,jdbcType=VARCHAR}, #{demandOrderId,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP}, 
-      #{status,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandOrderLog" >
-    insert into demand_order_log
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        id,
-      </if>
-      <if test="demandOrderId != null" >
-        demand_order_id,
-      </if>
-      <if test="recordTime != null" >
-        record_time,
-      </if>
-      <if test="status != null" >
-        status,
-      </if>
-      <if test="operator != null" >
-        operator,
-      </if>
-      <if test="comment != null" >
-        comment,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        #{id,jdbcType=VARCHAR},
-      </if>
-      <if test="demandOrderId != null" >
-        #{demandOrderId,jdbcType=VARCHAR},
-      </if>
-      <if test="recordTime != null" >
-        #{recordTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="status != null" >
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="operator != null" >
-        #{operator,jdbcType=VARCHAR},
-      </if>
-      <if test="comment != null" >
-        #{comment,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandOrderLog" >
-    update demand_order_log
-    <set >
-      <if test="demandOrderId != null" >
-        demand_order_id = #{demandOrderId,jdbcType=VARCHAR},
-      </if>
-      <if test="recordTime != null" >
-        record_time = #{recordTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="status != null" >
-        status = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="operator != null" >
-        operator = #{operator,jdbcType=VARCHAR},
-      </if>
-      <if test="comment != null" >
-        comment = #{comment,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandOrderLog" >
-    update demand_order_log
-    set demand_order_id = #{demandOrderId,jdbcType=VARCHAR},
-      record_time = #{recordTime,jdbcType=TIMESTAMP},
-      status = #{status,jdbcType=INTEGER},
-      operator = #{operator,jdbcType=VARCHAR},
-      comment = #{comment,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  
-  <select id="selectDemandOrderLogByDemandOrderId" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandOrderLogUserBo">
-  	select 
-  		record_time as recordTime, status, comment
-  	from demand_order_log
-  	where demand_order_id = #{demandOrderId,jdbcType=VARCHAR}
-  	order by record_time 
-  </select>
-  
-   <select id="selectAdminDemandOrderLogByDemandOrderId" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandOrderLogAdminBo">
-  	select 
-  		dol.record_time as recordTime, dol.status, dol.comment,
-  		a.name as operator
-  	from demand_order_log dol
-  	left join admin a on a.id = dol.operator
-  	where dol.demand_order_id = #{demandOrderId,jdbcType=VARCHAR}
-  	order by record_time 
-  </select>
-</mapper>

+ 114 - 114
src/main/java/com/goafanti/common/mapper/IndustryCategoryMapper.xml

@@ -1,115 +1,115 @@
-<?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.IndustryCategoryMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.IndustryCategory">
-    <id column="id" jdbcType="INTEGER" property="id" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="pid" jdbcType="INTEGER" property="pid" />
-    <result column="value" jdbcType="DECIMAL" property="value" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    id, name, pid, value
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from industry_category
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from industry_category
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.IndustryCategory">
-    insert into industry_category (id, name, pid, 
-      value)
-    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=INTEGER}, 
-      #{value,jdbcType=DECIMAL})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.IndustryCategory">
-    insert into industry_category
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="name != null">
-        name,
-      </if>
-      <if test="pid != null">
-        pid,
-      </if>
-      <if test="value != null">
-        value,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="pid != null">
-        #{pid,jdbcType=INTEGER},
-      </if>
-      <if test="value != null">
-        #{value,jdbcType=DECIMAL},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.IndustryCategory">
-    update industry_category
-    <set>
-      <if test="name != null">
-        name = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="pid != null">
-        pid = #{pid,jdbcType=INTEGER},
-      </if>
-      <if test="value != null">
-        value = #{value,jdbcType=DECIMAL},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.IndustryCategory">
-    update industry_category
-    set name = #{name,jdbcType=VARCHAR},
-      pid = #{pid,jdbcType=INTEGER},
-      value = #{value,jdbcType=DECIMAL}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  
-  <select id="listByPid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from industry_category
-    where pid = #{pid,jdbcType=INTEGER}
-  </select>
-  <select id="selectindustryList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
-  	SELECT id, name, pid, `level`
-	FROM aft.field_glossory
-	WHERE level=1
-  </select>
-  
-  <select id="selectDomainList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
-  	SELECT id,name,pid
-	FROM aft.industry_category
-	WHERE pid=0
-  </select>
-  <select id="selectIndustryReletively"  resultMap="reletivelyIndustry">
-  select id,pid,name,value from industry_category where pid=0;
-  </select>
-    <resultMap type="com.goafanti.common.bo.ReletivelyIndustry" id="reletivelyIndustry">  
-        <id column="name" property="name"/>  
-        <id column="id"   property="id"/>
-        <id column="pid" property="pid"/>
-        <id column="value" property="value"/>
-        <collection property="children" select="getIndustryByPid" column="id" ofType="com.goafanti.common.model.IndustryCategory">
-        </collection>  
-    </resultMap>  
-  
-  <select id="getIndustryByPid" resultType="com.goafanti.common.model.IndustryCategory">
-  select id,name,pid,value from industry_category where pid=#{0};
-  </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.IndustryCategoryMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.IndustryCategory">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="pid" jdbcType="INTEGER" property="pid" />
+    <result column="value" jdbcType="DECIMAL" property="value" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, name, pid, value
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from industry_category
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from industry_category
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.IndustryCategory">
+    insert into industry_category (id, name, pid, 
+      value)
+    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=INTEGER}, 
+      #{value,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.IndustryCategory">
+    insert into industry_category
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="pid != null">
+        pid,
+      </if>
+      <if test="value != null">
+        value,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="pid != null">
+        #{pid,jdbcType=INTEGER},
+      </if>
+      <if test="value != null">
+        #{value,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.IndustryCategory">
+    update industry_category
+    <set>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="pid != null">
+        pid = #{pid,jdbcType=INTEGER},
+      </if>
+      <if test="value != null">
+        value = #{value,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.IndustryCategory">
+    update industry_category
+    set name = #{name,jdbcType=VARCHAR},
+      pid = #{pid,jdbcType=INTEGER},
+      value = #{value,jdbcType=DECIMAL}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
+  <select id="listByPid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from industry_category
+    where pid = #{pid,jdbcType=INTEGER}
+  </select>
+  <select id="selectindustryList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
+  	SELECT id, name, pid, `level`
+	FROM aft.field_glossory
+	WHERE level=1
+  </select>
+  
+  <select id="selectDomainList" resultType="com.goafanti.common.bo.fieldGlossoryBo">
+  	SELECT id,name,pid
+	FROM industry_category
+	WHERE pid=0
+  </select>
+  <select id="selectIndustryReletively"  resultMap="reletivelyIndustry">
+  select id,pid,name,value from industry_category where pid=0;
+  </select>
+    <resultMap type="com.goafanti.common.bo.ReletivelyIndustry" id="reletivelyIndustry">  
+        <id column="name" property="name"/>  
+        <id column="id"   property="id"/>
+        <id column="pid" property="pid"/>
+        <id column="value" property="value"/>
+        <collection property="children" select="getIndustryByPid" column="id" ofType="com.goafanti.common.model.IndustryCategory">
+        </collection>  
+    </resultMap>  
+  
+  <select id="getIndustryByPid" resultType="com.goafanti.common.model.IndustryCategory">
+  select id,name,pid,value from industry_category where pid=#{0};
+  </select>
 </mapper>