Merge branch 'main' of http://222.71.165.188:3000/linkage/SC-MOM
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.product
parent
f1836cd407
commit
9b59f40b8e
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.poundlist.mapper.PoundlistMapper">
|
||||
|
||||
<select id="qureylist" resultType="jnpf.poundlist.entity.PoundlistSEntity">
|
||||
SELECT
|
||||
a.id,
|
||||
supplier_nm AS supplierNm,
|
||||
item_name AS itemName,
|
||||
d.contract_name AS contractName,
|
||||
settlement AS settlement, -- 出库数量
|
||||
purchase_price AS purchasePrice,
|
||||
e.rate AS rate,
|
||||
purchase_price * (1-( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )) AS noPurchasePrice, -- 采购单价
|
||||
sales_price * (1-( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )) AS noSalesPrice, -- 销售单价
|
||||
not_price AS notPrice, -- 不含税销售金额
|
||||
purchase_price * (1-( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )) * settlement AS settlementa, -- 销售成本
|
||||
not_price - (purchase_price * (1-( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )) * settlement) AS grossProfit, -- 账面毛利(不含税=K-L)
|
||||
'' AS Discount , -- 贴息(去除)
|
||||
not_price - (purchase_price * (1-( CASE e.rate WHEN 0 THEN 0.13 WHEN 1 THEN 0.09 WHEN 2 THEN 0.06 WHEN 3 THEN 0.05 WHEN 4 THEN 0.03 ELSE 0.00 END )) * settlement) AS settlements -- 部门毛利(不含税=M+N)
|
||||
FROM
|
||||
jg_poundlist a
|
||||
LEFT JOIN jg_customer b ON a.customer_id=b.id
|
||||
LEFT JOIN jg_material c ON a.material_id=c.id
|
||||
LEFT JOIN jg_contract d ON a.sales_id=d.id
|
||||
LEFT JOIN jg_receiptout_item0 e ON a.id=e.poundlist_id
|
||||
LEFT JOIN jg_salesorder g ON g.contract_id=d.id
|
||||
|
||||
WHERE
|
||||
a.creator_time BETWEEN #{startTime} and #{endTime}
|
||||
OR
|
||||
a.department_id =#{departmentIdS}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue