|
@@ -104,64 +104,64 @@
|
|
|
(select `name` from `user` where id = creator_id) creatorName,
|
|
|
(SELECT sum(total) from business_product WHERE business_id = id)
|
|
|
from business_opportunity
|
|
|
- where company_id = #{companyId}
|
|
|
- and is_delete = #{isDelete}
|
|
|
+ where company_id = #{bo.companyId}
|
|
|
+ and is_delete = #{bo.isDelete}
|
|
|
and (incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
or incharger_id is null)
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and `name` LIKE CONCAT('%', #{name}, '%')
|
|
|
+ <if test="bo.name != null and bo.name != ''">
|
|
|
+ and `name` LIKE CONCAT('%', #{bo.name}, '%')
|
|
|
</if>
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and incharger_id = #{inchargerId}
|
|
|
+ <if test="bo.inchargerId != null ">
|
|
|
+ and incharger_id = #{bo.inchargerId}
|
|
|
</if>
|
|
|
- <if test="startTime != null and endTime != null ">
|
|
|
- and create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ <if test="bo.startTime != null and bo.endTime != null ">
|
|
|
+ and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
|
|
|
</if>
|
|
|
- <if test="contactsName != null and contactsName != ''">
|
|
|
- and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
|
|
|
+ <if test="bo.contactsName != null and bo.contactsName != ''">
|
|
|
+ and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
|
|
|
</if>
|
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
- and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
|
|
|
+ <if test="bo.customerName != null and bo.customerName != ''">
|
|
|
+ and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
|
|
|
</if>
|
|
|
- <if test="stageId != null ">
|
|
|
- and stage_id = #{stageId}
|
|
|
+ <if test="bo.stageId != null ">
|
|
|
+ and stage_id = #{bo.stageId}
|
|
|
</if>
|
|
|
- <if test="productId != null ">
|
|
|
- and id in (select business_id from business_product where product_id = #{productId})
|
|
|
+ <if test="bo.productId != null ">
|
|
|
+ and id in (select business_id from business_product where product_id = #{bo.productId})
|
|
|
</if>
|
|
|
ORDER BY id DESC
|
|
|
- limit #{pageIndex},#{pageFrom}
|
|
|
+ limit #{bo.pageIndex},#{bo.pageFrom}
|
|
|
</select>
|
|
|
<select id="getTotal1" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(id)
|
|
|
from business_opportunity
|
|
|
- where company_id = #{companyId}
|
|
|
- and is_delete = #{isDelete}
|
|
|
+ where company_id = #{bo.companyId}
|
|
|
+ and is_delete = #{bo.isDelete}
|
|
|
and (incharger_id in
|
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
|
|
|
or incharger_id is null)
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and `name` LIKE CONCAT('%', #{name}, '%')
|
|
|
+ <if test="bo.name != null and bo.name != ''">
|
|
|
+ and `name` LIKE CONCAT('%', #{bo.name}, '%')
|
|
|
</if>
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and incharger_id = #{inchargerId}
|
|
|
+ <if test="bo.inchargerId != null ">
|
|
|
+ and incharger_id = #{bo.inchargerId}
|
|
|
</if>
|
|
|
- <if test="startTime != null and endTime != null ">
|
|
|
- and create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ <if test="bo.startTime != null and bo.endTime != null ">
|
|
|
+ and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
|
|
|
</if>
|
|
|
- <if test="contactsName != null and contactsName != ''">
|
|
|
- and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
|
|
|
+ <if test="bo.contactsName != null and bo.contactsName != ''">
|
|
|
+ and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
|
|
|
</if>
|
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
- and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
|
|
|
+ <if test="bo.customerName != null and bo.customerName != ''">
|
|
|
+ and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
|
|
|
</if>
|
|
|
- <if test="stageId != null ">
|
|
|
- and stage_id = #{stageId}
|
|
|
+ <if test="bo.stageId != null ">
|
|
|
+ and stage_id = #{bo.stageId}
|
|
|
</if>
|
|
|
- <if test="productId != null ">
|
|
|
- and id in (select business_id from business_product where product_id = #{productId})
|
|
|
+ <if test="bo.productId != null ">
|
|
|
+ and id in (select business_id from business_product where product_id = #{bo.productId})
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
|
|
@@ -174,60 +174,60 @@
|
|
|
(select `name` from `user` where id = creator_id) creatorName,
|
|
|
(SELECT sum(total) from business_product WHERE business_id = id)
|
|
|
from business_opportunity
|
|
|
- where company_id = #{companyId}
|
|
|
- and is_delete = #{isDelete}
|
|
|
+ where company_id = #{bo.companyId}
|
|
|
+ and is_delete = #{bo.isDelete}
|
|
|
and (incharger_id = #{userId} or incharger_id is null)
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and `name` LIKE CONCAT('%', #{name}, '%')
|
|
|
+ <if test="bo.name != null and bo.name != ''">
|
|
|
+ and `name` LIKE CONCAT('%', #{bo.name}, '%')
|
|
|
</if>
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and incharger_id = #{inchargerId}
|
|
|
+ <if test="bo.inchargerId != null ">
|
|
|
+ and incharger_id = #{bo.inchargerId}
|
|
|
</if>
|
|
|
- <if test="startTime != null and endTime != null ">
|
|
|
- and create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ <if test="bo.startTime != null and bo.endTime != null ">
|
|
|
+ and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
|
|
|
</if>
|
|
|
- <if test="contactsName != null and contactsName != ''">
|
|
|
- and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
|
|
|
+ <if test="bo.contactsName != null and bo.contactsName != ''">
|
|
|
+ and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
|
|
|
</if>
|
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
- and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
|
|
|
+ <if test="bo.customerName != null and bo.customerName != ''">
|
|
|
+ and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
|
|
|
</if>
|
|
|
- <if test="stageId != null ">
|
|
|
- and stage_id = #{stageId}
|
|
|
+ <if test="bo.stageId != null ">
|
|
|
+ and stage_id = #{bo.stageId}
|
|
|
</if>
|
|
|
- <if test="productId != null ">
|
|
|
- and id in (select business_id from business_product where product_id = #{productId})
|
|
|
+ <if test="bo.productId != null ">
|
|
|
+ and id in (select business_id from business_product where product_id =#{bo.productId})
|
|
|
</if>
|
|
|
ORDER BY id DESC
|
|
|
- limit #{pageIndex},#{pageFrom}
|
|
|
+ limit #{bo.pageIndex},#{bo.pageFrom}
|
|
|
</select>
|
|
|
<select id="getTotal2" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(id)
|
|
|
from business_opportunity
|
|
|
- where company_id = #{companyId}
|
|
|
- and is_delete = #{isDelete}
|
|
|
+ where company_id = #{bo.companyId}
|
|
|
+ and is_delete = #{bo.isDelete}
|
|
|
and (incharger_id = #{userId} or incharger_id is null)
|
|
|
- <if test="name != null and name != ''">
|
|
|
- and `name` LIKE CONCAT('%', #{name}, '%')
|
|
|
+ <if test="bo.name != null and bo.name != ''">
|
|
|
+ and `name` LIKE CONCAT('%', #{bo.name}, '%')
|
|
|
</if>
|
|
|
- <if test="inchargerId != null ">
|
|
|
- and incharger_id = #{inchargerId}
|
|
|
+ <if test="bo.inchargerId != null ">
|
|
|
+ and incharger_id = #{bo.inchargerId}
|
|
|
</if>
|
|
|
- <if test="startTime != null and endTime != null ">
|
|
|
- and create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ <if test="bo.startTime != null and bo.endTime != null ">
|
|
|
+ and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
|
|
|
</if>
|
|
|
- <if test="contactsName != null and contactsName != ''">
|
|
|
- and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
|
|
|
+ <if test="bo.contactsName != null and bo.contactsName != ''">
|
|
|
+ and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
|
|
|
</if>
|
|
|
- <if test="customerName != null and customerName != ''">
|
|
|
- and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
|
|
|
+ <if test="bo.customerName != null and bo.customerName != ''">
|
|
|
+ and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
|
|
|
</if>
|
|
|
- <if test="stageId != null ">
|
|
|
- and stage_id = #{stageId}
|
|
|
+ <if test="bo.stageId != null ">
|
|
|
+ and stage_id = #{bo.stageId}
|
|
|
</if>
|
|
|
- <if test="productId != null ">
|
|
|
- and id in (select business_id from business_product where product_id = #{productId})
|
|
|
+ <if test="bo.productId != null ">
|
|
|
+ and id in (select business_id from business_product where product_id = #{bo.productId})
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectByIdToInfo" resultType="com.management.platform.entity.BusinessOpportunity">
|