|
@@ -53,7 +53,6 @@
|
|
order_id,
|
|
order_id,
|
|
allot_type,
|
|
allot_type,
|
|
production_no,
|
|
production_no,
|
|
- production_type,
|
|
|
|
clientele_id,
|
|
clientele_id,
|
|
customer.name AS customerName,
|
|
customer.name AS customerName,
|
|
bailor,
|
|
bailor,
|
|
@@ -120,4 +119,85 @@
|
|
ORDER BY assets.created DESC
|
|
ORDER BY assets.created DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <!--条件查询我的资产任务订单列表-->
|
|
|
|
+ <select id="selectMyOrderPage" resultType="com.dayou.vo.AssetsVO">
|
|
|
|
+ SELECT assets.id,
|
|
|
|
+ assets.name,
|
|
|
|
+ assets.order_id,
|
|
|
|
+ allot_type,
|
|
|
|
+ production.production_no,
|
|
|
|
+ clientele_id,
|
|
|
|
+ customer.name AS customerName,
|
|
|
|
+ bailor,
|
|
|
|
+ bailor_contact_name,
|
|
|
|
+ bailor_contact_tel,
|
|
|
|
+ assets.created,
|
|
|
|
+ target.estimated_value,
|
|
|
|
+ fund.should_amount,
|
|
|
|
+ fund.real_amount,
|
|
|
|
+ fund.discount,
|
|
|
|
+ pFund.standard_amount,
|
|
|
|
+ invoice.real_amount AS invoiceRealAmount,
|
|
|
|
+ #查询客户经理
|
|
|
|
+ (SELECT name FROM user WHERE id = assets.client_manager_id) AS clientManagerName,
|
|
|
|
+ #查询项目负责人
|
|
|
|
+ (SELECT name FROM user WHERE id = assets.principal_id) AS principalName,
|
|
|
|
+ #查询业务来源(即子级客户)
|
|
|
|
+ (SELECT customer_company.name
|
|
|
|
+ FROM customer_company
|
|
|
|
+ WHERE customer_company.parent_id = clientele_id) AS customerSubName
|
|
|
|
+ FROM assets,
|
|
|
|
+ assets_production AS production,
|
|
|
|
+ user,
|
|
|
|
+ customer_company AS customer,
|
|
|
|
+ assets_evaluation_target AS target,
|
|
|
|
+ order_fund AS fund,
|
|
|
|
+ production_fund AS pFund,
|
|
|
|
+ finance_invoice AS invoice,
|
|
|
|
+ #查询当前进行的节点信息
|
|
|
|
+ (SELECT nodeInstance.id AS currentNodeId,
|
|
|
|
+ user.name AS handlerName,
|
|
|
|
+ node.name AS currentNodeName,
|
|
|
|
+ node.code AS currentNodeCode,
|
|
|
|
+ nodeInstance.business_id AS businessId
|
|
|
|
+ FROM work_flow_node_instance AS nodeInstance,
|
|
|
|
+ work_task_record AS record,
|
|
|
|
+ user,
|
|
|
|
+ work_node AS node
|
|
|
|
+ WHERE state = 'PENDING'
|
|
|
|
+ AND nodeInstance.node_id = node.id
|
|
|
|
+ AND record.handler_id = user.id
|
|
|
|
+ AND nodeInstance.deleted = 0
|
|
|
|
+ AND record.instance_id = nodeInstance.id
|
|
|
|
+ ) AS nodeInfo
|
|
|
|
+ WHERE assets.deleted = 0
|
|
|
|
+ AND nodeInfo.businessId = assets.id
|
|
|
|
+ AND production.business_id = assets.id
|
|
|
|
+ AND user.id = assets.principal_id
|
|
|
|
+ AND customer.id = assets.clientele_id
|
|
|
|
+ AND target.assets_id = assets.id
|
|
|
|
+ AND fund.business_id = assets.id
|
|
|
|
+ AND pFund.business_id = assets.id
|
|
|
|
+ AND pFund.order_fund_id = fund.id
|
|
|
|
+ AND invoice.order_fund_id = fund.id
|
|
|
|
+ #送达状态查询
|
|
|
|
+ <if test="assetsSelectDTO != null and assetsSelectDTO.delivery != null">
|
|
|
|
+ AND production.delivery = #{assetsSelectDTO.delivery}
|
|
|
|
+ </if>
|
|
|
|
+ #项目负责人查询
|
|
|
|
+ <if test="assetsSelectDTO != null and assetsSelectDTO.principalId != null">
|
|
|
|
+ AND assets.principal_id = #{assetsSelectDTO.principalId}
|
|
|
|
+ </if>
|
|
|
|
+ #关键字模糊查询
|
|
|
|
+ <if test="assetsSelectDTO != null and assetsSelectDTO.keyWord != null and assetsSelectDTO.keyWord != '' ">
|
|
|
|
+ AND (
|
|
|
|
+ assets.order_id LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
|
|
|
|
+ assets.name LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
|
|
|
|
+ production.production_no LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%') OR
|
|
|
|
+ customer.name LIKE CONCAT('%',#{assetsSelectDTO.keyWord},'%')
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY assets.created DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|