|
|
|
@ -94,7 +94,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getMobileCustomerVOList" resultMap="customerMobileMap">
|
|
|
|
|
<select id="getMobileCustomerVOList" >
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
@ -195,16 +195,7 @@
|
|
|
|
|
) aaa
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<resultMap id="customerMobileMap" type="jnpf.customer.model.customer.CustomerMobileListVo">
|
|
|
|
|
<result property="invoiceNum" column="invoiceNum"/>
|
|
|
|
|
<result property="noInvoiceNum" column="noInvoiceNum"/>
|
|
|
|
|
<result property="fundNum" column="fundNum"/>
|
|
|
|
|
<result property="noFundNum" column="noFundNum"/>
|
|
|
|
|
<result property="noPayCollectionNum" column="noPayCollectionNum"/>
|
|
|
|
|
<result property="profit" column="profit"/>
|
|
|
|
|
<result property="profit" column="profit"/>
|
|
|
|
|
<collection property="customerMobileVOS" select="jnpf.customer.mapper.CustomerVMapper.getCustomerMobileVOList" fetchType="eager" column="{page=#{page},ew=#{ew}"></collection>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getCustomerMobileVOList" resultMap="getCustomerMobileVOMap" >
|
|
|
|
|
SELECT
|
|
|
|
@ -350,4 +341,255 @@
|
|
|
|
|
<result property="amountSum" column="amountSum"/>
|
|
|
|
|
<result property="profit" column="profit"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getMoblieDataDD" resultMap="getMobiieMap">
|
|
|
|
|
SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
a.*,
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL( SUM( b.settlement ), 0 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist b
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = b.customer_id
|
|
|
|
|
AND b.is_expense = '1'
|
|
|
|
|
AND b.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
b.sales_status != '99'
|
|
|
|
|
OR ISNULL( b.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
b.sales_status != '0'
|
|
|
|
|
OR ISNULL( b.sales_status ))
|
|
|
|
|
AND b.delete_mark = '0'
|
|
|
|
|
) invoiceNum,
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL( SUM( c.settlement ), 0 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist c
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = c.customer_id
|
|
|
|
|
AND c.is_expense = '0'
|
|
|
|
|
AND c.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
c.sales_status != '99'
|
|
|
|
|
OR ISNULL( c.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
c.sales_status != '0'
|
|
|
|
|
OR ISNULL( c.sales_status ))
|
|
|
|
|
AND c.delete_mark = '0'
|
|
|
|
|
) noInvoiceNum,
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( IFNULL( SUM( d.sales_price * d.settlement ), 0 ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist d
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = d.customer_id
|
|
|
|
|
AND d.advance = '1'
|
|
|
|
|
AND d.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
d.sales_status != '99'
|
|
|
|
|
OR ISNULL( d.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
d.sales_status != '0'
|
|
|
|
|
OR ISNULL( d.sales_status ))
|
|
|
|
|
AND d.delete_mark = '0'
|
|
|
|
|
) fundNum,
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( IFNULL( SUM( e.sales_price * e.settlement ), 0 ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist e
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = e.customer_id
|
|
|
|
|
AND e.advance = '0'
|
|
|
|
|
AND e.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
e.sales_status != '99'
|
|
|
|
|
OR ISNULL( e.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
e.sales_status != '0'
|
|
|
|
|
OR ISNULL( e.sales_status ))
|
|
|
|
|
AND e.delete_mark = '0'
|
|
|
|
|
) noFundNum,
|
|
|
|
|
@pDataA :=(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( IFNULL( SUM( f.sales_price * f.settlement ), 0 ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist f
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = f.customer_id
|
|
|
|
|
AND f.is_collection = '1'
|
|
|
|
|
AND f.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
f.sales_status != '99'
|
|
|
|
|
OR ISNULL( f.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
f.sales_status != '0'
|
|
|
|
|
OR ISNULL( f.sales_status ))
|
|
|
|
|
AND f.delete_mark = '0'
|
|
|
|
|
) payCollectionNum,
|
|
|
|
|
@pDataB :=(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( IFNULL( SUM( g.sales_price * g.settlement ), 0 ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist g
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = g.customer_id
|
|
|
|
|
AND g.is_collection = '0'
|
|
|
|
|
AND g.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
g.sales_status != '99'
|
|
|
|
|
OR ISNULL( g.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
g.sales_status != '0'
|
|
|
|
|
OR ISNULL( g.sales_status ))
|
|
|
|
|
AND g.delete_mark = '0'
|
|
|
|
|
) noPayCollectionNum,
|
|
|
|
|
ROUND( @pDataA + @pDataB, 6 ) amountSum,
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( IFNULL( SUM(( h.sales_price - h.purchase_price )* h.settlement ), 0 ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist h
|
|
|
|
|
WHERE
|
|
|
|
|
a.id = h.customer_id
|
|
|
|
|
AND h.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
h.sales_status != '99'
|
|
|
|
|
OR ISNULL( h.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
h.sales_status != '0'
|
|
|
|
|
OR ISNULL( h.sales_status ))
|
|
|
|
|
AND h.delete_mark = '0'
|
|
|
|
|
) profit
|
|
|
|
|
FROM
|
|
|
|
|
jg_customer a
|
|
|
|
|
WHERE
|
|
|
|
|
a.delete_mark = '0'
|
|
|
|
|
) aaa,
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
(
|
|
|
|
|
SELECT
|
|
|
|
|
SUM( a.settlement )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist a
|
|
|
|
|
WHERE
|
|
|
|
|
a.is_expense = '1'
|
|
|
|
|
AND a.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '99'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '0'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
|
) invoiceNumM,(
|
|
|
|
|
SELECT
|
|
|
|
|
SUM( a.settlement )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist a
|
|
|
|
|
WHERE
|
|
|
|
|
a.is_expense = '0'
|
|
|
|
|
AND a.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '99'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '0'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
|
) noInvoiceNumM,(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( SUM( a.sales_price * a.settlement ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist a
|
|
|
|
|
WHERE
|
|
|
|
|
a.advance = '1'
|
|
|
|
|
AND a.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '99'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '0'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
|
) fundNumM,(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( SUM( a.sales_price * a.settlement ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist a
|
|
|
|
|
WHERE
|
|
|
|
|
a.advance = '0'
|
|
|
|
|
AND a.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '99'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '0'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
|
) noFundNumM,(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( SUM( a.sales_price * a.settlement ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist a
|
|
|
|
|
WHERE
|
|
|
|
|
a.is_collection = '0'
|
|
|
|
|
AND a.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '99'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '0'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
|
) noPayCollectionNumM,(
|
|
|
|
|
SELECT
|
|
|
|
|
ROUND( SUM(( a.sales_price - a.purchase_price )* a.settlement ), 6 )
|
|
|
|
|
FROM
|
|
|
|
|
jg_poundlist a
|
|
|
|
|
WHERE
|
|
|
|
|
a.pound_status = '0'
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '99'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND (
|
|
|
|
|
a.sales_status != '0'
|
|
|
|
|
OR ISNULL( a.sales_status ))
|
|
|
|
|
AND a.delete_mark = '0'
|
|
|
|
|
) profitM
|
|
|
|
|
FROM
|
|
|
|
|
DUAL
|
|
|
|
|
) bbb ${ew.customSqlSegment}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<resultMap id="getMobiieMap" type="jnpf.customer.model.customer.CustomerMobileListVo">
|
|
|
|
|
<result property="invoiceNum" column="invoiceNumM"/>
|
|
|
|
|
<result property="noInvoiceNum" column="noInvoiceNumM"/>
|
|
|
|
|
<result property="fundNum" column="fundNumM"/>
|
|
|
|
|
<result property="noFundNum" column="noFundNumM"/>
|
|
|
|
|
<result property="noPayCollectionNum" column="noPayCollectionNumM"/>
|
|
|
|
|
<result property="profit" column="profitM"/>
|
|
|
|
|
<collection property="customerMobileVOSList" ofType="jnpf.customer.model.customer.CustomerMobileVO" javaType="list">
|
|
|
|
|
<result property="supplierNm" column="supplier_nm"/>
|
|
|
|
|
<result property="invoiceNum" column="invoiceNum"/>
|
|
|
|
|
<result property="noInvoiceNum" column="noInvoiceNum"/>
|
|
|
|
|
<result property="fundNum" column="fundNum"/>
|
|
|
|
|
<result property="noFundNum" column="noFundNum"/>
|
|
|
|
|
<result property="payCollectionNum" column="payCollectionNum"/>
|
|
|
|
|
<result property="noPayCollectionNum" column="noPayCollectionNum"/>
|
|
|
|
|
<result property="amountSum" column="amountSum"/>
|
|
|
|
|
<result property="profit" column="profit"/>
|
|
|
|
|
</collection>
|
|
|
|
|
</resultMap>
|
|
|
|
|
</mapper>
|
|
|
|
|