parent
b82b917c86
commit
b53ef12a14
@ -1,7 +0,0 @@
|
|||||||
<?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.purchaseback.mapper.PurchaseorderMapper">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -0,0 +1,77 @@
|
|||||||
|
<?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.purchaseorder.mapper.PurchaseorderitemMapper">
|
||||||
|
|
||||||
|
<resultMap id="purchorderItemMap" type="jnpf.mobilePort.entity.PurchaseOrderVO">
|
||||||
|
<!-- 制单人 -->
|
||||||
|
<result property="creatorUserName" column="creatorUserName"/>
|
||||||
|
<!-- 订单日期 -->
|
||||||
|
<result property="creatorTime" column="creatorTime"/>
|
||||||
|
<!-- 对方合同号-->
|
||||||
|
<result property="contractNo" column="contractNo"/>
|
||||||
|
<!-- 合同编码-->
|
||||||
|
<result property="contractCode" column="contractCode"/>
|
||||||
|
<!-- 供货 单位-->
|
||||||
|
<result property="supplierName" column="supplierName"/>
|
||||||
|
<!-- 订单号 -->
|
||||||
|
<result property="documentNo" column="documentNo"/>
|
||||||
|
<collection property="purchaseorder_item0List">
|
||||||
|
<!-- `物料名称、规格型号`-->
|
||||||
|
<result property="materialName" column="materialName"/>
|
||||||
|
<!-- 税率-->
|
||||||
|
<result property="rate" column="rate"/>
|
||||||
|
<!-- 单价-->
|
||||||
|
<result property="price" column="price"/>
|
||||||
|
<!-- 数量-->
|
||||||
|
<result property="settlement" column="settlement"/>
|
||||||
|
<!-- 单位-->
|
||||||
|
<result property="unit" column="unit"/>
|
||||||
|
<!-- 金额-->
|
||||||
|
<result property="amount" column="amount"/>
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="getPurchorderItemMap" resultMap="purchorderItemMap">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
a.*,
|
||||||
|
a.creator_user_name AS `creatorUserName`,
|
||||||
|
a.creator_time AS `creatorTime`,
|
||||||
|
a.contract_no AS `contractNo`,
|
||||||
|
a.contract_code AS `contractCode`,
|
||||||
|
a.supplier_name AS `supplierName`,
|
||||||
|
a.document_no AS `documentNo`,
|
||||||
|
b.material_name AS `materialName`,
|
||||||
|
(
|
||||||
|
CASE
|
||||||
|
b.rate
|
||||||
|
WHEN '0' THEN
|
||||||
|
13
|
||||||
|
WHEN '1' THEN
|
||||||
|
9
|
||||||
|
WHEN '2' THEN
|
||||||
|
6
|
||||||
|
WHEN '3' THEN
|
||||||
|
5
|
||||||
|
WHEN '4' THEN
|
||||||
|
3 ELSE b.unit
|
||||||
|
END
|
||||||
|
) AS `rate`,
|
||||||
|
AVG( b.price ) AS `price`,
|
||||||
|
SUM( b.settlement ) AS `settlement`,
|
||||||
|
( CASE b.unit WHEN 0 THEN '吨' ELSE '千克' END ) AS `unit`,
|
||||||
|
SUM( b.amount ) `amount`
|
||||||
|
FROM
|
||||||
|
jg_purchaseorder AS a
|
||||||
|
LEFT JOIN jg_purchaseorder_item0 AS b ON a.id = b.purchaseorder_id
|
||||||
|
LEFT JOIN jg_poundlist AS c ON b.poundlist_id = c.id
|
||||||
|
GROUP BY
|
||||||
|
b.material_name,
|
||||||
|
b.rate,
|
||||||
|
b.unit
|
||||||
|
) aaa ${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in new issue