# 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
bawei 2 years ago
parent f1836cd407
commit 9b59f40b8e

@ -24,29 +24,17 @@ public class PoundlistSEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private String creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private String lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private String deleteTime;
@ -159,17 +147,7 @@ public class PoundlistSEntity {
@TableField("POUNDLIST_NO")
private String poundlistNo;
@TableField(exist = false)
private String vehicleId;
@TableField(exist = false)
private String isExamine;
@TableField(exist = false)
private String isInvoicing;
@TableField(exist = false)
private String isPay;
@TableField(exist = false)
private String isCollection;
@ -234,4 +212,10 @@ public class PoundlistSEntity {
@TableField(exist = false)
private String supplierNm;
@TableField(exist = false)
private String itemName;
@TableField(exist = false)
private String contractName;
}

@ -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…
Cancel
Save