|
@@ -511,7 +511,7 @@
|
|
FROM
|
|
FROM
|
|
post
|
|
post
|
|
WHERE
|
|
WHERE
|
|
- id IN ( SELECT post_id FROM user_post WHERE user_id = m.client_manager_id ))) AS marketDepartmentName,
|
|
|
|
|
|
+ id IN ( SELECT post_id FROM user_post WHERE user_id = m.client_manager_id and deleted = 0 ))) AS marketDepartmentName,
|
|
frf.pay_datetime
|
|
frf.pay_datetime
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
@@ -1752,6 +1752,7 @@
|
|
<result property="id" column="id" />
|
|
<result property="id" column="id" />
|
|
<result property="claimAmount" column="claim_amount" />
|
|
<result property="claimAmount" column="claim_amount" />
|
|
<result property="orderId" column="order_id" />
|
|
<result property="orderId" column="order_id" />
|
|
|
|
+ <result property="projectName" column="name" />
|
|
<result property="productionNo" column="production_no" />
|
|
<result property="productionNo" column="production_no" />
|
|
<result property="claimDate" column="claimDate" />
|
|
<result property="claimDate" column="claimDate" />
|
|
<result property="saveFileDate" column="save_file_date" />
|
|
<result property="saveFileDate" column="save_file_date" />
|
|
@@ -1767,6 +1768,7 @@
|
|
<result property="evaluateDepartmentName" column="evaluateDepartmentName" />
|
|
<result property="evaluateDepartmentName" column="evaluateDepartmentName" />
|
|
<result property="marketDepartmentName" column="marketDepartmentName" />
|
|
<result property="marketDepartmentName" column="marketDepartmentName" />
|
|
<result property="payDateTime" column="pay_datetime" />
|
|
<result property="payDateTime" column="pay_datetime" />
|
|
|
|
+ <result property="members" column="members" />
|
|
<collection property="invoices" ofType="com.dayou.vo.SettleProInvoiceVo">
|
|
<collection property="invoices" ofType="com.dayou.vo.SettleProInvoiceVo">
|
|
<result property="invoiceDate" column="invoiceDate" />
|
|
<result property="invoiceDate" column="invoiceDate" />
|
|
<result property="invoiceUser" column="invoiceUser" />
|
|
<result property="invoiceUser" column="invoiceUser" />
|
|
@@ -1781,22 +1783,24 @@
|
|
fc.claim_amount,
|
|
fc.claim_amount,
|
|
a.order_id,
|
|
a.order_id,
|
|
ap.production_no,
|
|
ap.production_no,
|
|
- fc.claim_datetime as claimDate,
|
|
|
|
|
|
+ fc.claim_datetime AS claimDate,
|
|
ap.delivery_date AS deliveryDate,
|
|
ap.delivery_date AS deliveryDate,
|
|
ap.save_file_date,
|
|
ap.save_file_date,
|
|
IF
|
|
IF
|
|
( fc.claim_datetime > ap.delivery_date, fc.claim_datetime, ap.delivery_date ) AS settleDate,
|
|
( fc.claim_datetime > ap.delivery_date, fc.claim_datetime, ap.delivery_date ) AS settleDate,
|
|
ap.assets_name AS projectName,
|
|
ap.assets_name AS projectName,
|
|
a.bailor,
|
|
a.bailor,
|
|
|
|
+ a.name,
|
|
|
|
+ a.members,
|
|
ap.evaluate_amount,
|
|
ap.evaluate_amount,
|
|
- u.name AS principal,
|
|
|
|
- u1.name AS clientManager,
|
|
|
|
- cc.name AS clientName,
|
|
|
|
- cc1.name AS clientSubName,
|
|
|
|
- d.name AS evaluateDepartmentName,
|
|
|
|
|
|
+ u.NAME AS principal,
|
|
|
|
+ u1.NAME AS clientManager,
|
|
|
|
+ cc.NAME AS clientName,
|
|
|
|
+ cc1.NAME AS clientSubName,
|
|
|
|
+ d.NAME AS evaluateDepartmentName,
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- GROUP_CONCAT( department.name )
|
|
|
|
|
|
+ GROUP_CONCAT( department.NAME )
|
|
FROM
|
|
FROM
|
|
department
|
|
department
|
|
WHERE
|
|
WHERE
|
|
@@ -1807,14 +1811,14 @@
|
|
post
|
|
post
|
|
WHERE
|
|
WHERE
|
|
id IN ( SELECT post_id FROM user_post WHERE user_id = a.client_manager_id ))) AS marketDepartmentName,
|
|
id IN ( SELECT post_id FROM user_post WHERE user_id = a.client_manager_id ))) AS marketDepartmentName,
|
|
- invoice.name AS invoiceUser,
|
|
|
|
|
|
+ invoice.NAME AS invoiceUser,
|
|
invoice.real_make_date AS invoiceDate,
|
|
invoice.real_make_date AS invoiceDate,
|
|
invoice.tax_no AS invoiceNo,
|
|
invoice.tax_no AS invoiceNo,
|
|
frf.pay_datetime
|
|
frf.pay_datetime
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- id,
|
|
|
|
|
|
+ id,
|
|
claim_amount,
|
|
claim_amount,
|
|
order_fund_id,
|
|
order_fund_id,
|
|
production_fund_id,
|
|
production_fund_id,
|
|
@@ -1825,12 +1829,6 @@
|
|
WHERE
|
|
WHERE
|
|
deleted = 0
|
|
deleted = 0
|
|
AND production_fund_id IS NOT NULL
|
|
AND production_fund_id IS NOT NULL
|
|
- AND claim_datetime >= #{settleVO.startDate}
|
|
|
|
- AND claim_datetime <= #{settleVO.endDate} UNION ALL
|
|
|
|
- SELECT id,allot_amount AS claim_amount, order_fund_id, production_fund_id, created AS claim_datetime,real_fund_id FROM
|
|
|
|
- order_fund_allot WHERE deleted = 0
|
|
|
|
- AND created >= #{settleVO.startDate}
|
|
|
|
- AND created <= #{settleVO.endDate}
|
|
|
|
) fc
|
|
) fc
|
|
inner join (
|
|
inner join (
|
|
select id,pay_datetime from finance_real_fund
|
|
select id,pay_datetime from finance_real_fund
|
|
@@ -1859,9 +1857,11 @@
|
|
FROM finance_invoice, user
|
|
FROM finance_invoice, user
|
|
WHERE maker_id = user.id
|
|
WHERE maker_id = user.id
|
|
AND finance_invoice.deleted = 0
|
|
AND finance_invoice.deleted = 0
|
|
- AND state = '已开票'
|
|
|
|
|
|
+ AND state = '已开票' order by user.created desc limit 1
|
|
) AS invoice ON IF(invoice.production_fund_id IS NOT NULL ,invoice.order_fund_id = pf.order_fund_id AND invoice.production_fund_id = pf.id,invoice.order_fund_id = pf.order_fund_id)
|
|
) AS invoice ON IF(invoice.production_fund_id IS NOT NULL ,invoice.order_fund_id = pf.order_fund_id AND invoice.production_fund_id = pf.id,invoice.order_fund_id = pf.order_fund_id)
|
|
<where>
|
|
<where>
|
|
|
|
+ IF( fc.claim_datetime > ap.delivery_date, fc.claim_datetime, ap.delivery_date ) >= #{settleVO.startDate}
|
|
|
|
+ AND IF( fc.claim_datetime > ap.delivery_date, fc.claim_datetime, ap.delivery_date ) <= #{settleVO.endDate}
|
|
<if test="keyword!=null and keyword!='' ">
|
|
<if test="keyword!=null and keyword!='' ">
|
|
and (
|
|
and (
|
|
a.order_id = #{keyword}
|
|
a.order_id = #{keyword}
|
|
@@ -1896,6 +1896,7 @@
|
|
IF( fc.claim_datetime > ap.save_file_date, fc.claim_datetime, ap.save_file_date ) AS settleDate,
|
|
IF( fc.claim_datetime > ap.save_file_date, fc.claim_datetime, ap.save_file_date ) AS settleDate,
|
|
IF(ap.assets_name IS NOT NULL, ap.assets_name, a.name ) AS projectName,
|
|
IF(ap.assets_name IS NOT NULL, ap.assets_name, a.name ) AS projectName,
|
|
a.bailor,
|
|
a.bailor,
|
|
|
|
+ a.members,
|
|
ap.evaluate_amount,
|
|
ap.evaluate_amount,
|
|
u.name AS principal,
|
|
u.name AS principal,
|
|
u1.name AS clientManager,
|
|
u1.name AS clientManager,
|
|
@@ -1933,11 +1934,7 @@
|
|
WHERE
|
|
WHERE
|
|
deleted = 0
|
|
deleted = 0
|
|
AND production_fund_id IS NOT NULL
|
|
AND production_fund_id IS NOT NULL
|
|
- AND claim_datetime >= #{settleVO.startDate}
|
|
|
|
- AND claim_datetime <= #{settleVO.endDate} UNION ALL
|
|
|
|
- SELECT id, allot_amount AS claim_amount, order_fund_id, production_fund_id, created AS claim_datetime ,real_fund_id FROM order_fund_allot WHERE deleted = 0
|
|
|
|
- AND created >= #{settleVO.startDate}
|
|
|
|
- AND created <= #{settleVO.endDate}
|
|
|
|
|
|
+
|
|
) fc
|
|
) fc
|
|
|
|
|
|
inner join (
|
|
inner join (
|
|
@@ -1963,9 +1960,11 @@
|
|
FROM finance_invoice, user
|
|
FROM finance_invoice, user
|
|
WHERE maker_id = user.id
|
|
WHERE maker_id = user.id
|
|
AND finance_invoice.deleted = 0
|
|
AND finance_invoice.deleted = 0
|
|
- AND state = '已开票'
|
|
|
|
|
|
+ AND state = '已开票' order by user.created desc limit 1
|
|
) AS invoice ON IF(invoice.production_fund_id IS NOT NULL ,invoice.order_fund_id = pf.order_fund_id AND invoice.production_fund_id = pf.id,invoice.order_fund_id = pf.order_fund_id)
|
|
) AS invoice ON IF(invoice.production_fund_id IS NOT NULL ,invoice.order_fund_id = pf.order_fund_id AND invoice.production_fund_id = pf.id,invoice.order_fund_id = pf.order_fund_id)
|
|
<where>
|
|
<where>
|
|
|
|
+ AND IF( fc.claim_datetime > ap.save_file_date, fc.claim_datetime, ap.save_file_date ) >= #{settleVO.startDate}
|
|
|
|
+ AND IF( fc.claim_datetime > ap.save_file_date, fc.claim_datetime, ap.save_file_date ) <= #{settleVO.endDate}
|
|
<if test="keyword!=null and keyword!='' ">
|
|
<if test="keyword!=null and keyword!='' ">
|
|
and (
|
|
and (
|
|
a.order_id = #{keyword}
|
|
a.order_id = #{keyword}
|