|
@@ -37,8 +37,9 @@
|
|
|
left join business_item_product ip ON ip.business_id = b.id
|
|
|
left join product p on p.id = ip.product_id
|
|
|
WHERE b.company_id = #{companyId}
|
|
|
+ and is_delete = #{isDelete}
|
|
|
<if test="name != null and name != ''" >
|
|
|
- and b.name = #{bo.name}
|
|
|
+ and b.name = #{name}
|
|
|
</if>
|
|
|
<if test="stage != null " >
|
|
|
and b.stage = #{stage}
|
|
@@ -64,6 +65,7 @@
|
|
|
left join business_item_product ip ON ip.business_id = b.id
|
|
|
left join product p on p.id = ip.product_id
|
|
|
WHERE b.company_id = #{bo.companyId}
|
|
|
+ and b.is_delete = #{bo.isDelete}
|
|
|
and b.incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
and b.incharger_id is null
|
|
@@ -93,8 +95,9 @@
|
|
|
FROM business_opportunity b
|
|
|
left join business_item_product ip ON ip.business_id = b.id
|
|
|
left join product p on p.id = ip.product_id
|
|
|
- WHERE b.company_id = #{companyId}
|
|
|
+ WHERE b.company_id = #{bo.companyId}
|
|
|
and b.incharger_id = #{userId}
|
|
|
+ and b.is_delete = #{bo.isDelete}
|
|
|
and b.incharger_id is null
|
|
|
<if test="bo.name != null and bo.name != ''">
|
|
|
and b.name = #{bo.name}
|
|
@@ -117,18 +120,19 @@
|
|
|
FROM business_opportunity b
|
|
|
left join business_item_product ip ON ip.business_id = b.id
|
|
|
left join product p on p.id = ip.product_id
|
|
|
- WHERE b.company_id = #{bo.companyId}
|
|
|
- <if test="bo.name != null and bo.name != ''" >
|
|
|
- and b.name = #{bo.name}
|
|
|
+ WHERE b.company_id = #{companyId}
|
|
|
+ and b.is_delete = #{isDelete}
|
|
|
+ <if test="name != null and name != ''" >
|
|
|
+ and b.name = #{name}
|
|
|
</if>
|
|
|
- <if test="bo.stage != null " >
|
|
|
- and b.stage = #{bo.stage}
|
|
|
+ <if test="stage != null " >
|
|
|
+ and b.stage = #{stage}
|
|
|
</if>
|
|
|
- <if test="bo.startTime != null and bo.endTime != null " >
|
|
|
- and b.expected_transaction_date BETWEEN #{bo.startTime} and #{bo.endTime}
|
|
|
+ <if test="startTime != null and endTime != null " >
|
|
|
+ and b.expected_transaction_date BETWEEN #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
- <if test="bo.productId != null ">
|
|
|
- and p.id = #{bo.productId}
|
|
|
+ <if test="productId != null ">
|
|
|
+ and p.id = #{productId}
|
|
|
</if>
|
|
|
GROUP BY b.id
|
|
|
</select>
|
|
@@ -139,6 +143,7 @@
|
|
|
left join business_item_product ip ON ip.business_id = b.id
|
|
|
left join product p on p.id = ip.product_id
|
|
|
WHERE b.company_id = #{bo.companyId}
|
|
|
+ and b.is_delete = #{bo.isDelete}
|
|
|
and b.incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
and b.incharger_id is null
|
|
@@ -163,6 +168,7 @@
|
|
|
left join business_item_product ip ON ip.business_id = b.id
|
|
|
left join product p on p.id = ip.product_id
|
|
|
WHERE b.company_id = #{bo.companyId}
|
|
|
+ and b.is_delete = #{bo.isDelete}
|
|
|
and b.incharger_id = #{userId}
|
|
|
and b.incharger_id is null
|
|
|
<if test="bo.name != null and bo.name != ''">
|