|
@@ -6,18 +6,21 @@
|
|
|
SELECT t1.id,
|
|
|
t1.contract_id,
|
|
|
t1.product_id,
|
|
|
- t2.`code` AS contractCode,
|
|
|
- t2.user_name AS userName,
|
|
|
- t2.version AS contractVersion,
|
|
|
- t1.expend_quantity AS expendQuantity,
|
|
|
+ t2.`code` AS contractCode,
|
|
|
+ t2.user_name AS userName,
|
|
|
+ t2.create_user AS salesmanId,
|
|
|
+ t2.version AS contractVersion,
|
|
|
+ t1.expend_quantity AS expendQuantity,
|
|
|
(SELECT create_time
|
|
|
FROM claim_contract
|
|
|
WHERE contract_id = t2.id
|
|
|
ORDER BY create_time DESC
|
|
|
- LIMIT 1) AS claimTime,
|
|
|
- t2.contract_template_id AS contractTemplateId
|
|
|
+ LIMIT 1) AS claimTime,
|
|
|
+ t2.contract_template_id AS contractTemplateId,
|
|
|
+ t1.quantity
|
|
|
FROM contract_product t1
|
|
|
- LEFT JOIN contract t2 ON t1.contract_id = t2.id
|
|
|
+ LEFT JOIN contract t2
|
|
|
+ ON t1.contract_id = t2.id
|
|
|
${ew.customSqlSegment}
|
|
|
</select>
|
|
|
|