变更产值

This commit is contained in:
2025-08-23 10:32:14 +08:00
parent a2b33f3b53
commit c2ce524ef3

View File

@ -6,22 +6,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="purchaseValueAA" resultType="org.dromara.out.domain.BusProcurement">
SELECT
b.name,
b.specification,
b.unit,
(SELECT SUM(accepted_quantity) FROM mat_material_receive_item WHERE project_id = #{projectId} and name = b.name and specification = b.specification) as acceptedQuantity,
a.unit_price,
DATE_FORMAT(b.create_time,'%Y-%m') as yf
FROM
bus_bidding_limit_list as a
RIGHT JOIN mat_material_receive_item as b on b.`name` = a.`name` and b.specification = a.specification
WHERE
b.project_id = #{projectId}
<if test="planMonth != null and planMonth!=''">
and DATE_FORMAT(b.create_time,'%Y-%m') = #{planMonth}
</if>
GROUP BY yf,b.name,b.specification
<!-- SELECT-->
<!-- b.name,-->
<!-- b.specification,-->
<!-- b.unit,-->
<!-- (SELECT SUM(accepted_quantity) FROM mat_material_receive_item WHERE project_id = #{projectId} and name = b.name and specification = b.specification) as acceptedQuantity,-->
<!-- a.unit_price,-->
<!-- DATE_FORMAT(b.create_time,'%Y-%m') as yf-->
<!-- FROM-->
<!-- bus_bidding_limit_list as a-->
<!-- RIGHT JOIN mat_material_receive_item as b on b.`name` = a.`name` and b.specification = a.specification-->
<!-- WHERE-->
<!-- b.project_id = #{projectId}-->
<!-- <if test="planMonth != null and planMonth!=''">-->
<!-- and DATE_FORMAT(b.create_time,'%Y-%m') = #{planMonth}-->
<!-- </if>-->
<!-- GROUP BY yf,b.name,b.specification-->
SELECT
a.NAME,
a.specification,
a.unit,
sum(a.quantity),
DATE_FORMAT( a.create_time, '%Y-%m' ) AS yf
FROM
bus_bidding_limit_list AS a
<where>
a.project_id = #{projectId}
<if test="planMonth != null and planMonth!='' ">
and DATE_FORMAT(b.create_time,'%Y-%m') = #{planMonth}
</if>
</where>
GROUP BY
yf,
a.NAME,
a.specification
</select>
<select id="purchaseValueBB" resultType="org.dromara.out.domain.BusProcurement">