|
@@ -39,8 +39,7 @@
|
|
(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 = incharger_id) inchargerName,
|
|
(select `name` from `user` where id = incharger_id) inchargerName,
|
|
- (select `name` from `user` where id = creator_id) creatorName,
|
|
|
|
- (SELECT sum(total) from business_product WHERE business_id = id) total
|
|
|
|
|
|
+ (select `name` from `user` where id = creator_id) creatorName
|
|
from business_opportunity
|
|
from business_opportunity
|
|
where company_id = #{companyId}
|
|
where company_id = #{companyId}
|
|
and is_delete = #{isDelete}
|
|
and is_delete = #{isDelete}
|
|
@@ -63,7 +62,7 @@
|
|
and stage_id = #{stageId}
|
|
and stage_id = #{stageId}
|
|
</if>
|
|
</if>
|
|
<if test="productId != null ">
|
|
<if test="productId != null ">
|
|
- and id in (select business_id from business_product where product_id = #{productId})
|
|
|
|
|
|
+ and id in (select business_id from business_item_product where product_id = #{productId})
|
|
</if>
|
|
</if>
|
|
ORDER BY id DESC
|
|
ORDER BY id DESC
|
|
<if test="pageIndex!=null and pageFrom !=null">
|
|
<if test="pageIndex!=null and pageFrom !=null">
|
|
@@ -96,7 +95,7 @@
|
|
and stage_id = #{stageId}
|
|
and stage_id = #{stageId}
|
|
</if>
|
|
</if>
|
|
<if test="productId != null ">
|
|
<if test="productId != null ">
|
|
- and id in (select business_id from business_product where product_id = #{productId})
|
|
|
|
|
|
+ and id in (select business_id from business_item_product where product_id = #{productId})
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="selectAllList1" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
<select id="selectAllList1" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
@@ -106,8 +105,7 @@
|
|
(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 = incharger_id) inchargerName,
|
|
(select `name` from `user` where id = incharger_id) inchargerName,
|
|
- (select `name` from `user` where id = creator_id) creatorName,
|
|
|
|
- (SELECT sum(total) from business_product WHERE business_id = id)
|
|
|
|
|
|
+ (select `name` from `user` where id = creator_id) creatorName
|
|
from business_opportunity
|
|
from business_opportunity
|
|
where company_id = #{bo.companyId}
|
|
where company_id = #{bo.companyId}
|
|
and is_delete = #{bo.isDelete}
|
|
and is_delete = #{bo.isDelete}
|
|
@@ -133,7 +131,7 @@
|
|
and stage_id = #{bo.stageId}
|
|
and stage_id = #{bo.stageId}
|
|
</if>
|
|
</if>
|
|
<if test="bo.productId != null ">
|
|
<if test="bo.productId != null ">
|
|
- and id in (select business_id from business_product where product_id = #{bo.productId})
|
|
|
|
|
|
+ and id in (select business_id from business_item_product where product_id = #{bo.productId})
|
|
</if>
|
|
</if>
|
|
ORDER BY id DESC
|
|
ORDER BY id DESC
|
|
<if test="bo.pageIndex!=null and bo.pageFrom !=null">
|
|
<if test="bo.pageIndex!=null and bo.pageFrom !=null">
|
|
@@ -168,7 +166,7 @@
|
|
and stage_id = #{bo.stageId}
|
|
and stage_id = #{bo.stageId}
|
|
</if>
|
|
</if>
|
|
<if test="bo.productId != null ">
|
|
<if test="bo.productId != null ">
|
|
- and id in (select business_id from business_product where product_id = #{bo.productId})
|
|
|
|
|
|
+ and id in (select business_id from business_item_product where product_id = #{bo.productId})
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="selectAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
<select id="selectAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
@@ -178,8 +176,7 @@
|
|
(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 = incharger_id) inchargerName,
|
|
(select `name` from `user` where id = incharger_id) inchargerName,
|
|
- (select `name` from `user` where id = creator_id) creatorName,
|
|
|
|
- (SELECT sum(total) from business_product WHERE business_id = id)
|
|
|
|
|
|
+ (select `name` from `user` where id = creator_id) creatorName
|
|
from business_opportunity
|
|
from business_opportunity
|
|
where company_id = #{bo.companyId}
|
|
where company_id = #{bo.companyId}
|
|
and is_delete = #{bo.isDelete}
|
|
and is_delete = #{bo.isDelete}
|
|
@@ -203,7 +200,7 @@
|
|
and stage_id = #{bo.stageId}
|
|
and stage_id = #{bo.stageId}
|
|
</if>
|
|
</if>
|
|
<if test="bo.productId != null ">
|
|
<if test="bo.productId != null ">
|
|
- and id in (select business_id from business_product where product_id =#{bo.productId})
|
|
|
|
|
|
+ and id in (select business_id from business_item_product where product_id =#{bo.productId})
|
|
</if>
|
|
</if>
|
|
ORDER BY id DESC
|
|
ORDER BY id DESC
|
|
<if test="bo.pageIndex!=null and bo.pageFrom !=null">
|
|
<if test="bo.pageIndex!=null and bo.pageFrom !=null">
|
|
@@ -236,7 +233,7 @@
|
|
and stage_id = #{bo.stageId}
|
|
and stage_id = #{bo.stageId}
|
|
</if>
|
|
</if>
|
|
<if test="bo.productId != null ">
|
|
<if test="bo.productId != null ">
|
|
- and id in (select business_id from business_product where product_id = #{bo.productId})
|
|
|
|
|
|
+ and id in (select business_id from business_item_product where product_id = #{bo.productId})
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="selectByIdToInfo" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
<select id="selectByIdToInfo" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
@@ -245,8 +242,7 @@
|
|
(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 = incharger_id) inchargerName,
|
|
(select `name` from `user` where id = incharger_id) inchargerName,
|
|
- (select `name` from `user` where id = creator_id) creatorName,
|
|
|
|
- (SELECT sum(total) from business_product WHERE business_id = id)
|
|
|
|
|
|
+ (select `name` from `user` where id = creator_id) creatorName
|
|
from business_opportunity
|
|
from business_opportunity
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</select>
|
|
</select>
|