|
@@ -33,12 +33,35 @@
|
|
<select id="selectAllList" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
<select id="selectAllList" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
select
|
|
select
|
|
<include refid="Base_Column_List"></include>,
|
|
<include refid="Base_Column_List"></include>,
|
|
|
|
+ (select `name` from stage where id = stage_id) stageValue,
|
|
(select custom_name from custom where id = customer_id) customerName,
|
|
(select custom_name from custom where id = customer_id) customerName,
|
|
(select `name` from contacts where id = contacts_id) contactsName,
|
|
(select `name` from contacts where id = contacts_id) contactsName,
|
|
|
|
+ (select `name` from `user` where id = contacts_id) inchargerName,
|
|
|
|
+ (select `name` from `user` where id = creator_id) creatorName,
|
|
(SELECT sum(total) from business_product WHERE business_id = id)
|
|
(SELECT sum(total) from business_product WHERE business_id = id)
|
|
from business_opportunity
|
|
from business_opportunity
|
|
where company_id = #{companyId}
|
|
where company_id = #{companyId}
|
|
- and
|
|
|
|
|
|
+ <if test="name != null and name != ''">
|
|
|
|
+ and `name` LIKE CONCAT('%', #{name}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="inchargerId != null ">
|
|
|
|
+ and incharger_id = #{inchargerId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startTime != null and endTime != null ">
|
|
|
|
+ and create_time BETWEEN #{startTime} and #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="contactsName != null and contactsName != ''">
|
|
|
|
+ and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="customerName != null and customerName != ''">
|
|
|
|
+ and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="stageId != null ">
|
|
|
|
+ and stage_id = #{stageId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="productId != null ">
|
|
|
|
+ and id in (select business_id from business_product where product_id = #{productId})
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|