|
@@ -13,27 +13,30 @@
|
|
|
ELSE 10
|
|
|
END AS refundStatusNew
|
|
|
FROM (SELECT t1.*,
|
|
|
+ us.nick_name salesmanName,
|
|
|
(SELECT IFNULL(SUM(IFNULL(cc.money_cny, IFNULL(cc.money, 0) * IFNULL(arw.rate, 1))), 0)
|
|
|
FROM claim_contract cc
|
|
|
left join claim c on cc.claim_id = c.id
|
|
|
LEFT JOIN bytesailing_account.account_running_water arw on c.business_id = arw.id
|
|
|
WHERE cc.contract_id = t1.id) AS sumClaimMoney
|
|
|
- FROM sample t1) t1) t1
|
|
|
+ FROM sample t1
|
|
|
+ left join bytesailing_customer.customer c on t1.buy_corporation_id = c.id
|
|
|
+ left join bytesailing_base.sys_user us on c.user_id = us.user_id) t1) t1
|
|
|
${ew.customSqlSegment}
|
|
|
</select>
|
|
|
|
|
|
<select id="sampleHandoverList" resultType="com.fjhx.sale.entity.contract.vo.ContractProductVo">
|
|
|
SELECT
|
|
|
- t1.quantity,
|
|
|
- t1.create_time AS ct,
|
|
|
- t1.id,
|
|
|
- t1.sample_id sampleId,
|
|
|
- t1.product_id,
|
|
|
- t2.`code` AS `contractCode`,
|
|
|
- t2.user_name AS userName,
|
|
|
- t2.versions AS contractVersion,
|
|
|
- t2.buy_corporation_id buyCorporationId,
|
|
|
- <!-- 需要采购的合同数量-->
|
|
|
+ t1.quantity,
|
|
|
+ t1.create_time AS ct,
|
|
|
+ t1.id,
|
|
|
+ t1.sample_id sampleId,
|
|
|
+ t1.product_id,
|
|
|
+ t2.`code` AS `contractCode`,
|
|
|
+ us.nick_name AS userName,
|
|
|
+ t2.versions AS contractVersion,
|
|
|
+ t2.buy_corporation_id buyCorporationId,
|
|
|
+ <!-- 需要采购的合同数量-->
|
|
|
t1.expend_quantity AS expendQuantity,
|
|
|
<!-- 交接单时间-->
|
|
|
t3.sampleTime,
|
|
@@ -45,8 +48,11 @@
|
|
|
sample_product t1
|
|
|
LEFT JOIN sample t2 ON t1.sample_id = t2.id
|
|
|
<!-- 列表中只显示存在交接单的数据 获取到交接单时间最单的一条-->
|
|
|
- left join(SELECT business_id,create_time sampleTime from bytesailing_base.file_info GROUP BY business_id HAVING MAX(create_time)) t3 on
|
|
|
- t2.id = t3.business_id
|
|
|
+ left join(SELECT business_id,create_time sampleTime from bytesailing_base.file_info GROUP BY business_id HAVING
|
|
|
+ MAX(create_time)) t3 on
|
|
|
+ t2.id = t3.business_id
|
|
|
+ left join bytesailing_customer.customer c on t2.buy_corporation_id = c.id
|
|
|
+ left join bytesailing_base.sys_user us on c.user_id = us.user_id
|
|
|
${ew.customSqlSegment}
|
|
|
</select>
|
|
|
<update id="updateSample" parameterType="com.fjhx.sale.entity.sample.po.Sample">
|