|
@@ -2882,9 +2882,17 @@
|
|
|
FROM
|
|
FROM
|
|
|
`ins_fee_audit` ifa
|
|
`ins_fee_audit` ifa
|
|
|
LEFT JOIN ins_area_company iac ON iac.id = ifa.ins_order_no
|
|
LEFT JOIN ins_area_company iac ON iac.id = ifa.ins_order_no
|
|
|
- WHERE
|
|
|
|
|
|
|
+ <where>
|
|
|
ifa.auditstatus = '1'
|
|
ifa.auditstatus = '1'
|
|
|
- AND iac.signing_time IS NOT NULL
|
|
|
|
|
|
|
+ AND iac.signing_time IS NOT NULL
|
|
|
|
|
+ <if test="vo.year !=null and vo.year !=''">
|
|
|
|
|
+ and DATE_FORMAT( iac.signing_time, '%Y') =#{vo.year}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.days !=null and vo.days !='' ">
|
|
|
|
|
+ and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
DATE_FORMAT( iac.signing_time, '%Y-%m' )
|
|
DATE_FORMAT( iac.signing_time, '%Y-%m' )
|
|
|
) a
|
|
) a
|
|
@@ -2894,6 +2902,9 @@
|
|
|
DATE_FORMAT( ipi.signdate, '%Y-%m' ) AS "signingTime"
|
|
DATE_FORMAT( ipi.signdate, '%Y-%m' ) AS "signingTime"
|
|
|
FROM
|
|
FROM
|
|
|
ins_ply_income ipi
|
|
ins_ply_income ipi
|
|
|
|
|
+ <where>
|
|
|
|
|
+ 1=1
|
|
|
|
|
+ </where>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
DATE_FORMAT( ipi.signdate, '%Y-%m' )
|
|
DATE_FORMAT( ipi.signdate, '%Y-%m' )
|
|
|
) b ON a.signingTime = b.signingTime
|
|
) b ON a.signingTime = b.signingTime
|
|
@@ -2903,7 +2914,9 @@
|
|
|
from sys_amount_auditing a
|
|
from sys_amount_auditing a
|
|
|
left join sys_user_account_history b on a.id = b.auditiing_id
|
|
left join sys_user_account_history b on a.id = b.auditiing_id
|
|
|
left join sys_user su on su.id =a.user_id
|
|
left join sys_user su on su.id =a.user_id
|
|
|
- where a.auditing_status= '3'
|
|
|
|
|
|
|
+ <where>
|
|
|
|
|
+ a.auditing_status= '3'
|
|
|
|
|
+ </where>
|
|
|
GROUP BY DATE_FORMAT( a.auditing_time, '%Y-%m' )
|
|
GROUP BY DATE_FORMAT( a.auditing_time, '%Y-%m' )
|
|
|
) c on c.auditingTime =a.signingTime
|
|
) c on c.auditingTime =a.signingTime
|
|
|
left join (
|
|
left join (
|
|
@@ -2917,10 +2930,11 @@
|
|
|
LEFT JOIN ins_fee_audit ifa ON ifo.ins_order_no = ifa.ins_order_no
|
|
LEFT JOIN ins_fee_audit ifa ON ifo.ins_order_no = ifa.ins_order_no
|
|
|
LEFT JOIN ins_area_company iac ON ifa.ins_order_no = iac.id
|
|
LEFT JOIN ins_area_company iac ON ifa.ins_order_no = iac.id
|
|
|
LEFT JOIN ins_orders io ON iac.orderno = io.orderno
|
|
LEFT JOIN ins_orders io ON iac.orderno = io.orderno
|
|
|
- WHERE
|
|
|
|
|
|
|
+ <where>
|
|
|
ifa.auditstatus = '1'
|
|
ifa.auditstatus = '1'
|
|
|
- AND iac.orderstatus = '3'
|
|
|
|
|
- AND io.orderstatus = '3'
|
|
|
|
|
|
|
+ AND iac.orderstatus = '3'
|
|
|
|
|
+ AND io.orderstatus = '3'
|
|
|
|
|
+ </where>
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
DATE_FORMAT( iac.signing_time, '%Y-%m' )
|
|
DATE_FORMAT( iac.signing_time, '%Y-%m' )
|
|
|
) d on d.signingTime =a.signingTime
|
|
) d on d.signingTime =a.signingTime
|
|
@@ -2936,20 +2950,22 @@
|
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
|
where b.category is not null
|
|
where b.category is not null
|
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
|
- WHERE
|
|
|
|
|
|
|
+ <where>
|
|
|
a.out_card_num IN (
|
|
a.out_card_num IN (
|
|
|
- SELECT
|
|
|
|
|
- bank_card_num
|
|
|
|
|
- FROM
|
|
|
|
|
- inv_account_card iac
|
|
|
|
|
- LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
- WHERE
|
|
|
|
|
- ia.del_flag = '0'
|
|
|
|
|
- AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ bank_card_num
|
|
|
|
|
+ FROM
|
|
|
|
|
+ inv_account_card iac
|
|
|
|
|
+ LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ ia.del_flag = '0'
|
|
|
|
|
+ AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
)
|
|
)
|
|
|
- AND a.revenue_outlay = '1'
|
|
|
|
|
- AND a.del_flag = '0'
|
|
|
|
|
- AND b.expenditureDetails = '1'
|
|
|
|
|
|
|
+ AND a.revenue_outlay = '1'
|
|
|
|
|
+ AND a.del_flag = '0'
|
|
|
|
|
+ AND b.expenditureDetails = '1'
|
|
|
|
|
+ </where>
|
|
|
|
|
+
|
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
|
) e on e.createTime =a.signingTime
|
|
) e on e.createTime =a.signingTime
|
|
|
left join (
|
|
left join (
|
|
@@ -2964,20 +2980,21 @@
|
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
|
where b.category is not null
|
|
where b.category is not null
|
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
|
- WHERE
|
|
|
|
|
|
|
+ <where>
|
|
|
a.out_card_num IN (
|
|
a.out_card_num IN (
|
|
|
- SELECT
|
|
|
|
|
- bank_card_num
|
|
|
|
|
- FROM
|
|
|
|
|
- inv_account_card iac
|
|
|
|
|
- LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
- WHERE
|
|
|
|
|
- ia.del_flag = '0'
|
|
|
|
|
- AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ bank_card_num
|
|
|
|
|
+ FROM
|
|
|
|
|
+ inv_account_card iac
|
|
|
|
|
+ LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ ia.del_flag = '0'
|
|
|
|
|
+ AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
)
|
|
)
|
|
|
- AND a.revenue_outlay = '1'
|
|
|
|
|
- AND a.del_flag = '0'
|
|
|
|
|
- AND b.expenditureDetails = '2'
|
|
|
|
|
|
|
+ AND a.revenue_outlay = '1'
|
|
|
|
|
+ AND a.del_flag = '0'
|
|
|
|
|
+ AND b.expenditureDetails = '2'
|
|
|
|
|
+ </where>
|
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
|
) f on f.createTime =a.signingTime
|
|
) f on f.createTime =a.signingTime
|
|
|
left join (
|
|
left join (
|
|
@@ -2992,20 +3009,21 @@
|
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
|
where b.category is not null
|
|
where b.category is not null
|
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
|
- WHERE
|
|
|
|
|
|
|
+ <where>
|
|
|
a.out_card_num IN (
|
|
a.out_card_num IN (
|
|
|
- SELECT
|
|
|
|
|
- bank_card_num
|
|
|
|
|
- FROM
|
|
|
|
|
- inv_account_card iac
|
|
|
|
|
- LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
- WHERE
|
|
|
|
|
- ia.del_flag = '0'
|
|
|
|
|
- AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ bank_card_num
|
|
|
|
|
+ FROM
|
|
|
|
|
+ inv_account_card iac
|
|
|
|
|
+ LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ ia.del_flag = '0'
|
|
|
|
|
+ AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
)
|
|
)
|
|
|
- AND a.revenue_outlay = '1'
|
|
|
|
|
- AND a.del_flag = '0'
|
|
|
|
|
- AND b.expenditureDetails = '3'
|
|
|
|
|
|
|
+ AND a.revenue_outlay = '1'
|
|
|
|
|
+ AND a.del_flag = '0'
|
|
|
|
|
+ AND b.expenditureDetails = '3'
|
|
|
|
|
+ </where>
|
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
|
) j on j.createTime =a.signingTime
|
|
) j on j.createTime =a.signingTime
|
|
|
left join (
|
|
left join (
|
|
@@ -3020,20 +3038,21 @@
|
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
left join inv_account_expenses b on a.parent_id =b.expenses_id
|
|
|
where b.category is not null
|
|
where b.category is not null
|
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
) b on a.fund_use = b.bCategory and a.fund_fen = b.aCategory
|
|
|
- WHERE
|
|
|
|
|
|
|
+ <where>
|
|
|
a.out_card_num IN (
|
|
a.out_card_num IN (
|
|
|
- SELECT
|
|
|
|
|
- bank_card_num
|
|
|
|
|
- FROM
|
|
|
|
|
- inv_account_card iac
|
|
|
|
|
- LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
- WHERE
|
|
|
|
|
- ia.del_flag = '0'
|
|
|
|
|
- AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ bank_card_num
|
|
|
|
|
+ FROM
|
|
|
|
|
+ inv_account_card iac
|
|
|
|
|
+ LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ ia.del_flag = '0'
|
|
|
|
|
+ AND ia.outer_flag LIKE concat( '%', '0', '%' )
|
|
|
)
|
|
)
|
|
|
- AND a.revenue_outlay = '1'
|
|
|
|
|
- AND a.del_flag = '0'
|
|
|
|
|
- AND b.expenditureDetails = '4'
|
|
|
|
|
|
|
+ AND a.revenue_outlay = '1'
|
|
|
|
|
+ AND a.del_flag = '0'
|
|
|
|
|
+ AND b.expenditureDetails = '4'
|
|
|
|
|
+ </where>
|
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' ) , b.expenditureDetails
|
|
|
) g on g.createTime =a.signingTime
|
|
) g on g.createTime =a.signingTime
|
|
|
|
|
|