|
|
@@ -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>
|